Sæktu https://github.com/tritlo/writ-plugin, búðu til nýja möppu sem heitir TestRFP, bættu því við í cabal.project og
afritaðu skjölin hér að ofan í möppuna, og keyrðu svocabal run test_rfp
til að keyra
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 RebindableSyntax #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TypeInType #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE PartialTypeSignatures #-} | |
{-# LANGUAGE DeriveDataTypeable #-} |
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
FROM ubuntu:16.04 | |
RUN apt-get update && apt-get install -y curl xz-utils build-essential unzip | |
RUN mkdir -p /rpi/ghc/ \ | |
&& curl -sSL http://releases.mobilehaskell.org/x86_64-linux/9824f6e473/ghc-8.4.0.20180109-arm-linux-gnueabihf.tar.xz -o ghc.tar.xz\ | |
&& tar -xvf ghc.tar.xz -C /rpi/ghc/\ | |
&& rm -f ghc.tar.xz | |
RUN mkdir -p /rpi/prebuilt/ \ |
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 GADTs #-} | |
import Data.List | |
import Data.Monoid | |
import Data.Typeable | |
import Data.Dynamic | |
import GHC.Err | |
import GHC.Prim |
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 TypeInType, TypeOperators, TypeFamilies, | |
UndecidableInstances, ConstraintKinds #-} | |
module ONotation where | |
import GHC.TypeLits as L | |
import Data.Type.Bool | |
import Data.Type.Equality | |
-- Simplistic asymptotic polynomials | |
data AsymP = NLogN Nat Nat |
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 numpy as np | |
from PIL import Image | |
w,h = 384, 384 | |
data = np.zeros((w,h,3), dtype=np.uint8) | |
yellow = [255, 255,0] | |
black = [0,0,0] |
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.Bits | |
printXY n = mapM_ print (gen n) | |
where gen 0 = [""] | |
gen n = map (f n) [0..2^(n-1)] | |
f :: Int -> Integer -> String | |
f n i = map (toXY . testBit i) [0..(n-1)] | |
toXY c = if c then 'X' else 'Y' | |
genRec n = (map ('X':) smaller) ++ (map ('Y':) smaller) | |
where smaller = genRec (n-1) |
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 DataKinds #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE TypeFamilies #-} | |
module M where | |
import GHC.TypeLits | |
data Merki = Leyndarmál | Opinbert | |
newtype LIO (l :: Merki) a = LIO {unLIO :: IO a} |
OlderNewer