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 DeriveGeneric #-} | |
{- Building a tree based on its bfs result. -} | |
module BFS where | |
import Test.QuickCheck hiding ((><)) | |
import GHC.Generics | |
import Generic.Random | |
import Data.Sequence (Seq (..), singleton, (><)) |
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 FlexibleContexts, FlexibleInstances #-} | |
{-# LANGUAGE TypeInType , ScopedTypeVariables , TypeFamilies, TypeOperators #-} | |
{-# LANGUAGE GADTs, StandaloneDeriving #-} | |
{-# LANGUAGE Safe #-} | |
module Unification where | |
import Data.Kind | |
import Prelude hiding ((++)) |
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 TypeFamilies, DataKinds, KindSignatures, GADTs #-} | |
{- TypeFamilies is required to define type-level functions -} | |
data Nat = Zero | Succ Nat | |
data Fin :: Nat -> * where | |
FZero :: Fin ('Succ n) | |
FSucc :: Fin n -> Fin ('Succ n) | |
data Vector (a :: *) :: Nat -> * where |
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 FlexibleContexts, BangPatterns #-} | |
import Data.IntMap.Strict | |
import Data.Maybe | |
import Data.Function | |
import Control.Monad.Identity | |
import Control.Monad.State.Lazy hiding (fix) | |
import Prelude hiding (lookup) |
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 UnicodeSyntax #-} | |
{-# LANGUAGE TupleSections #-} | |
module Caesar where | |
import Data.Map (Map, fromList, fromListWith, unionWith) | |
import Data.Char | |
import Data.List | |
import Data.Function | |
encode ∷ Int → String → String |
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 FlexibleInstances #-} | |
{-# LANGUAGe FlexibleContexts #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
module ReadExcept ( | |
module ReadExcept | |
, module Control.Monad.Reader | |
, module Control.Monad.Except | |
, module Control.Monad.Identity | |
) where |
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 FlexibleContexts #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE ExistentialQuantification #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE TypeSynonymInstances #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
module JSON_RPC where | |
import ReadExcept |
NewerOlder