code
stringlengths
2
1.05M
repo_name
stringlengths
5
101
path
stringlengths
4
991
language
stringclasses
3 values
license
stringclasses
5 values
size
int64
2
1.05M
{-# OPTIONS_GHC -fno-warn-type-defaults -fno-warn-orphans -fno-warn-missing-fields #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE DeriveDataTypeable #-} module Yage.Prelude ( module ClassyPrelude , io, pass , traceShowS, traceShowS', ioTime, printIOTime, traceWith, traceStack , globFp -- list...
MaxDaten/yage-contrib
src/Yage/Prelude.hs
Haskell
mit
3,837
{-# LANGUAGE TemplateHaskell #-} module PeaCoq where import Control.Lens (makeLenses) import Data.IORef (IORef) import Data.IntMap (IntMap) import Snap (Snaplet) import Snap.Snaplet.Session (SessionManager) import System.IO import System.Process (ProcessHandle) type H...
Ptival/peacoq-server
lib/PeaCoq.hs
Haskell
mit
1,192
{-# LANGUAGE CPP #-} #if __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE Trustworthy #-} #endif -- | Reexports "Test.Hspec" from a @Trustworthy@ module. module TestHspecTrustworthy (module Test.Hspec) where import Test.Hspec
haskell-compat/base-compat
base-compat-batteries/test/TestHspecTrustworthy.hs
Haskell
mit
218
{-#LANGUAGE ScopedTypeVariables #-} {-#LANGUAGe DataKinds #-} {-#LANGUAGE DeriveGeneric #-} {-#LANGUAGE DeriveAnyClass #-} {-#LANGUAGE FlexibleContexts #-} module Foreign.Storable.Generic.Internal.GStorableSpec where -- Test tools import Test.Hspec import Test.QuickCheck import GenericType -...
mkloczko/derive-storable
test/Spec/Foreign/Storable/Generic/Internal/GStorableSpec.hs
Haskell
mit
4,354
module Drifter ( -- * Managing Migrations resolveDependencyOrder , changeSequence , migrate -- * Types , Drifter(..) , ChangeName(..) , Change(..) , Description , Method , DBConnection ) where -----------------------------------------------------------------------...
AndrewRademacher/drifter
src/Drifter.hs
Haskell
mit
1,097
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.SVGZoomAndPan (pattern SVG_ZOOMANDPAN_UNKNOWN, pattern SVG_ZOOMANDPAN_DISABLE, pattern SVG_ZOOMANDPAN_MAGNIFY, js_setZoomAndPan, setZoomAndPan, js_getZoomAndPan, getZoomAndPan, SVGZoomAndPan...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/SVGZoomAndPan.hs
Haskell
mit
1,960
{-# LANGUAGE TypeFamilies #-} module Agent.PingPong.Role.Ask where import AgentSystem.Generic import Agent.PingPong import qualified Agent.PingPong.Simple.Ask as Ask import Data.IORef -------------------------------------------------------------------------------- data PingRole = PingRole data PongRole = PongRole ...
fehu/h-agents
test/Agent/PingPong/Role/Ask.hs
Haskell
mit
2,150
module JoScript.Util.Text (foldlM, readFloat, readInt) where import Prelude (read) import Protolude hiding (foldlM) import qualified Data.Text as T foldlM :: Monad m => (b -> Char -> m b) -> b -> Text -> m b foldlM f init bsInit = impl (pure init) bsInit where impl acc bs | T.null bs = acc | otherwise = im...
AKST/jo
source/lib/JoScript/Util/Text.hs
Haskell
mit
486
module GHCJS.TypeScript.Convert.Types where import Language.TypeScript import Data.Monoid data Config = Config { outputDir :: FilePath } data Decl = InterfaceDecl Interface deriving (Show) data OutputModule = OutputModule { omImports :: [String] , omDecls :: [String] } deriving (Show) instance Monoid...
mgsloan/ghcjs-typescript
ghcjs-typescript-convert/GHCJS/TypeScript/Convert/Types.hs
Haskell
mit
530
module Interpreter (Val(..), Expr(..), interpret) where import Debug.Trace data Val = IntVal Integer | StringVal String | BooleanVal Bool -- since we are implementing a Functional language, functions are -- first class citizens. | FunVal [String] Expr Env deriving (Sh...
2015-Fall-UPT-PLDA/homework
02/your_full_name_here.hs
Haskell
mit
8,926
-------------------------------------------------------------------- -- | -- Module : My.Data.Maybe -- Copyright : 2009 (c) Dmitry Antonyuk -- License : MIT -- -- Maintainer: Dmitry Antonyuk <lomeo.nuke@gmail.com> -- Stability : experimental -- Portability: portable -- -- 'Maybe' related utilities. -- -------...
lomeo/my
src/My/Data/Maybe.hs
Haskell
mit
810
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} module Main where import Test.Tasty import Test.Tasty.QuickCheck as QC import Test.QuickCheck.Monadic (assert, monadicIO, run) import Control.Applicative import qualified Data.ByteString as BR import qualified Data.ByteString.Builder as BB import qua...
noexc/mapview
tests/test.hs
Haskell
mit
1,907
module Main where import Control.Arrow (first) import Control.Monad (liftM) import qualified Crypto.Cipher as Cipher import qualified Crypto.Cipher.AES as AES import qualified Crypto.Cipher.Types as CipherTypes import qualified Cryptopals.Set1 as Set1 impor...
charlescharles/cryptopals
src/Main.hs
Haskell
mit
982
module ReaderT where newtype ReaderT r m a = ReaderT { runReaderT :: r -> m a } instance Functor m => Functor (ReaderT r m) where fmap f (ReaderT rma) = ReaderT $ fmap f . rma instance Applicative m => Applicative (ReaderT r m) where pure a = ReaderT $ \_ -> pure a -- fab :: r -> m (a -> b) -- a :: r -> m a ...
JoshuaGross/haskell-learning-log
Code/Haskellbook/ComposeTypes/src/ReaderT.hs
Haskell
mit
563
module Colors.SolarizedDark where colorScheme = "solarized-dark" colorBack = "#002b36" colorFore = "#839496" -- Black color00 = "#073642" color08 = "#002b36" -- Red color01 = "#dc322f" color09 = "#cb4b16" -- Green color02 = "#859900" color10 = "#586e75" -- Yellow color03 = "#b58900" color11 = "#657b83" -- Blue color...
phdenzel/dotfiles
.config/xmonad/lib/Colors/SolarizedDark.hs
Haskell
mit
558
module SpaceAge (Planet(..), ageOn) where data Planet ageOn :: Planet -> Float -> Float ageOn planet seconds = undefined
parkertm/exercism
haskell/space-age/src/SpaceAge.hs
Haskell
mit
123
module Chain where import UU.Parsing import Data.Char main = do let tokens = "s*s*C" resultado <- parseIO pSE tokens putStrLn . show $ resultado instance Symbol Char -- Sintaxis concreta data Class = Class deriving Show {- pRE :: Parser Char RE pRE = pChainl pOp pCla...
andreagenso/java2scala
src/J2s/Chain.hs
Haskell
apache-2.0
855
{-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RoleAnnotations #-} {-# LANGUAGE ScopedTypeVariables #-} -- | -- Module : Data.Map.Justified -- Copyright : (c) Matt Noonan 2017 -- License : BSD-style -- Maintainer : matt.noonan@gmail.com -- Portability : porta...
matt-noonan/justified-containers
src/Data/Map/Justified.hs
Haskell
bsd-2-clause
35,649
{-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ...
anthezium/rcu
src/Control/Concurrent/RCU/STM/Internal.hs
Haskell
bsd-2-clause
5,541
module Handler.PostNew where import Import import Yesod.Form.Bootstrap3 import Yesod.Text.Markdown blogPostNewForm :: AForm Handler BlogPost blogPostNewForm = BlogPost <$> areq textField (bfs ("Title" :: Text)) Nothing <*> lift (liftIO getCurrentTime) <*> lift (liftIO getCurre...
roggenkamps/steveroggenkamp.com
Handler/PostNew.hs
Haskell
bsd-3-clause
1,115
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverlappingInstances #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} ...
notae/haskell-exercise
pack/Pack7.hs
Haskell
bsd-3-clause
1,188
module Util.Command where import System.Exit import Data.Tuple import Data.Map (Map, (!)) import qualified Data.Map as M import Data.Char import Genome.Dna.Kmer import Genome.Dna.Dna data Command = Command {utility :: String, arguments :: Map String String } instance S...
visood/bioalgo
src/lib/Util/Command.hs
Haskell
bsd-3-clause
3,189
{-# Language ScopedTypeVariables #-} module Pipes.Formats where import Control.Monad as M import Data.Array.Accelerate as A import Data.Array.Accelerate.IO as A import qualified Data.Vector.Storable as S import qualified Data.Vector.Storable.Mutable as SM import Pipes import Prelude as P vectorToArray :: (Int,Int...
cpdurham/accelerate-camera-sandbox
src/Pipes/Formats.hs
Haskell
bsd-3-clause
1,722
{-# LANGUAGE QuasiQuotes #-} module System.Console.CmdArgs.Test.SplitJoin(test) where import System.Console.CmdArgs.Explicit import System.Console.CmdArgs.Test.Util import Control.Monad test = do forM_ tests $ \(src,parsed) -> do let a = splitArgs src b1 = joinArgs parsed b2 = j...
ndmitchell/cmdargs
System/Console/CmdArgs/Test/SplitJoin.hs
Haskell
bsd-3-clause
8,627
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE OverloadedStrings #-} ------------------------------------------------------------------------------ -- | This module is where all the routes and handlers are defined for your -- site. The 'app' function is the initializer that combines everything -- together and is exported ...
sethfowler/bzbeaver
src/Site.hs
Haskell
bsd-3-clause
19,014
module Del.Parser where import Control.Applicative import Control.Exception import qualified Data.Set as S import qualified Data.MultiSet as MS import Data.Typeable import Text.Trifecta import Del.Syntax eomParser :: Parser EOM eomParser = many equationParser equationParser :: Parser Equation equationParser = do ...
ishiy1993/mk-sode1
src/Del/Parser.hs
Haskell
bsd-3-clause
2,197
module Trans where import Control.Monad.Trans.Reader import Control.Monad.Trans.State import Data.Functor.Identity import Control.Monad.Trans import Control.Monad.Trans.Maybe import Control.Monad rDec :: Num a => Reader a a rDec = fmap (flip (-) 1) ask rShow :: Show a => ReaderT a Identity String rShow = show <$...
nicklawls/haskellbook
src/Trans.hs
Haskell
bsd-3-clause
998
module Logic.ProofNet where
digitalheir/net-prove
src/Logic/ProofNet.hs
Haskell
bsd-3-clause
27
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} module Language.Epilog.AST.Program ( Program (..) ) where -------------------------------------------------------------------------------- import Language.Epilog.AST.Procedure import Language.Epilog.Epilog (Strings, Types) i...
adgalad/Epilog
src/Haskell/Language/Epilog/AST/Program.hs
Haskell
bsd-3-clause
1,113
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} -- Load information on package sources module Stack.Build.Source ( loadSourceMap , SourceMap , PackageSource (..) ) where import Network.HTTP.Clien...
mietek/stack
src/Stack/Build/Source.hs
Haskell
bsd-3-clause
6,444
{-# LANGUAGE BangPatterns #-} module Atomo.Environment where import Control.Monad.Cont import Control.Monad.State import Data.IORef import Atomo.Method import Atomo.Pattern import Atomo.Pretty import Atomo.Types -- | Evaluate an expression, yielding a value. eval :: Expr -> VM Value eval (EDefine { emPattern = p, e...
vito/atomo
src/Atomo/Environment.hs
Haskell
bsd-3-clause
16,982
module Test where test :: Int -> Int -> IO () test a b = putStrLn $ mconcat [ "Addition: " , show addition , ", Subtraction: " , show subtraction ] where addition = a + b subtraction = a - b main :: ...
hecrj/haskell-format
test/specs/where/output.hs
Haskell
bsd-3-clause
436
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} -- | A pool of handles module Data.Concurrent.Queue.Roq.HandlePool ( -- * Starting the server hroq_handle_pool_server , hroq_handle_pool_server_closure , hroq_handle_pool_server_pid -- * API...
alanz/hroq
src/Data/Concurrent/Queue/Roq/HandlePool.hs
Haskell
bsd-3-clause
8,601
-- -- An AST format for generated code in imperative languages -- module SyntaxImp -- Uncomment the below line to expose all top level symbols for -- repl testing {- () -- -} where data IId = IId [String] (Maybe Int) deriving( Show ) data IAnnTy = INoAnn ITy | IMut ITy -- things are immutable by def...
ethanpailes/bbc
src/SyntaxImp.hs
Haskell
bsd-3-clause
707
{-# LANGUAGE DeriveGeneric #-} -- | This is a wrapper around IO that permits SMT queries module Language.Fixpoint.Solver.Monad ( -- * Type SolveM -- * Execution , runSolverM -- * Get Binds , getBinds -- * SMT Query , filterValid -- * Debug ...
gridaphobe/liquid-fixpoint
src/Language/Fixpoint/Solver/Monad.hs
Haskell
bsd-3-clause
6,560
{-# LANGUAGE OverloadedStrings #-} module TW.Utils where import Data.Char import qualified Data.Text as T capitalizeText :: T.Text -> T.Text capitalizeText = T.pack . go . T.unpack where go (x:xs) = toUpper x : xs go [] = [] uncapitalizeText :: T.Text -> T.Text uncapitalizeText = T.pack . g...
typed-wire/typed-wire
src/TW/Utils.hs
Haskell
mit
490
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="ru-RU"> <title>ViewState</title> <maps> <homeID>viewstate</homeID> <mapref location="ma...
denniskniep/zap-extensions
addOns/viewstate/src/main/javahelp/help_ru_RU/helpset_ru_RU.hs
Haskell
apache-2.0
960
{-# LANGUAGE Haskell98 #-} {-# LINE 1 "Data/Streaming/Zlib.hs" #-} {-# LANGUAGE DeriveDataTypeable #-} -- | This is a middle-level wrapper around the zlib C API. It allows you to -- work fully with bytestrings and not touch the FFI at all, but is still -- low-level enough to allow you to implement high-level abstractio...
phischu/fragnix
tests/packages/scotty/Data.Streaming.Zlib.hs
Haskell
bsd-3-clause
12,910
----------------------------------------------------------------------------- -- | -- Module : Distribution.ParseUtils -- Copyright : (c) The University of Glasgow 2004 -- -- Maintainer : libraries@haskell.org -- Stability : alpha -- Portability : portable -- -- Utilities for parsing PackageDescription ...
IreneKnapp/Faction
libfaction/tests/UnitTest/Distribution/ParseUtils.hs
Haskell
bsd-3-clause
7,904
-- Helper script to shadow that automatically generated by cabal, but pointing -- to our local development directory. -- module Paths_accelerate_cuda where import Data.Version import System.Directory version :: Version version = Version {versionBranch = [0,14,0,0], versionTags = ["dev"]} getDataDir :: IO FilePath g...
kumasento/accelerate-cuda
utils/Paths_accelerate_cuda.hs
Haskell
bsd-3-clause
353
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveDataTypeable #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Compiler -- Copyright : Isaac Jones 2003-2004 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org -- Portability...
themoritz/cabal
Cabal/Distribution/Simple/Compiler.hs
Haskell
bsd-3-clause
15,692
{-# LANGUAGE Safe #-} ----------------------------------------------------------------------------- -- | -- Module : Text.ParserCombinators.Parsec.Char -- Copyright : (c) Paolo Martini 2007 -- License : BSD-style (see the LICENSE file) -- -- Maintainer : derek.a.elkins@gmail.com -- Stability : provi...
aslatter/parsec
src/Text/ParserCombinators/Parsec/Char.hs
Haskell
bsd-2-clause
870
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="bs-BA"> <title>Advanced SQLInjection Scanner</title> <maps> <homeID>sqliplugin</homeID> ...
thc202/zap-extensions
addOns/sqliplugin/src/main/javahelp/help_bs_BA/helpset_bs_BA.hs
Haskell
apache-2.0
981
{- Refactoring: move the definiton 'fringe' to module C1. This example aims to test the moving of the definition and the modification of export/import -} module D1(fringe, sumSquares) where import C1 fringe :: Tree a -> [a] fringe p |isLeaf p = [(leaf1 p)] fringe p |isBranch p = fri...
kmate/HaRe
old/testing/fromConcreteToAbstract/D1_TokOut.hs
Haskell
bsd-3-clause
481
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Monad.Fix -- Copyright : (c) Andy Gill 2001, -- (c) Oregon Graduate Institute of Science and Technology, 2002 -- License : ...
urbanslug/ghc
libraries/base/Control/Monad/Fix.hs
Haskell
bsd-3-clause
3,227
{-# LANGUAGE MagicHash #-} module ShouldFail where import GHC.Base my_undefined :: a -- This one has kind *, not OpenKind my_undefined = undefined die :: Int -> ByteArray# die _ = my_undefined
urbanslug/ghc
testsuite/tests/typecheck/should_fail/tcfail090.hs
Haskell
bsd-3-clause
198
module Main where newtype T = C { f :: String } {- hugs (Sept 2006) gives "bc" Program error: Prelude.undefined hugs trac #48 -} main = do print $ case C "abc" of C { f = v } -> v print $ case undefined of C {} -> True
olsner/ghc
testsuite/tests/codeGen/should_run/cgrun062.hs
Haskell
bsd-3-clause
270
{-| Module: Itchy.Routes Description: Web app routes License: MIT -} {-# LANGUAGE BangPatterns, LambdaCase, MultiParamTypeClasses, OverloadedLists, OverloadedStrings, QuasiQuotes, RankNTypes, TemplateHaskell, TypeFamilies, ViewPatterns #-} module Itchy.Routes ( App(..) ) where import Control.Monad import Control.M...
quyse/itchy
Itchy/Routes.hs
Haskell
mit
22,676
module Ch1010ex1 ( stops , vowels , nouns , verbs , allWords , allWordsPrefixP ) where import Combinatorial (comboOfN) import Data.Monoid stops :: [Char] stops = "pbtdkg" vowels :: [Char] vowels = "aeiou" nouns :: [String] nouns = ["bird", "dog", "cat", "car", "Elon Musk", "the ...
JoshuaGross/haskell-learning-log
Code/Haskellbook/ch10.10ex1.hs
Haskell
mit
1,214
{-# LANGUAGE RecordWildCards, TypeFamilies #-} import Control.Monad import qualified Data.Map as M import Text.Printf type FieldName = String type Point = M.Map FieldName (Maybe Double) type Label = Double class DataPass a where type Init a create :: (Init a) -> a update :: a -> [(Point, Label)] -> a apply1...
michaelochurch/stats-haskell-talk-201509
Main.hs
Haskell
mit
2,739
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeSynonymInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Test.Unit.Connection where import qualified Test.Framework as Framework import Test.Framework import Test.HUnit import Test.Framework...
banacorn/socket.io-haskell
test/Test/Unit/Connection.hs
Haskell
mit
3,318
module StupidBot.Bot (stupidBot) where import Vindinium.Types import Utils import StupidBot.Goal import qualified Data.Graph.AStar as AS import Data.Maybe (fromMaybe, fromJust) import Data.List (find) stupidBot :: Bot stupidBot = directionTo whereToGo directionTo :: GPS -> State -> Dir directionTo gps s = let fro...
flyrry/phonypony
src/StupidBot/Bot.hs
Haskell
mit
1,712
{-# LANGUAGE MonadComprehensions #-} module Main where import Data.Foldable (traverse_) import Data.Maybe (fromMaybe, listToMaybe, maybe) import System.Environment (getArgs) fizzbuzz :: (Integral a, Show a) => a -> String fizzbuzz i = fromMaybe (show i) $ [ "fizz" | i `rem` 3 == 0 ] <> [ "buz...
genos/Programming
workbench/fizzbuzzMonadComprehensions.hs
Haskell
mit
511
{-# LANGUAGE ImplicitParams #-} -- | Based on Cruise control system from -- http://www.cds.caltech.edu/~murray/amwiki/index.php/Cruise_control module CruiseControl where import Zelus data Gear = One | Two | Three | Four | Five deriving (Eq, Show) run :: Double -- ^ Initial speed, m/s -> S Double -- ^ Cruise ...
koengit/cyphy
src/CruiseControl.hs
Haskell
mit
2,996
{-# LANGUAGE OverloadedStrings #-} module Network.API.Mandrill.SubaccountsSpec where import Test.Hspec import Test.Hspec.Expectations.Contrib import Network.API.Mandrill.Types import Network.API.Mandrill.Utils import qualified Data.Text as Text import qualified Network.API.Mand...
krgn/hamdrill
test/Network/API/Mandrill/SubaccountsSpec.hs
Haskell
mit
2,692
{-# LANGUAGE ScopedTypeVariables #-} {-| Module : Labyrinth.Machine2d Description : labyrinth state machine Copyright : (c) deweyvm 2014 License : MIT Maintainer : deweyvm Stability : experimental Portability : unknown 2d state machine automata generating functions. -} module Labyrinth.Machine2d( (<...
deweyvm/labyrinth
src/Labyrinth/Machine2d.hs
Haskell
mit
1,724
module Main where import System.Environment import Text.ParserCombinators.Parsec hiding (spaces) main :: IO() main = do args <- getArgs putStrLn (readExpr (args !! 0)) symbol :: Parser Char symbol = oneOf "!$%&|*+-/:<=?>@^_~#" readExpr :: String -> String readExpr input = case parse (spaces >> symbol) "lisp" in...
brianj-za/wyas
simpleparser1.hs
Haskell
mit
440
{-| Module : Language.GoLite.Monad.Traverse Description : Traversing annotated syntax trees with class Copyright : (c) Jacob Errington and Frederic Lafrance, 2016 License : MIT Maintainer : goto@mail.jerrington.me Stability : experimental Defines a type family based approach for traversing general annota...
djeik/goto
libgoto/Language/Common/Monad/Traverse.hs
Haskell
mit
1,882
{- H-99 Problems Copyright 2015 (c) Adrian Nwankwo (Arcaed0x) Problem : 14 Description : Duplicate the elements of a list. License : MIT (See LICENSE file) -} copyTwice :: [a] -> [a] copyTwice [] = [] copyTwice (x:xs) = x : x : copyTwice xs
Arcaed0x/H-99-Solutions
src/prob14.hs
Haskell
mit
274
module Parser where import Lambda import Type import Control.Monad import Data.Char import Text.Parsec import Text.Parsec.Expr import Text.Parsec.Language import qualified Text.Parsec.Token as Token lexer = Token.makeTokenParser style where operators = ["+", "-", "*", "/", "==", ">=", "<=", "<", ">", "/=",...
LeonardoRigon/TypeInfer-LambdaExpressions-in-Haskell
Parser.hs
Haskell
mit
4,099
module Nodes.Expression where import Data.Tree (Tree (Node)) import Nodes data Expr = Op { operator :: String, left :: Expr, right :: Expr } | StrLit { str :: String } | IntLit { int :: Int } | FloatLit { float :: Double } instance AstNode Expr where ast (Op operator left right) = Node operator [ast le...
milankinen/cbhs
src/nodes/Expression.hs
Haskell
mit
507
{-# OPTIONS_GHC -fno-warn-orphans #-} import Application.Types import Handler.Admin import Handler.Block import Handler.Room import Handler.Snapshot import Handler.Socket import Handler.Instances import Import import Control.Conc...
kRITZCREEK/FROST-Backend
src/Main.hs
Haskell
mit
1,248
module HaskovSpec where import Haskov (fromList,imap,hmatrix,walk,walkFrom,steady,steadyState,statesI) import System.Random import Test.Hspec import qualified Data.Set as Set import qualified Numeric.LinearAlgebra.Data as Dat import Data.List (intercalate) import Control.Monad (unless,when) testTransition...
mazuschlag/haskov
test/HaskovSpec.hs
Haskell
mit
2,899
-- The solution of exercise 1.12 -- The following pattern of numbers is called Pascal's triangle. -- -- 1 -- 1 1 -- 1 2 1 -- 1 3 3 1 -- 1 4 6 4 1 -- -- The numbers at the edge of the triangle are...
perryleo/sicp
ch1/sicpc1e12.hs
Haskell
mit
4,245
{-# LANGUAGE DeriveGeneric, StandaloneDeriving, DeriveDataTypeable, FlexibleInstances, Rank2Types, FlexibleContexts #-} module Language.Erlang.Modules where import Language.CoreErlang.Parser as P import Language.CoreErlang.Pretty as PP import Language.CoreErlang.Syntax as S import qualified Data.Map as M import qual...
gleber/erlhask
src/Language/Erlang/Modules.hs
Haskell
apache-2.0
2,233
module Main (main) where import Language.Haskell.HLint (hlint) import System.Exit (exitFailure, exitSuccess) arguments :: [String] arguments = [ "puzzles/0-easy/onboarding/solution.hs" , "puzzles/0-easy/kirks-quest-the-descent/solution.hs" , "puzzles/0-easy/ragnarok-power-of-thor/solution.hs" , "puzzl...
lpenz/codingame-haskell-solutions
hlint.hs
Haskell
apache-2.0
568
module Helpers.GridPolytopes (countPolygons, Polygon (..)) where import Helpers.ListHelpers (cartesianProduct) import Helpers.Subsets (choose) import Data.List (genericTake, nub) import Math.NumberTheory.Powers.Squares (exactSquareRoot) import Data.Set (Set) import qualified Data.Set as Set data Polygon = Triangle | S...
peterokagey/haskellOEIS
src/Helpers/GridPolytopes.hs
Haskell
apache-2.0
3,988
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Openshift.V1.ProjectStatus where import GHC.Generics import Data.Text import qualified Data.Aeson -- | data ProjectStatus = ProjectStatus ...
minhdoboi/deprecated-openshift-haskell-api
openshift/lib/Openshift/V1/ProjectStatus.hs
Haskell
apache-2.0
521
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="ru-RU"> <title>Bug Tracker</title> <maps> <homeID>top</homeID> <mapref location="map.jh...
secdec/zap-extensions
addOns/bugtracker/src/main/javahelp/org/zaproxy/zap/extension/bugtracker/resources/help_ru_RU/helpset_ru_RU.hs
Haskell
apache-2.0
956
{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Controller ( withFoundation ) where -- standard libraries import Control.Monad import Control.Concurrent.MVar import System.Directory import System.FilePath -- friends import Foundation import Settings import Yesod.Helpers.Static -...
sseefried/funky-foto
Controller.hs
Haskell
bsd-2-clause
2,165
module Cologne.ParseNFF (parseNFF) where import Text.ParserCombinators.Parsec import qualified Text.ParserCombinators.Parsec.Token as PT import Text.ParserCombinators.Parsec.Language (emptyDef) import Data.Vect import Graphics.Formats.Assimp (Camera(Camera)) import Control.Arrow (left) import Control.Applicative hidi...
joelburget/Cologne
Cologne/ParseNFF.hs
Haskell
bsd-3-clause
5,595
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.NV.TextureExpandNormal -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : porta...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/NV/TextureExpandNormal.hs
Haskell
bsd-3-clause
688
-------------------------------------------------------------------------------- -- Chip16 Assembler written in Haskell -------------------------------------------------------------------------------- module HC.Ops where import Data.Bits import Data.Int import Data.List import Data.Maybe import Data.Word import Contr...
nandor/hcasm
HC/Ops.hs
Haskell
bsd-3-clause
4,323
module Main where import qualified Language.Modelica.Test.Lexer as Lexer import qualified Language.Modelica.Test.Expression as Expr import qualified Language.Modelica.Test.Modification as Mod import qualified Language.Modelica.Test.Basic as Basic import qualified Language.Modelica.Test.ClassDefinition as ClassDef i...
xie-dongping/modelicaparser
test/Main.hs
Haskell
bsd-3-clause
1,500
------------------------------------------------------------------------------- -- | -- Module : Control.Monad.Trans.Supply -- Copyright : (C) 2013 Merijn Verstraaten -- License : BSD-style (see the file LICENSE) -- Maintainer : Merijn Verstraaten <merijn@inconsistent.nl> -- Stability : experimental ...
merijn/transformers-supply
Control/Monad/Supply.hs
Haskell
bsd-3-clause
1,868
module Text.Velocity ( defaultVelocityState , Vstate(..) , render , pretty_ast -- * Parsing , parseVelocityM , parseVelocity , parseVelocityFile ) where import Control.Applicative hiding ((<|>), many) import Control.Arrow import Control.Monad import Control.Monad.IO.Class import Data....
edom/velocity
Text/Velocity.hs
Haskell
bsd-3-clause
7,030
{-# LANGUAGE ScopedTypeVariables, FlexibleContexts, TypeFamilies, TypeSynonymInstances, FlexibleInstances, GADTs, RankNTypes, UndecidableInstances #-} -- | The 'Enabled' module allows the construction of circuits that use -- additional control logic -- an enable signal -- that externalizes whether a -- data s...
andygill/kansas-lava
Language/KansasLava/Protocols/Enabled.hs
Haskell
bsd-3-clause
2,134
module AssetsHelper where import Assets import Utils.Utils import TypeSystem.Parser.TypeSystemParser import TypeSystem import Data.List import qualified Data.Map as M import Control.Arrow ((&&&)) import SyntaxHighlighting.Coloring stfl = parseTypeSystem Assets._Test_STFL_language (Just "Assets/STFL.language") & ...
pietervdvn/ALGT
src/AssetsHelper.hs
Haskell
bsd-3-clause
1,127
{-# LANGUAGE CPP , GADTs , Rank2Types , DataKinds , TypeFamilies , FlexibleContexts , UndecidableInstances , LambdaCase , MultiParamTypeClasses , OverloadedStrings #-} {-# OPTIONS_GHC -Wall -fwarn-tabs -fsimpl...
zaxtax/hakaru
haskell/Language/Hakaru/Runtime/LogFloatPrelude.hs
Haskell
bsd-3-clause
13,161
module ADP.Tests.RGExample where import ADP.Multi.All type RG_Algebra alphabet answer = ( EPS -> answer, -- nil answer -> answer -> answer, -- left answer -> answer -> answer -> answer, -- pair answer -> answer -> answer -> a...
adp-multi/adp-multi-monadiccp
tests/ADP/Tests/RGExample.hs
Haskell
bsd-3-clause
1,413
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE ImpredicativeTypes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE KindSignatures #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Control.P...
solorab/proof-haskell
Control/Proof/Simple.hs
Haskell
mit
5,049
----------------------------------------------------------------------------- -- | -- Module : RoverTests -- Copyright : (c) 2017 Pascal Poizat -- License : Apache-2.0 (see the file LICENSE) -- -- Maintainer : pascal.poizat@lip6.fr -- Stability : experimental -- Portability : unknown -- -- Test file...
pascalpoizat/veca-haskell
test/RoverTests.hs
Haskell
apache-2.0
11,809
{-# LANGUAGE Rank2Types #-} ----------------------------------------------------------------------------- -- | -- Module : Data.IntSet.Lens -- Copyright : (C) 2012-16 Edward Kmett -- License : BSD-style (see the file LICENSE) -- Maintainer : Edward Kmett <ekmett@gmail.com> -- Stability : provisional ...
ddssff/lens
src/Data/IntSet/Lens.hs
Haskell
bsd-3-clause
1,938
{-# LANGUAGE PatternGuards, ExistentialQuantification, CPP #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module Idris.Core.Execute (execute) where import Idris.AbsSyntax import Idris.AbsSyntaxTree import IRTS.Lang(FDesc(..), FType(..)) import Idris.Primitives(Prim(..), primitives) import Idris.Core.TT import Id...
athanclark/Idris-dev
src/Idris/Core/Execute.hs
Haskell
bsd-3-clause
29,467
{-# LANGUAGE Rank2Types #-} module Opaleye.Internal.PackMap where import qualified Opaleye.Internal.Tag as T import qualified Opaleye.Internal.HaskellDB.PrimQuery as HPQ import Control.Applicative (Applicative, pure, (<*>), liftA2) import qualified Control.Monad.Trans.State as State import Data....
alanz/haskell-opaleye
src/Opaleye/Internal/PackMap.hs
Haskell
bsd-3-clause
4,764
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} module Stack.FileWatch ( fileWatch , fileWatchPoll , printExceptionStderr ) where import Blaze.ByteString.Builder (toLazyByteString, copyByteString) import Blaze.ByteString.Builder.Char.Utf8 (fromShow) import Control.Concurrent.Async (ra...
robstewart57/stack
src/Stack/FileWatch.hs
Haskell
bsd-3-clause
5,294
import Sudoku import Control.Exception import System.Environment import Data.Maybe main :: IO () main = do [f] <- getArgs grids <- fmap lines $ readFile f print (length (filter isJust (map solve grids)))
lywaterman/parconc-examples
sudoku-par1.hs
Haskell
bsd-3-clause
217
{-# LANGUAGE ImplicitParams, TypeFamilies #-} module T3540 where thing :: (a~Int) thing = undefined thing1 :: Int -> (a~Int) thing1 = undefined thing2 :: (a~Int) -> Int thing2 = undefined thing3 :: (?dude :: Int) -> Int thing3 = undefined thing4:: (Eq a) -> Int thing4 = undefined
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/typecheck/should_fail/T3540.hs
Haskell
bsd-3-clause
288
module Main where import Data.Functor ((<$>)) import Data.Maybe (isJust, fromJust) import System.Cmd (rawSystem) import System.Exit (ExitCode(..)) import System.IO (hFlush, stdout) import System.Posix.Process (forkProcess, getProcessStatus) import Hackonad.LineParser typePrompt :: IO () typePrompt = putStr...
triplepointfive/Hackonad
src/Main.hs
Haskell
mit
1,671
module Main where import Data.Monoid import Test.Framework import qualified Test.Parser as Parser import qualified Test.Eval as Eval main :: IO () main = defaultMainWithOpts tests mempty tests = concat [ Parser.tests , Eval.tests ]
forestbelton/anima
Test/Main.hs
Haskell
mit
250
module Main where import Reddit.TheButton.Connection import Reddit.TheButton.Types import Reddit.TheButton.AnyBar import Reddit.TheButton.Utility import Control.Monad (forever) import Control.Concurrent (forkIO) import Control.Concurrent.Chan (readChan, dupChan) import System.IO (hSetBuffering, Buffe...
romac/thebutton.hs
src/Main.hs
Haskell
mit
624
-- | This file defines 'FormulaTree', the type used for modeling the calculation trees. -- -- Author: Thorsten Rangwich. See file <../LICENSE> for details. module Tree.FormulaTree ( FormulaTree(..), TreeError(..), NamedFunction(..) -- FIXME: Export creater and exporters, not type ) where import qualified Data.Pla...
tnrangwi/grill
src/Tree/FormulaTree.hs
Haskell
mit
1,303
{-# LANGUAGE Rank2Types #-} module Statistics where import Data.Foldable import Control.Monad.State import System.Random import Data.List type Rnd a = (RandomGen g) => State g a randomRM :: (Random a) => (a, a) -> Rnd a randomRM v = do g <- get (x, g') <- return $ randomR v g put g' return x choose :: [a] ...
anttisalonen/starrover2
src/Statistics.hs
Haskell
mit
2,451
{-# LANGUAGE FlexibleInstances #-} module TermSpec where import Data.Text as T import Test.QuickCheck import Faun.Term import TextGen instance Arbitrary Term where arbitrary = oneof [genVar, genConst, genFun] genTerms :: Gen [Term] genTerms = sized $ \n -> do size <- choose (0, n `mod` 6) -- Huge lists of argum...
PhDP/Sphinx-AI
tests/TermSpec.hs
Haskell
mit
701
-- | -- Module: BigE.Attribute.Vert_P_N -- Copyright: (c) 2017 Patrik Sandahl -- Licence: MIT -- Maintainer: Patrik Sandahl <patrik.sandahl@gmail.com> -- Stability: experimental -- Portability: portable -- Language: Haskell2010 module BigE.Attribute.Vert_P_N ( Vertex (..) ) where import BigE.Attribut...
psandahl/big-engine
src/BigE/Attribute/Vert_P_N.hs
Haskell
mit
2,273
{-# LANGUAGE CPP, OverloadedStrings #-} module NewAccount (newAccountSpecs) where import Data.Monoid import Yesod.Auth import Yesod.Test import Foundation import Text.XML.Cursor (attribute) import qualified Data.Text as T redirectCode :: Int #if MIN_VERSION_yesod_test(1,4,0) redirectCode = 303 #else redirectCode = 30...
jasonzoladz/yesod-auth-account-fork
tests/NewAccount.hs
Haskell
mit
7,624
module Hamming (distance) where distance :: String -> String -> Maybe Int distance xs ys = error "You need to implement this function."
exercism/xhaskell
exercises/practice/hamming/src/Hamming.hs
Haskell
mit
137
import Data.Digits lend = length . digits 10 bases = [1..9] -- lend (10^x) > 10 for all x exponents = [1..30] -- lend (9^x) > x for x>30 pairs = [(base,exponent) | base <- bases, exponent <- exponents] isValid (base,exponent) = (lend (base^exponent) == exponent) valid = filter isValid pairs answer = length valid
gumgl/project-euler
63/63.hs
Haskell
mit
319
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-} -- | The basic typeclass for a Yesod application. module Yesod.Internal.Core ( -- * Type classes Yesod (..) , Yesod...
piyush-kurur/yesod
yesod-core/Yesod/Internal/Core.hs
Haskell
mit
31,135
module MiniSequel.Adapter.PostgreSQL.Log where import qualified MiniSequel.Adapter.PostgreSQL as Adapter -- -- exec con query = do -- print query -- Adapter.exec con query -- -- takeModel con model = do -- print model -- Adapter.takeModel con model
TachoMex/MiniSequel
src/MiniSequel/Adapter/Log.hs
Haskell
mit
276