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 BinChar | |
-- %default total | |
-- Binary literals | |
data BinChar : Char -> Type where | |
O : BinChar '0' | |
I : BinChar '1' | |
data Every : (a -> Type) -> List a -> Type where |
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 ParserExperiment | |
( statementParser | |
) where | |
import Control.Applicative ( (<*) ) | |
import Data.Functor ( (<$) ) | |
import Text.Parsec | |
import Text.Parsec.Char ( upper ) | |
type Identifier = String |
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
#!/usr/bin/env stack | |
-- stack --resolver lts-9.21 --install-ghc runghc --package aeson --package lens --package protolude --package safe --package servant --package superrecord --package text --package time --package warp | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE NoImplicitPrelude #-} | |
{-# LANGUAGE OverloadedLabels #-} | |
{-# LANGUAGE OverloadedStrings #-} |
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
type Enum a | |
= Enum | |
{ predFn : a -> Maybe a | |
, succFn : a -> Maybe a | |
} | |
pred : Enum a -> a -> Maybe a | |
pred (Enum { predFn }) = | |
predFn |
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 TreeFolds where | |
data Tree a | |
= Leaf a | |
| Branch (Tree a) (Tree a) | |
deriving (Eq, Ord, Read, Show) | |
instance Foldable Tree where | |
foldMap f (Leaf a) = f a | |
foldMap f (Branch l r) = foldMap f l `mappend` foldMap f r |
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 #-} | |
-- | A simple example of a Reflex application that uses both elm style "global" | |
-- state and component level "local" state. The global state is a counter that | |
-- can be incremented and decremented by buttons that remember how many times | |
-- they have been clicked. | |
module Main where | |
import Control.Applicative |
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
:set prompt "λ: " | |
:set -fno-warn-unused-imports | |
:def hlint const . return $ ":! hlint \"src\"" | |
:def hoogle \s -> return $ ":! hoogle --count=15 \"" ++ s ++ "\"" | |
:def pl return . (":! pointfree \"" ++) . (++ "\"") |
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
type Branches | |
= Epistemology | |
| Ethics | |
| Logic | |
| Metaphysics | |
type Branches = | |
| Epistemology | |
| Ethics |
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
CREATE VIEW salesforce.actual_sf_task_count AS | |
SELECT COUNT(*) sf_task_count | |
FROM salesforce.sf_task; | |
-- [local]:5432 salesforce@salesforce # SELECT * FROM actual_sf_task_count; | |
-- +---------------+ | |
-- | sf_task_count | | |
-- +---------------+ | |
-- | 8226055 | | |
-- +---------------+ |
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 Main where | |
import Data.Map (Map) | |
import qualified Data.Map as Map | |
main = let someItems = [1, 2, 3, 4] | |
someMapping = Map.fromList [ ("ST", "started") | |
, ("IP", "in progress") | |
, ("DN", "done") | |
] |