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.Generic.Rep | |
import Type.Prelude (class IsSymbol, Proxy, reflectSymbol, SProxy(..)) | |
import Control.Monad.Eff (Eff) | |
import Data.Foldable (fold) |
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 VSemigroupoid where | |
data V err a = Valid a | Invalid err | |
data Vfun err a b = Vfun (a -> V err b) | |
instance semigroupoidV :: Semigroupoid (Vfun err) where | |
compose (Vfun f2) (Vfun f1) = (Vfun \a -> case f1 a of | |
Valid b -> f2 b | |
Invalid err -> Invalid err) |
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
const http = require('http'); | |
const port = 3000; | |
const getString = (length) => { | |
var s = "a"; | |
while(s.length * 2 < length) s = s + s; | |
s += s[length - s.length]; | |
return s; | |
}; |
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.IxMonad ((:*>)) | |
import Control.Monad.Eff (Eff) | |
import Control.Monad.Eff.Console (CONSOLE) | |
import Data.String (take) | |
import Debug.Trace (traceAnyA) | |
import Hyper.Node.Server (defaultOptionsWithLogging, runServer) |
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 Utils.Record where | |
import Data.Monoid (class Semigroup, (<>)) | |
import Data.Record (get, modify) | |
import Type.Prelude (class IsSymbol, class RowToList, RLProxy(RLProxy), SProxy(SProxy)) | |
import Type.Row (Cons, Nil) | |
class AppendSubrecordImpl rl bigger smaller where | |
appendSubrecordImpl :: RLProxy rl -> Record bigger -> Record smaller -> Record bigger |
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 Data.Record.Extra.Extra where | |
import Prelude | |
import Data.Monoid (class Monoid, mempty) | |
import Data.Newtype (class Newtype, unwrap, wrap) | |
import Data.Record (get, insert, modify) | |
import Type.Prelude (class IsSymbol, class RowLacks, class RowToList, SProxy(SProxy)) | |
import Type.Row (kind RowList, Nil, Cons, RLProxy(..)) |
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 Wrap where | |
-- | Wrap fields (possibly sublist) into newtype | |
class WrapFields rl row f row' | row f → row' where | |
wrapFieldsImpl ∷ RLProxy rl → (∀ a. a → f a) → Record row → Record row' | |
instance wrapFieldsCons ∷ | |
( IsSymbol name | |
, RowCons name t without row |
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 | |
data Proxy a = Proxy | |
data Zero | |
data Su n | |
type Three = Su (Su (Su Zero)) | |
class Even n where |
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.Foldable (fold) | |
import TryPureScript (p, render, text) | |
-- | Till 0.12 release we don't have instance chains and we have to deal with overlapping instances ourselfs. | |
-- | To define order of type class resolution we have to name instances in alphabetical order. | |
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 | |
data Proxy a b = Proxy | |
data Zero | |
data Succ n | |
data True | |
data False |
OlderNewer