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

javascript - IndexedDB error: Uncaught DataCloneError: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned -

amazon web services - When using Cognito credentials with AWS in a browser (javascript), keep getting "missing credentials" error -

c# - How to set the datatextfield value instead of the value on a drop down list? -