Skip to content

Instantly share code, notes, and snippets.

module Main (class Foo, foo, BProxy) where
foreign import kind Boolean
foreign import data False :: Boolean
foreign import data True :: Boolean
data BProxy (boolean :: Boolean)
= BProxy
module Main where
import Prelude
import Control.Monad.Eff.Console (log)
import TryPureScript (render, withConsole)
-- A type class for types which can be used with
-- string interpolation.
class Interpolate a | -> a where
interpolate :: a -> String
module Main where
import Data.Either (Either(Left, Right))
import Data.Tuple (Tuple(Tuple))
import Data.Unit (Unit, unit)
import Data.Void (Void, absurd)
import Type.Proxy (Proxy(Proxy))
class Function f a b | f -> a b where
apply :: Proxy f -> a -> b

Keybase proof

I hereby claim:

  • I am joneshf on github.
  • I am joneshf (https://keybase.io/joneshf) on keybase.
  • I have a public key ASDjZ9myjqKWcnqFzcetkGUSpLK673fo_wdRFhDk67edTwo

To claim this, I am signing this object:

@joneshf
joneshf / Main.purs
Last active September 11, 2017 04:17
module Main where
import Prelude
import Control.Monad.Eff.Console (log)
import Data.List ((..))
import TryPureScript (render, withConsole)
main = render =<< withConsole do
log $ lazyConst "not so fast" (0 .. 10000000)
-- uncomment this and you might crash your browser
module Main where
import Prelude
import Control.Monad.Eff.Console (log)
import Data.List ((..))
import TryPureScript (render, withConsole)
main = render =<< withConsole do
log $ lazyConst "compiles quick" (bottom .. top)
module Main where
import Flare (textarea)
module Main where
import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, logShow)
import Control.Monad.Except (runExcept)
import Data.Either (Either(..))
import Data.Foreign (ForeignError(..))
import Data.Foreign.Generic (defaultOptions, genericDecodeJSON)
module Main where
class Foo f where
bar :: f ()
instance fooBaz :: Foo
module Main where
times :: forall a f. Semigroup f a (Int -> a -> a)
times n x = times n x
-- Adding explicit types doesn't work either
-- times' :: forall a f. Semigroup f a (Int -> a -> a)
-- times' n x = (times' :: Semigroup f a (Int -> a -> a)) n x
-- This doesn't work either