GHCi now has a multiline-input mode, enabled with :set +m. For example,
Prelude> :set +m
Prelude> let fac 0 = 1
Prelude| fac n = n * fac (n-1)
Prelude|
Prelude> fac 10
3628800
More Related Contents:
- Multi-line commands in GHCi
- :sprint for polymorphic values?
- Function definition by special cases in GHCi
- Prefix form of unary operator in Haskell
- Haskell \p -> not takeWhile
- Sum of two numbers with function in haskell
- How to group similar items in a list using Haskell?
- When is memoization automatic in GHC Haskell?
- How to get normal value from IO action in Haskell
- What does the “@” symbol mean in reference to lists in Haskell?
- New state of the art in unlimited generation of Hamming sequence
- How do you represent a graph in Haskell?
- Haskell types frustrating a simple ‘average’ function
- What’s the “|” for in a Haskell class definition?
- Lifting a higher order function in Haskell
- Distinction between typeclasses MonadPlus, Alternative, and Monoid?
- How do I write, “if typeclass a, then a is also an instance of b by this definition.”
- Why do we need monads?
- Lambda for type expressions in Haskell?
- Pattern matching identical values
- Composing Monads v. Applicative Functors
- Abusing the algebra of algebraic data types – why does this work?
- What does the : infix operator do in Haskell?
- Monoidal Functor is Applicative but where is the Monoid typeclass in the definition of Applicative?
- How to return a pure value from a impure method
- How to convert Unicode Escape Sequence to Unicode String in Haskell
- Functional lenses
- How to reuse a type variable in an inner type declaration
- How does Haskell printf work?
- Sampling sequences of random numbers in Haskell