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
Post a Comment