-- Fibinachi using fixpoint and lazy
lazyFib :: Int -> Lazy Int
lazyFib x
| x < 2 = defer \_ -> 1
| otherwise = defer \_ -> (force $ (lazyFib (x-1))) + (force $ (lazyFib (x-2)))
fixFib :: (Int -> Int)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Some initial work on an object differ. | |
var difference = Delta( | |
{ | |
a:{m:1}, | |
c:22 | |
}, | |
{ | |
a:{n:1}, | |
b:7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | A dystopian phone system that punishes users who | |
-- | call the business when it is not open. Calls outside of | |
-- | business hours are put into a call queue that will never | |
-- | be answered. | |
module Main where | |
import Prelude | |
import Control.Monad.Eff (Eff) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module RecursionSchemesExample where | |
import Prelude | |
import Control.Monad.Free (Free, liftF) | |
import Data.Foldable (foldMap) | |
import Data.Functor.Nu (Nu) | |
import Data.List (List, catMaybes, null) | |
import Data.Tuple (Tuple(..)) | |
import Matryoshka as M |
Note: It's probably easier to run a local installation of pursuit.
If pulp docs --with-dependencies
or psc-docs
isn't working for you, this one-liner may be helpful to generate
documentation. Run the following command in your project root, and you should get a set of .md
files in the
docs
directory along with a single index.html
file (You'll need to install pandoc).

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
-- bower install | |
-- "purescript-prelude": "^2.5.0" | |
-- "purescript-console": "^2.0.0" | |
-- "purescript-affjax": "^3.0.2" | |
import Prelude | |
import Control.Monad.Aff (launchAff) | |
import Control.Monad.Aff.Console (log) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MultipleConsumerCoroutine where | |
import Prelude | |
import Data.List as List | |
import Data.List.NonEmpty as NEList | |
import Control.Coroutine (Consumer, Producer, Transformer, await, connect, emit, joinConsumers, runProcess, transform, transformConsumer) | |
import Control.Monad.Aff (Aff, launchAff) | |
import Control.Monad.Aff.Console (log, CONSOLE) | |
import Control.Monad.Eff (Eff) | |
import Control.Monad.Eff.Exception (EXCEPTION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Prelude | |
import Control.Monad.Eff (Eff) | |
import Control.Monad.Eff.Console (CONSOLE, log, logShow) | |
import Control.Monad.Except (runExcept, throwError) | |
import Data.Array (head, last, length) | |
import Data.Either (Either(Right, Left)) | |
import Data.Foldable (traverse_) | |
import Data.Foreign (F, ForeignError(..), readString, toForeign) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Prelude | |
import Data.Either (either) | |
import Control.Monad.Aff (Aff, attempt, cancel, forkAff, later', launchAff) | |
import Control.Monad.Aff.Console (CONSOLE, log, logShow) | |
import Control.Monad.Eff.Exception (error) | |
getUpdate :: forall e. Aff (console :: CONSOLE | e) String | |
getUpdate = do |
NewerOlder