Specify Function Arguments using Types in PureScript

Share this video with your friends

Send Tweet

JavaScript does its error-checking at runtime, but PureScript has a compiler, which makes sure that your program has no errors before it converts it all into JavaScript.

PureScript's compiler uses a type system to catch errors so that you aren’t accidentally mismatching your types. We will learn the very basics of type declarations, how they work in a statically typed language like PureScript, and see simple examples of them in action.

Join in by going to PureScripts online editor

Stephen Matthew Davies
Stephen Matthew Davies
~ 4 years ago

This. course needs a little updating, some of the examples no longer work.

Alan
Alan
~ 3 years ago

Examples work for the indicated PureScript versions 0.11-0.12.

For later versions, change the line: import Control.Monad.Eff.Console (log) to: import Effect.Console (log)