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 TypeFamilies #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
import Data.Time | |
type family TimeDiff a where | |
TimeDiff UTCTime = NominalDiffTime | |
TimeDiff a = 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
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE ExplicitNamespaces #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
module Foo 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
-- stylistic | |
{-# LANGUAGE LambdaCase #-} | |
-- singletons | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE Rank2Types #-} | |
{-# LANGUAGE GADTs #-} | |
-- main | |
{-# LANGUAGE DataKinds #-} -- typelevel programming | |
{-# LANGUAGE TypeFamilies #-} -- typelevel programming | |
{-# LANGUAGE ScopedTypeVariables #-} -- typelevel programming |
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 ExistentialQuantification #-} | |
-- base | |
import Control.Exception | |
import Control.Concurrent.MVar | |
import Control.Monad | |
import Data.IORef | |
import System.IO.Unsafe |
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 TemplateHaskell, StandaloneDeriving, MultiParamTypeClasses, TypeFamilies, GeneralizedNewtypeDeriving #-} | |
import Control.Monad | |
import Control.Concurrent | |
import Control.Distributed.Process | |
import Control.Distributed.Process.Backend.SimpleLocalnet | |
import Control.Distributed.Process.Closure | |
import Control.Distributed.Process.Internal.Types (Process(..), LocalProcess) | |
import Control.Distributed.Process.Node (initRemoteTable) | |
import Control.Monad.Base (MonadBase(..)) |
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
import Data.List | |
import Control.Monad.ST | |
import Control.Monad | |
import Data.Array.ST | |
import Data.Array.Unboxed | |
data Exp = IfGt Int Int Block Block -- if a[i] > a[j] then blk1 else blk2 | |
| Swap Int Int -- a[i] <-> a[j] (i,j < 8) | |
| Copy Int Int -- a[i] <- a[j] (i > 7) | |
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 BangPatterns #-} | |
import Control.Applicative | |
import Prelude hiding (minimum, sum) | |
import Data.List (permutations) | |
import Control.Monad.ST | |
import Data.Bifunctor (second) | |
-- import Control.Monad | |
-- import Data.Array.ST | |
-- import Data.Array.Unboxed | |
import Data.Vector.Unboxed (Vector) |
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 BangPatterns #-} | |
module Main where | |
import qualified Data.ByteString as BS | |
import System.IO | |
import Control.Monad | |
import Data.Bits | |
import Data.Word | |
import Data.Monoid | |
import Network.Openflow.StrictPut |
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
import Data.Default | |
import Debug.Trace | |
class Magick a where | |
magickStorage :: [a] -> String | |
instance Magick Int where | |
magickStorage = const "Int" | |
instance Magick Char 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
{-# LANGUAGE TemplateHaskell #-} | |
module DeriveADT | |
( deriveExtract | |
, deriveIs | |
) where | |
import Data.Maybe | |
import Data.Char | |
import Language.Haskell.TH |
NewerOlder