haskell - function defintion inside GHCi -


is possible write multi-line function definitions type-signature inside ghci (as write in source file)?

i've tried far this:

prelude> :{ prelude| let f :: int -> int; prelude| f = + 1 prelude| :}  <interactive>:9:1: parse error on input ‘f’ 

but didn't work... there else try? thx in advance.

mind indentation:

prelude> :{ prelude| let f :: int -> int prelude|     f = + 1 prelude| :} prelude> :t f f :: int -> int prelude> f 1 2 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -