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 DataKinds #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| module Main where | |
| import Control.Applicative | |
| import Data.Attoparsec.Text as 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
| pattern (:-) :: Char -> T.Text -> T.Text | |
| pattern x :- xs <- (T.uncons -> Just (x, xs)) | |
| where x :- xs = T.cons x xs | |
| infixr 5 :- | |
| -- No need for (Just (x, (Just (y, ys)), it automatically uncons + desugar | |
| t :: T.Text -> T.Text | |
| t (x :- y :- ys) = ys | |
| t _ = "" |
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 AllowAmbiguousTypes #-} | |
| {-# LANGUAGE ConstraintKinds #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE InstanceSigs #-} | |
| {-# LANGUAGE PatternSynonyms #-} | |
| {-# LANGUAGE PolyKinds #-} | |
| {-# LANGUAGE RankNTypes #-} |
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
| data Vect :: Nat -> * -> * where | |
| Cons :: KnownNat n => a -> Vect (n - 1) a -> Vect n a | |
| Nil :: (KnownNat n, 0 <= n) => Vect n a | |
| k :: Vect 1 Int | |
| k = Cons 1 Nil | |
| u :: Vect 0 Int | |
| u = Nil |
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
| data State | |
| = Init | |
| | Header Int | |
| Int | |
| | Meta | |
| data Tree a | |
| = Node Int (V.Vector (Tree a)) | |
| | Leaf 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
| {-# LANGUAGE DeriveFunctor #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| import GHC.Generics | |
| main :: IO () | |
| main = putStrLn "Hello" |
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
| with import <nixpkgs> {}; | |
| let | |
| haxe = | |
| let | |
| mkVersion = version: sha256: | |
| stdenv.mkDerivation { | |
| name = "haxe-${version}"; | |
| inherit version; | |
| nativeBuildInputs = [ autoPatchelfHook ]; | |
| buildInputs = [ ocaml zlib pcre neko ocamlPackages.camlp4 ]; |
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
| { pkgs ? import <nixpkgs> {} }: with pkgs; | |
| let | |
| clever-tools-src = | |
| stdenv.mkDerivation rec { | |
| name = "clever-tools-${version}"; | |
| version = "1.2.2-beta.0"; | |
| phases = [ "installPhase" ]; | |
| src = builtins.fetchurl { | |
| url = "https://github.com/CleverCloud/clever-tools/archive/${version}.tar.gz"; |
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
| { pkgs ? import <nixpkgs> {} }: with pkgs; | |
| let | |
| node2nix = nodePackages.node2nix; | |
| emmet = stdenv.mkDerivation rec { | |
| name = "emmet-cli-${version}"; | |
| version = "1.2.0"; | |
| phases = [ "installPhase" ]; | |
| src = builtins.fetchurl { | |
| url = "https://github.com/Delapouite/emmet-cli/archive/v${version}.tar.gz"; |
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
| with (import (builtins.fetchTarball { | |
| name = "release-18.09"; | |
| url = https://github.com/nixos/nixpkgs/archive/6d4f3311d4b5662e2703cfd3278fd78bd972a56c.tar.gz; | |
| sha256 = "0f3pmk9bf4g8r9kp4v7wksgw2ass9g2p1p2yl07r0nwlij0zpqr6"; | |
| }) {}); | |
| let | |
| addPostgis = (pg: | |
| buildEnv { | |
| name = "postgresql-and-plugins-${(builtins.parseDrvName pg.name).version}"; | |
| paths = [ pg pg.lib (postgis.override { postgresql = pg; }) ]; |
NewerOlder