Memo Ypsilon

IT, dev, CS

Home Archives
2018-01-28
Haskell

Declare functions with type in ghci

To declare a function inside GHCi one should use a let word for function name.

To declare the type explicitly it should be specified after declaring a function name, and the function body should go next after a semicolon:

1
let myFunc :: Int -> Int -> Int; myFunc x y = x + y

or on the next line but with identation:

1
2
let myFunc :: Int -> Int -> Int
myFunc = (+)

Share Comments
  • GHCi
  • haskell
Newer
Run haskell program in watch mode for development
Older
SSH config example

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