Search code examples
functiontypesread-eval-print-loopelm

How to find type of a function in Elm repl


In Haskell you can use :t to find type of a function in ghci, is there an equivalent in elm repl?


Solution

  • I can't try this out because I currently don't have a working elm-repl but off the top of my head, you can just type the function name in the repl and it will answer with the type of the function. This is because the Elm repl will always print the type after a resulting value, so if you input a function name, it will print <function> for the value, followed by the type:

    > not
    
    <function> : Bool -> Bool
    
    >