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 Control.Monad (when) | |
import System.Exit (exitSuccess) | |
import System.Posix.Process (forkProcess) | |
fork_ :: Integer -> IO () | |
fork_ n | n > 0 = do pid <- forkProcess (fork_ $ n - 1) | |
when (pid /= 0) exitSuccess | |
| otherwise = putStrLn "I'm done!" | |
main :: IO () |
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 GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
module MonadControlGHC8 where | |
import Control.Applicative (Alternative, Applicative) | |
import Control.Monad.Base (MonadBase) | |
import Control.Monad.Reader (MonadReader, ReaderT) |
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 ScopedTypeVariables #-} | |
import Data.IP | |
import Data.IP.RouteTable (IPRTable) | |
import qualified Data.IP.RouteTable as RT | |
import System.Environment (getArgs) | |
main :: IO () | |
main = do [path] <- getArgs | |
nets <- map read . lines <$> readFile path | |
let rt :: IPRTable IPv4 () = RT.fromList $ zip nets (repeat ()) |
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 FlexibleContexts #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
import Data.Proxy | |
import Unsafe.Coerce | |
class KnownBool (b :: Bool) 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
#!/usr/bin/env bash | |
SERVERS=( haskell-language-server-wrapper hie-wrapper haskell-language-server hie ghcide ) | |
SERVER= | |
SERVER_PATH= | |
NIX_FILES=( shell.nix default.nix nix/shell.nix nix/default.nix ) | |
NIX_CMD= |