Skip to content

Instantly share code, notes, and snippets.

@tonyday567
tonyday567 / .travis.yml
Created December 12, 2018 11:02
A multi-ghc/cabal/stack haskell travis
language: haskell
dist: trusty
cache:
directories:
- $HOME/.cabal/packages
- $HOME/.cabal/store
- $HOME/.stack
- $TRAVIS_BUILD_DIR/.stack-work
@tonyday567
tonyday567 / basics.hs
Created August 23, 2018 00:44
numhask basics
#!/usr/bin/env stack
-- stack --install-ghc runghc --resolver nightly-2018-08-17 -- -Wall -O2
{-# LANGUAGE RoleAnnotations #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE DerivingVia #-}
@tonyday567
tonyday567 / Backprop.hs
Created May 24, 2018 04:47
numhask-backprop
#!/usr/bin/env stack
-- stack --install-ghc runghc --resolver lts-11.9 --package backprop-0.2.2.0 --package numhask-prelude-0.0.4.1 --package numhask-0.2.1.0 -- -Wall -O2
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# language DataKinds, PolyKinds, ScopedTypeVariables, UndecidableInstances,
FlexibleInstances, FlexibleContexts, GADTs, TypeFamilies, RankNTypes,
LambdaCase, TypeOperators, ConstraintKinds #-}
import GHC.TypeLits
import Data.Proxy
import Data.Singletons.Prelude
import Data.Singletons.Decide
import Data.Constraint
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleInstances #-}
module Pipes.Getter where
{-# language OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module TestMVC where
import Control.Category hiding ((.),id)
import qualified MVC.Prelude as MVC
import MVC
import qualified Pipes.Prelude as Pipes
import Control.Applicative
vcStd :: Managed (View C.ByteString, Controller C.ByteString)
vcStd = ((,) <$> pure (contramap show MVC.stdoutLines) <*> fmap C.pack <$> MVC.stdinLines)
@tonyday567
tonyday567 / core-cloud.hs
Created March 26, 2014 21:29
core-cloud.hs
tRemote :: Int -> IO ()
tRemote n = do
backend0 <- initializeBackend host portSlave rtable
node0 <- newLocalNode backend0
backend <- initializeBackend host portMaster rtable
node <- newLocalNode backend
Node.runProcess node (remotePipe' n (Node.localNodeId node0))
where
rtable :: RemoteTable
rtable = __remoteTable initRemoteTable
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DefaultSignatures #-}
import GHC.Generics
import Control.Applicative
import Data.Text.Encoding
import Data.Aeson
import Data.Aeson.Types
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as LB