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
> {-# LANGUAGE RankNTypes, DataKinds, KindSignatures, GADTs #-} | |
> import Unsafe.Coerce | |
> data M = A | B deriving (Show, Eq) | |
> data V1 :: M -> * where | |
> V1A :: Int -> V1 A | |
> V1B :: Double -> V1 B | |
> V1a :: () -> V1 a |
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
Betty:flamingra lelf$ cabal configure | |
Resolving dependencies... | |
Configuring flamingra-0.1.0.0... | |
Betty:flamingra lelf$ cabal haddock --html-location='/package/$pkg-$version/docs' --contents-location='/package/$pkg-$version' | |
Running Haddock for flamingra-0.1.0.0... | |
Preprocessing library flamingra-0.1.0.0... | |
Haddock coverage: | |
0% ( 0 / 1) in 'I'mHereOnlyToPleaseHaddock' | |
Documentation created: dist/doc/html/flamingra/index.html |
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
Betty:fake lelf$ cabal install "mtl-2.2.1" "text-1.2.1.1" "hashable-1.2.3.3" "parsec-3.1.9" "scientific-0.3.3.8" "attoparsec-0.13.0.0" | |
Resolving dependencies... | |
All the requested packages are already installed: | |
hashable-1.2.3.3 | |
mtl-2.2.1 | |
parsec-3.1.9 | |
scientific-0.3.3.8 | |
text-1.2.1.1 | |
Use --reinstall if you want to reinstall anyway. |
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
Betty:fake lelf$ cabal --version | |
cabal-install version 1.22.6.0 | |
using version 1.22.4.0 of the Cabal library | |
Betty:fake lelf$ cabal install "mtl-2.2.1" "text-1.2.1.1" "hashable-1.2.3.3" "parsec-3.1.9" "scientific-0.3.3.8" "kill-me-666.666" | |
Resolving dependencies... | |
All the requested packages are already installed: | |
hashable-1.2.3.3 | |
mtl-2.2.1 | |
parsec-3.1.9 |
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
import Data.List | |
import Data.Array | |
import Data.Maybe | |
import Data.Char | |
import Data.List.Split | |
import Control.Arrow | |
data File = A|B|C|D|E|F|G|H deriving (Enum,Show,Eq,Ord,Ix) | |
type Dist = 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
import Control.Arrow | |
import Data.List | |
import Data.Maybe | |
import Data.Ord | |
import qualified Data.Set as S | |
type State = (Integer,Integer) | |
data Vessel = A | B deriving (Show,Eq) |
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
-- MIND YOUR EYES! DIRTY CODE AHEAD. | |
import Control.Monad | |
import qualified Data.Map as M | |
import qualified Data.Set as S | |
import Data.List | |
import System | |
import System.IO | |
import Data.List | |
import Data.Ord |
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
import Control.Monad.Logic | |
import Data.List | |
foo :: Logic Bool | |
foo = do [c2,c3,c4,c5,c6,c7,cJ,cA] <- sequence . replicate 8 $ return True `mplus` return False | |
guard $ c3 `thinks` sane cA | |
guard $ c4 `thinks` not (not (sane c2) && not (sane c3)) | |
guard $ c5 `thinks` sane cA == sane c4 | |
guard $ c6 `thinks` sane cA && sane c2 | |
guard $ c7 `thinks` not (sane c5) |
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
{-# LANGUAGE DeriveDataTypeable #-} | |
import Data.Generics.Zipper | |
import Data.Data | |
-- | our tree def | |
data Tree a = Empty | Fork a (Tree a) (Tree a) | |
deriving (Typeable,Data) |
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 PI where | |
import Data.Number.CReal | |
import Data.List | |
fractPartToBase :: RealFrac x => Int -> x -> [Int] | |
fractPartToBase base x = unfoldr f x | |
where f d = Just (d'int, d' - fromIntegral d'int) | |
where d' = d * fromIntegral base |
OlderNewer