Skip to content

Instantly share code, notes, and snippets.

@dgendill
Last active April 2, 2016 17:52
Show Gist options
  • Save dgendill/c5c573cfbd1f4f042ea645285a8fe8b3 to your computer and use it in GitHub Desktop.
Save dgendill/c5c573cfbd1f4f042ea645285a8fe8b3 to your computer and use it in GitHub Desktop.
This is a blank starting point for working with PureScript. It can pasted into http://try.purescript.org/ as a starting point for the exercises on PureScript by Example https://leanpub.com/purescript/read
module Main where
import Prelude
import Data.Array (replicate)
import Data.String (length, fromCharArray)
import Data.Foldable (for_)
import Control.Monad.Eff
import Control.Monad.Eff.Console (log, print)
main = do
newline
print $ "Hello"
newline
where
newline = log " "
-- To find the package that a module is contained in, you can search
-- for the module name on https://pursuit.purescript.org, e.g.
-- https://pursuit.purescript.org/search?q=Data.Array
-- https://pursuit.purescript.org/search?q=Data.String
module Main where
import Prelude
-- Found in purescript-arrays
-- bower install --save purescript-arrays
-- https://pursuit.purescript.org/packages/purescript-arrays/0.4.5/docs/Data.Array
import Data.Array (replicate)
-- Found in purescript-strings package
-- bower install --save purescript-strings
-- https://pursuit.purescript.org/packages/purescript-strings/0.7.1/docs/Data.String
import Data.String (length, fromCharArray)
-- Found in purescript-foldable-traversable
-- bower install --save purescript-foldable-traversable
-- https://pursuit.purescript.org/packages/purescript-foldable-traversable/0.4.2/docs/Data.Foldable
import Data.Foldable (for_)
-- Found in purescript-eff
-- bower install purescript-eff
import Control.Monad.Eff
-- Found in purescript-console
-- bower install purescript-console
-- https://pursuit.purescript.org/packages/purescript-console/0.1.1/docs/Control.Monad.Eff.Console
import Control.Monad.Eff.Console (log, print)
main = do
newline
print $ "Hello"
newline
where
newline = log " "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment