This file contains hidden or 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
let {event, map, filter, accumulate, forEach} = require("./frp.js") | |
let {signal: time, feed} = event() | |
var encodedTime = map(time, x => new Date(x)) | |
var oddSeconds = filter(encodedTime, time => time.getSeconds() % 2 == 1) | |
var threeLastTimesWithOddSeconds = |
This file contains hidden or 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
{-# language ExistentialQuantification #-} | |
{-# language NoMonomorphismRestriction #-} | |
import Data.List | |
import Data.List.Utils | |
data Validate a | |
= Property String (a -> Bool) | |
| Any [Validate a] |
This file contains hidden or 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
corecursion(Name, App, Deep, [{C, Before, After} | Stack]) :- | |
App =.. [app, ctor(C) | Rest], | |
append([Before, [It], After], Rest), | |
corecursion(Name, It, Deep, Stack). | |
corecursion(Name, App, Rest, []) :- | |
App =.. [app, Name | Rest]. | |
deepest_corecursion(Name, App, Scheme, Stack) :- |
This file contains hidden or 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
{-# language ScopedTypeVariables, GADTs #-} | |
import Data.Ord (comparing) | |
import Data.List | |
import Data.List.Utils | |
import Control.Arrow | |
import Control.Monad | |
import Control.Monad.Except |
This file contains hidden or 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 DistinctTriplet where | |
import Data.List (nub) | |
import Test.QuickCheck | |
-- used as container to generate 3 distinct values | |
data DistinctTriplet a = Distinct a a a | |
deriving (Show) |
This file contains hidden or 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
class Match | |
def initialize x | |
@x = x | |
self | |
end | |
def self.of x | |
Match.new x | |
end |
This file contains hidden or 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
import Dict exposing (Dict) | |
import Maybe exposing (withDefault) | |
import String | |
import Text | |
import Signal | |
import Keyboard | |
import Char | |
import Graphics.Element as Element exposing (Element) | |
import Graphics.Collage as Collage exposing (Form) |
This file contains hidden or 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
{-# language FlexibleInstances, UndecidableInstances, TypeSynonymInstances #-} | |
import Prelude hiding (mapM) | |
import Control.Monad.State hiding (mapM) | |
import Control.Applicative | |
import Data.Traversable | |
import Data.Foldable | |
import Data.Monoid |
This file contains hidden or 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
{-# LANGUAGE OverloadedStrings #-} | |
import Network.Wreq (post, partFile, responseBody) | |
import Control.Lens ((^.)) | |
import Data.ByteString.Lazy.Char8 as BS | |
main = do |
This file contains hidden or 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
{-# LANGUAGE RecursiveDo, ScopedTypeVariables #-} | |
module Event where | |
import Control.Monad | |
import Data.IORef | |
import Data.Map as Map |