Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

multiline-repl-definition

Multi-line commands in GHCi

November 16, 2022 by Tarik

Most of the time, you can rely on type inference to work out a signature for you. In your example, the following is sufficient: Prelude> let addTwo x y = x + y If you really want a definition with a type signature, or your definition spans over multiple lines, you can do this in … Read more

Categories haskell Tags ghci, haskell, multiline-repl-definition Leave a comment

How to define a function in ghci across multiple lines?

October 21, 2022 by Tarik

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

Categories haskell Tags ghci, haskell, multiline-repl-definition Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa