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
| waitForPort :: Int -> IO () | |
| waitForPort port = handle (\(_ :: IOException) -> threadDelay 10000 >> waitForDB port) $ do | |
| let hints = defaultHints | |
| { addrFlags = | |
| [ AI_NUMERICHOST | |
| , AI_NUMERICSERV | |
| ] | |
| , addrSocketType = Stream | |
| } | |
| addr:_ <- getAddrInfo (Just hints) (Just "127.0.0.1") (Just $ show port) |
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 OverloadedLists #-} | |
| {-# LANGUAGE LambdaCase #-} | |
| module Network.TCP where | |
| import Data.Set (Set) | |
| data PacketFlag = NS | CWR | ECE | URG | ACK | PSH | RST | SYN | FIN | |
| deriving (Eq, Show, Ord) | |
| type Packet = Set PacketFlag |
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 Edit a | |
| = Insert a | |
| | Delete a | |
| | Same a | |
| deriving (Show, Eq) | |
| isSame :: Edit a -> Bool | |
| isSame x = case x of | |
| Insert {} -> False | |
| Delete {} -> False |
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
| foldRRec :: forall f xs c a b p. | |
| RecAll f xs c | |
| => p c | |
| -> (forall x. c x => x -> a) | |
| -> (a -> b -> b) | |
| -> b | |
| -> NP f xs | |
| -> b | |
| foldRRec p convert f z xs | |
| = foldRRec' convert f z |
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 FlexibleContexts #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE UndecidableInstances #-} | |
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| {-# LANGUAGE StandaloneDeriving #-} | |
| module Approx where | |
| import Data.Reflection | |
| import Data.Proxy | |
| import Foreign.Storable |
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 PolyKinds #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| {-# LANGUAGE UndecidableInstances #-} | |
| {-# LANGUAGE OverlappingInstances #-} | |
| {-# LANGUAGE FunctionalDependencies #-} |
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 PolyKinds #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE FunctionalDependencies #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE RankNTypes #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| {-# LANGUAGE GADTs #-} |
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 PolyKinds #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE FunctionalDependencies #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE RankNTypes #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| {-# LANGUAGE GADTs #-} |
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 FlexibleContexts #-} | |
| module Algebra.Monomial where | |
| import Data.List | |
| import Data.Function | |
| import Text.Parsec hiding (parse) | |
| import qualified Text.Parsec.Token as P | |
| import qualified Text.Parsec.Language as P | |
| import Control.Applicative ((<$>)) | |
| import Data.Functor.Identity |
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 PolyKinds, DataKinds, TemplateHaskell, TypeFamilies, | |
| GADTs, TypeOperators, RankNTypes, FlexibleContexts, UndecidableInstances, | |
| FlexibleInstances, ScopedTypeVariables, MultiParamTypeClasses, | |
| OverlappingInstances, TemplateHaskell #-} | |
| module Oxymoron.Regions.TAssociativeArray where | |
| import Data.Singletons | |
| singletons [d| data AssocArray a b = AssocArray [(a, b)] |] | |
| type instance ('AssocArray xs) :==: ('AssocArray ys) = |