Memo Ypsilon

IT, dev, CS

Home Archives
2017-01-10
Haskell

GHCi multiline

When in haskell REPL (ghci), to use multiline definitions:

First way, is to use blocks, like this:

1
2
3
4
Prelude> :{
Prelude| let addTwo :: Int -> Int -> Int
Prelude| addTwo x y = x + y
Prelude| :}

Second way, use multiline mode:

1
2
3
4
5
Prelude> :set +m
Prelude> let addTwo :: Int -> Int -> Int
Prelude| addTwo x y = x + y
Prelude|
Prelude> addTwo 1 3

Also, don’t forget, function definitions must start from let in REPL.

Links

http://stackoverflow.com/questions/8443035/multi-line-commands-in-ghci

Share Comments
  • GHCi
  • haskell
Newer
Get linux mint dns settings
Older
Reduce haskell binary

Categories

  • Admin
  • Fonts
  • Git
  • Haskell
  • JavaScript
  • Web Development

Tags

  • Authentication
  • EcmaScript
  • GHCi
  • GPG
  • Google
  • JavaScript
  • Oauth
  • admin
  • azery fonts
  • binary
  • cert
  • certificate
  • console
  • dev
  • dns
  • export
  • font
  • frontend
  • git
  • haskell
  • https
  • i18n
  • import
  • letsencrypt
  • linux
  • mint
  • module
  • signature
  • size
  • ssh
  • tmux

Tag Cloud

Authentication EcmaScript GHCi GPG Google JavaScript Oauth admin azery fonts binary cert certificate console dev dns export font frontend git haskell https i18n import letsencrypt linux mint module signature size ssh tmux

Archives

  • April 2020
  • January 2018
  • October 2017
  • March 2017
  • January 2017
  • December 2016
  • August 2016
  • April 2016

Recent Posts

  • Run haskell program in watch mode for development
  • Declare functions with type in ghci
  • SSH config example
  • GPG signed commits on git
  • tmux keys
© 2020 Eldar Aliyev
Powered by Hexo
Home Archives