code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
{-# OPTIONS_GHC -fno-warn-orphans #-} module UnitTests.PopulationSpec (spec, Arbitrary) where import Test.Hspec import Test.QuickCheck import System.Random import Data.Random import qualified Data.MultiSet as MultiSet import Genes import Individual import Population.Internal import Phenotype import UnitTests.Genes...
satai/FrozenBeagle
Simulation/Lib/testsuite/UnitTests/PopulationSpec.hs
bsd-3-clause
5,348
0
24
2,056
1,358
675
683
98
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {- | This module contains some code to deal with HTTP 1.1 that can possibly be used in other REST projects. -} module HttpUtil ( -- * HTTP 1.1 tools. finishWithCode , err , errIfNothing , supportedMethods , routeByMethodWith405 ...
g0v/encoding-mashup-server
src/HttpUtil.hs
bsd-3-clause
7,427
0
15
1,459
1,515
805
710
118
2
{-# LANGUAGE ScopedTypeVariables #-} module Math.Probably.IterLap where import Math.Probably.Sampler import Math.Probably.FoldingStats import Math.Probably.MCMC (empiricalMean, empiricalCovariance) import Math.Probably.PDF (posdefify) import Debug.Trace import Data.Maybe weightedMeanCov :: [(Vector Double, Double...
glutamate/probably-base
Math/Probably/IterLap.hs
bsd-3-clause
1,897
0
18
488
911
479
432
46
2
{-# LANGUAGE OverloadedStrings #-} module System.Network.ZMQ.MDP.Util where import System.ZMQ as Z import Data.ByteString.Char8 (ByteString) import qualified Data.ByteString.Char8 as BS import Control.Applicative -- Receive until no more messages receiveUntilEnd :: Socket a ->...
mwotton/majordomo
lib/System/Network/ZMQ/MDP/Util.hs
bsd-3-clause
946
0
11
230
300
159
141
23
3
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ForeignFunctionInterface #-} module Tinfoil.Internal.Sodium.Foreign ( sodiumInit , aesgcmSupported ) where import Foreign.C (CInt(..)) import P import System.IO (IO) import Tinfoil.Int...
ambiata/tinfoil
src/Tinfoil/Internal/Sodium/Foreign.hs
bsd-3-clause
1,495
0
10
287
199
117
82
25
3
module Markup where import Lucid (Html, toHtml) import Lucid.Html5 homepage :: Html () homepage = withHeader $ form_ [method_ "POST", action_ "/upload", enctype_ "multipart/form-data"] $ do input_ [type_ "file", name_ "upload", accept_ "image/png"] br_ [] input_ [type_ "submit", value_ "compress"] uplo...
intolerable/crusher
src/Markup.hs
bsd-3-clause
751
0
13
165
280
132
148
26
1
-- #hide -------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.GL.PrimitiveMode -- Copyright : (c) Sven Panne 2002-2005 -- License : BSD-style (see the file libraries/OpenGL/LICENSE) -- -- Maintainer : sven.panne@aedion.de -- Stabili...
FranklinChen/hugs98-plus-Sep2006
packages/OpenGL/Graphics/Rendering/OpenGL/GL/PrimitiveMode.hs
bsd-3-clause
3,968
0
9
860
381
222
159
40
10
{-# LANGUAGE CPP #-} #if __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -- -- | -- Module : Data.ByteString.UTF8 -- Copyright : (c) Iavor S. Diatchki 2009 -- License : BSD3-style (see LICENSE) -- -- Maintainer : emertens@galois.com -- Stability : experimental -- Portability : portabl...
ghc/packages-utf8-string
Data/ByteString/UTF8.hs
bsd-3-clause
7,652
0
21
2,202
2,128
1,127
1,001
126
8
{-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2015 Dimitri Sabadie -- License : BSD3 -- -- Maintainer : Dimitri Sabadie <dimitri.sabadie@gmail.com> -- Stability : experimental -- Portability : portable -- -- Shadows can...
phaazon/quaazar
src/Quaazar/Lighting/Shadow.hs
bsd-3-clause
1,412
0
11
288
159
91
68
16
0
{-# LANGUAGE CPP, BangPatterns, FlexibleContexts, FlexibleInstances #-} #ifdef GENERICS {-# LANGUAGE DefaultSignatures , TypeOperators , BangPatterns , KindSignatures , ScopedTypeVariables #-} #endif ------------------------------------------------------------------------...
meiersi/blaze-binary
src/Data/Blaze/Binary.hs
bsd-3-clause
18,060
8
16
4,549
4,777
2,605
2,172
254
2
----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.SetupWrapper -- Copyright : (c) The University of Glasgow 2006, -- Duncan Coutts 2008 -- -- Maintainer : cabal-devel@haskell.org -- Stability : alpha -- Portability : port...
IreneKnapp/Faction
faction/Distribution/Client/SetupWrapper.hs
bsd-3-clause
14,150
0
17
3,661
2,869
1,515
1,354
258
20
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[Demand]{@Demand@: A decoupled implementation of a demand domain} -} {-# LANGUAGE CPP, FlexibleInstances, TypeSynonymInstances, RecordWildCards #-} {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} module Demand ( ...
sdiehl/ghc
compiler/basicTypes/Demand.hs
bsd-3-clause
79,177
6
19
21,681
13,981
7,323
6,658
922
9
module Karamaan.Plankton.Arrow.Lens where import Prelude hiding (id) import Control.Arrow (Arrow, arr, (<<<), second) import Control.Category (id) import qualified Lens.Family as L viewA :: Arrow arr => L.FoldLike a s t a b -> arr s a viewA = arr . L.view overA :: Arrow p => L.LensLike (Context a b) s t a b -> p a b...
karamaan/karamaan-plankton
Karamaan/Plankton/Arrow/Lens.hs
bsd-3-clause
1,111
0
10
257
375
200
175
19
1
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Install -- Copyright : Isaac Jones 2003-2004 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This is the entry point into installing a built package. Performs the -- ...
fpco/cabal
Cabal/Distribution/Simple/Install.hs
bsd-3-clause
10,283
0
17
2,344
1,763
922
841
137
8
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE CPP #-} -- ghc options {-# OPTIONS_GHC -Wall #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- {-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# OPTIONS_GHC -fno-warn-orph...
reuleaux/pire
src/Pire/Pretty/Token.hs
bsd-3-clause
5,905
0
10
1,434
1,978
998
980
84
0
module Algebra.PartialOrd ( -- * Partial orderings PartialOrd(..), partialOrdEq, -- * Fixed points of chains in partial orders lfpFrom, unsafeLfpFrom, gfpFrom, unsafeGfpFrom ) where import Algebra.Enumerable import qualified Data.Set as S import qualified Data.IntSet as IS import qualif...
batterseapower/lattices
Algebra/PartialOrd.hs
bsd-3-clause
3,482
0
11
824
1,015
551
464
52
1
{-# LANGUAGE BangPatterns, CPP, GeneralizedNewtypeDeriving, MagicHash, Rank2Types, UnboxedTuples #-} #ifdef GENERICS {-# LANGUAGE DeriveGeneric, ScopedTypeVariables #-} #endif -- | QuickCheck tests for the 'Data.Hashable' module. We test -- functions by comparing the C and Haskell implementations. module Propert...
pacak/cuddly-bassoon
hashable-1.2.6.0/tests/Properties.hs
bsd-3-clause
9,105
0
18
2,017
2,593
1,411
1,182
106
3
{-# OPTIONS_GHC -Wall -fno-warn-orphans #-} module Language.Haskell.Exts.Desugar.Pattern where import qualified Prelude import Language.Haskell.Exts hiding (name) import Language.Haskell.Exts.Unique import Language.Haskell.Exts.Desugar import Language.Haskell.Exts.Desugar.Basic () import Prelude (($),(++),return,lengt...
shayan-najd/Haskell-Desugar
Language/Haskell/Exts/Desugar/Pattern.hs
bsd-3-clause
3,786
0
12
1,157
1,246
649
597
84
1
module Text.Tagset.TagParser ( tagParser , parseTag ) where import Text.Parsec import Text.Parsec.Text import qualified Data.Map as Map import Data.Maybe (catMaybes) import qualified Data.Text as T import qualified Data.Text.IO as T import Text.Tagset.Data import Text.Tagset.DefParser (parseTagset) (<<) :: Monad m =...
kawu/tagger
src/Text/Tagset/TagParser.hs
bsd-3-clause
1,686
0
17
473
618
312
306
50
2
{-# LANGUAGE TypeFamilies #-} module EFA.Flow.Sequence.Symbolic ( module EFA.Flow.Sequence.Symbolic, (.=), (%=), (=%%=), Verify.Ignore, ) where import qualified EFA.Flow.SequenceState.Symbolic as SymVar import EFA.Flow.SequenceState.Symbolic (VarTerm, Symbol, varSymbol) import EFA.Utility (Pointed) import...
energyflowanalysis/efa-2.1
src/EFA/Flow/Sequence/Symbolic.hs
bsd-3-clause
2,230
0
10
408
708
409
299
54
1
module TypeCheck where import Text.Parsec import Control.Monad import AST() import CheckedAST import Environment typeCheck :: CheckedProgram -> Either String () typeCheck = mapM_ eDeclTypeCheck getRetFuncType :: (Kind, ChType, Level) -> Maybe ChType getRetFuncType (_, t, _) = case t of (ChFunc ct _) -> Just ...
tanishiking/hscc
src/TypeCheck.hs
mit
8,045
0
23
2,359
2,563
1,284
1,279
151
7
{- DATX02-17-26, automated assessment of imperative programs. - Copyright, 2017, see AUTHORS.md. - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at...
DATX02-17-26/DATX02-17-26
libsrc/Class/Product/PTravIx.hs
gpl-2.0
3,312
0
11
687
851
501
350
47
1
{-# LANGUAGE GADTs #-} module DeepGADT where import Prelude hiding ((+),(-)) import qualified Prelude as Prelude import qualified Data.Vector.Unboxed as V import Types import qualified ShallowVector as Shallow -- evaluation with the host language data Exp a where Img :: VectorImage -> Exp VectorImage ...
robstewart57/small-image-processing-dsl-implementations
haskell/small-image-processing-dsl/src/DeepGADT.hs
bsd-3-clause
2,009
0
12
476
713
370
343
42
1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Dependency.Types -- Copyright : (c) Duncan Coutts 2008 -- License : BSD-like -- -- Maintainer : cabal-devel@haskell.org -- Stability : provisional -- Portability : ...
seereason/cabal
cabal-install/Distribution/Client/Dependency/TopDown.hs
bsd-3-clause
45,782
0
21
11,688
9,006
4,691
4,315
699
13
{- Copyright (C) 2009-2011 John Goerzen <jgoerzen@complete.org> All rights reserved. For license and copyright information, see the file LICENSE -} {- | Module : Data.Convertible.Instances Copyright : Copyright (C) 2009-2011 John Goerzen License : BSD3 Maintainer : John Goerzen <jgoerzen@comple...
hdbc/convertible
Data/Convertible/Instances.hs
bsd-3-clause
988
0
4
160
62
44
18
6
0
--Factorial implementation using Tail recursion fact :: Int -> Int fact n = facTail n 1 facTail :: (Int) -> (Int) -> (Int) facTail 0 r = r facTail n r = facTail (n-1) (n*r) --Fibonnaci implementation using Tail Recursion fib :: Int -> Int fib n | n == 0 =0 | n < 0 =0 | otherwise = fibTail n 1 0 fibTail :: Int ->...
caiorss/Functional-Programming
codes/TailRecursion.hs
unlicense
669
5
8
162
332
165
167
23
1
{-# LANGUAGE Trustworthy #-} ----------------------------------------------------------------------------- -- | -- Module : System.Mem.Weak -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org -- Stabilit...
alexander-at-github/eta
libraries/base/System/Mem/Weak.hs
bsd-3-clause
5,244
0
11
1,088
284
181
103
18
1
<?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="ur-PK"> <title>Token Generator | ZAP Extension</title> <maps> <homeID>top</homeID> <map...
thc202/zap-extensions
addOns/tokengen/src/main/javahelp/org/zaproxy/zap/extension/tokengen/resources/help_ur_PK/helpset_ur_PK.hs
apache-2.0
976
78
66
159
413
209
204
-1
-1
{-# LANGUAGE BangPatterns, MagicHash, UnboxedTuples, FlexibleContexts #-} -- | Efficient serialisation for GHCi Instruction arrays -- -- Author: Ben Gamari -- module GHCi.BinaryArray(putArray, getArray) where import Prelude import Foreign.Ptr import Data.Binary import Data.Binary.Put (putBuilder) import qualified Data...
sdiehl/ghc
libraries/ghci/GHCi/BinaryArray.hs
bsd-3-clause
3,093
0
14
743
921
474
447
58
2
{-# LANGUAGE ScopedTypeVariables #-} {-@ LIQUID "--no-termination" @-} module LinSpace (dotPV, sameSpace, enumCVP) where import Language.Haskell.Liquid.Prelude (liquidAssume, liquidAssert, liquidError) import Prelude hiding (zipWith) data PVector = PVector { vec :: [Integer] -- vector coordinates ...
mightymoose/liquidhaskell
tests/todo/linspace.hs
bsd-3-clause
7,877
0
15
1,961
2,177
1,149
1,028
89
4
{-# LANGUAGE QuasiQuotes, TypeFamilies, TemplateHaskell, MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} module YesodCoreTest.JsLoader (specs, Widget) where import YesodCoreTest.JsLoaderSites.Bottom (B(..)) import Test.Hspec import Yesod.Core import Network.Wai.Test d...
ygale/yesod
yesod-core/test/YesodCoreTest/JsLoader.hs
mit
1,085
0
12
168
240
121
119
24
1
{-# LANGUAGE UnboxedSums #-} module Main where import Lib import Prelude (print, IO) main :: IO () main = do print (getInt (flip (# 123 | #)))
ezyang/ghc
testsuite/tests/unboxedsums/module/Main.hs
bsd-3-clause
151
0
12
35
55
31
24
7
1
{-# LANGUAGE MultiParamTypeClasses #-} -- Test Trac #3265 module T3265 where data a :+: b = Left a | Right b class a :*: b where {}
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/rename/should_fail/T3265.hs
bsd-3-clause
136
0
6
31
36
22
14
-1
-1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE TypeFamilies #-} module Futhark.Internalise.Monad ( InternaliseM, runInternaliseM, throwError, VarSubsts, ...
diku-dk/futhark
src/Futhark/Internalise/Monad.hs
isc
5,644
0
19
1,226
1,486
788
698
152
2
module Properties (properties) where import Test.Tasty.QuickCheck (testProperty) import Data.Serialize (encode, decode) import Test.Tasty (TestTree, testGroup) import Yeast.Feed import Yeast.Parse import Yeast.Render ---...
stevana/yeast
tests/Properties.hs
isc
966
0
10
222
192
108
84
20
1
{-# LANGUAGE OverloadedStrings #-} module Templates where import Prelude hiding (head) import Text.Blaze import Text.Blaze.Html5 import qualified Text.Blaze.Html5.Attributes as A import qualified Settings as Settings mainMenu :: Bool -> Html mainMenu authorized = p $ do a ! A.href "/" $ "Bookmarks" _ <- " " i...
fredmorcos/attic
projects/intramarks/markr_happstack/Templates.hs
isc
691
0
14
184
230
116
114
26
2
{-# LANGUAGE NoImplicitPrelude #-} module Handler.Download ( getDownloadR , getDownloadSnapshotsJsonR , getDownloadLtsSnapshotsJsonR , getGhcMajorVersionR , getDownloadGhcLinksR ) where import RIO (textDisplay) import Import import Data.GhcLinks import Yesod.GitRepo (grContent) import Stackage.Database ge...
fpco/stackage-server
src/Handler/Download.hs
mit
1,762
0
13
295
356
179
177
37
2
module Jumper where -------------------- -- Global Imports -- import FRP.Spice ---------- -- Code -- -- The Jumper datatype data Jumper = Jumper { pos :: Vector Float , dir :: Vector Float , size :: Vector Float , groundLevel :: Fl...
crockeo/spice-test
src/jumper/Jumper.hs
mit
347
0
9
152
56
35
21
6
0
{-# LANGUAGE OverloadedStrings #-} module Control.OperationalTransformation.Text0.Gen (genOperation, genMultiOperation) where import Control.OperationalTransformation import Control.OperationalTransformation.Text0 import qualified Data.Text as T import Test.QuickCheck hiding (Result) instance Arbitrary T.Text where ...
thomasjm/ot.hs
test/Control/OperationalTransformation/Text0/Gen.hs
mit
1,376
0
19
244
499
261
238
28
1
import ImageLoader import Brain -------------------------------------------------------------------------------- import Control.Exception (SomeException (..)) import System.Random (mkStdGen, randomR) import Numeric.LinearAlgebra import Data.List import qualified Numeric.LinearAlgebra.Data as V import Debug.Trace ...
robmcl4/A-Neural
src/Main.hs
mit
2,038
0
13
592
705
370
335
47
3
module Users ( User (..) , UserMetaData (..) , toResource , getUsers , getUser ) where import Data.Aeson.TH import Data.Maybe (fromJust) import Data.Monoid ((<>)) import Data.Text (pack) import Network.URL import Network.JSONApi ( Links , Meta , MetaObject (..) , ResourcefulEntity (..) , mkMeta ...
toddmohney/json-api
example/src/Users.hs
mit
1,533
0
10
305
472
265
207
-1
-1
{- - By Yue Wang 13.12.2014 - proj03 linear search. - @note this is a non monad version, return the size of the list when nothing found - -} linearSearch :: (Eq a)=> [a] -> a -> Int linearSearch [] val = error "empty list" linearSearch [x]val = if x == val then 0 else 1 linearSearch (x:xs) val = if ...
Mooophy/DMA
ch02/proj03.hs
mit
372
0
7
99
105
56
49
4
3
-- | -- Module: Args -- Copyright: Copyright (c) 2009-2014, Sebastian Schwarz <seschwar@gmail.com> -- License: MIT -- Maintainer: Sebastian Schwarz <seschwar@gmail.com> -- {-# LANGUAGE OverloadedStrings #-} module Args ( Config(..) , parseArgs ) where import Control.Applicative (Applicative(..), ...
seschwar/mailkwds
src/Args.hs
mit
6,356
0
19
1,812
2,140
1,159
981
-1
-1
module Distill.Expr.Tests ( tests , WellTypedExpr(..) , arbitraryExpr , arbitraryType , arbitraryDecls ) where import System.IO import Test.HUnit import Test.QuickCheck (Arbitrary(..)) import Test.QuickCheck.Gen import Test.QuickCheck.Property import Text.Parsec import Distill.Expr.Representat...
DNoved1/distill
test/Distill/Expr/Tests.hs
mit
6,959
0
22
2,202
2,251
1,141
1,110
152
3
module Data.Maybe.Extra ( module Data.Maybe , rightToMaybe ) where import Data.Maybe rightToMaybe :: Either t a -> Maybe a rightToMaybe (Right x) = Just x rightToMaybe (Left _) = Nothing
expipiplus1/spir-v
generate/src/Data/Maybe/Extra.hs
mit
195
0
7
38
71
38
33
7
1
-- Intermission: Exercises -- Note the following exercises are from source code files, not written for use -- directly in the REPL. Of course, you can change them to test directly in the -- REPL if you prefer. -- 1. Which (two or more) of the following are equivalent? -- a) mTh x y z = x * y * z -- b) mTh x y = \z ->...
diminishedprime/.org
reading-list/haskell_programming_from_first_principles/07_03.hs
mit
1,308
0
9
341
123
76
47
6
2
module ConnectFour.BoardSpec where import Test.Hspec import ConnectFour.Board main :: IO () main = hspec spec spec :: Spec spec = do describe "Board" $ do context "when dropping coins on board" $ do it "should be able to drop a coin in an empty column" $ do dropCoin [[],[],...
tcoenraad/connect-four
test/ConnectFour/BoardSpec.hs
mit
5,721
0
19
1,299
2,384
1,357
1,027
80
1
import Test.Hspec import Data.Either (isLeft) import qualified Language.Python.Parser.Lexer as P main :: IO () main = hspec $ do describe "Language.Python.Parser.Lexer.lex" $ do it "parses Python numeric literals" $ do "0" `lexesTo` [P.Number (P.IntLiteral 0)] "00000" `lexesTo` [P.Number (P.IntLi...
Garciat/Hucc
test/Spec.hs
mit
1,072
0
19
271
392
202
190
23
1
import Control.Monad (guard) import Data.Char import Data.Bits data Literal = Literal Bool Int Int Int deriving Show type Clause = [Literal] readValue v | v `elem` ['1'..'9'] = (ord v) - (ord '1') + 1 | v `elem` ['A'..'Z'] = (ord v) - (ord 'A') + 1 | otherwise = error ("WTF? Cell value out of range: '" ++ (sho...
damelang/sdk2cnf
sdk2cnf-2.hs
mit
2,740
0
17
837
1,730
904
826
60
2
-- Lightweight and reusable Haskeline alternative module Flowskell.InputLine ( InputLine, newInputLine, showInputLine, getInput, input, backspace, pos1, end, del, left, right ) where import System.IO import Control.Monad.State import Data.Char type InputLine = (String -- String before cursor...
lordi/flowskell
src/Flowskell/InputLine.hs
gpl-2.0
2,070
0
17
553
701
377
324
59
8
#!/usr/bin/env runhaskell -- | Computing GC Content -- Usage: GC <dataset.txt> import System.Environment(getArgs) import qualified Data.ByteString.Char8 as C import Data.Ord(comparing) import Data.List(sortBy) parseFastaMultiline :: C.ByteString -> [(C.ByteString, C.ByteString)] parseFastaMultiline f = zip (map (C.t...
kerkomen/rosalind-haskell
stronghold/GC.hs
gpl-2.0
977
0
16
182
455
243
212
20
2
-- file: ch4/exA2.hs -- A function that acts similarly to `words`, but takes a predicate and a -- list of any type, and splits its input list on every element for which -- the predicate returns `False`. splitWith :: (a -> Bool) -> [a] -> [[a]] splitWith _ [] = [] splitWith p xs = pre : (splitWith p $ suf' suf) where...
friedbrice/RealWorldHaskell
ch4/exA2.hs
gpl-2.0
396
0
9
95
124
66
58
6
2
module Ocram.Main (main) where -- imports {{{1 import Ocram.Analysis (analysis, Analysis(anaCritical, anaBlocking, anaCallgraph), footprint) import Ocram.Backend (tcode_2_ecode) import Ocram.Debug (create_debug_info) import Ocram.Intermediate (ast_2_ir) import Ocram.Options (options) import Ocram.IO (parse, generate_p...
copton/ocram
ocram/src/Ocram/Main.hs
gpl-2.0
2,030
0
12
417
658
340
318
42
2
{-# LANGUAGE FlexibleInstances #-} module Algebraic.Nested.Op where import Algebraic.Nested.Type import Expression.Op import Autolib.ToDoc import qualified Autolib.Set as S import qualified Autolib.TES.Binu as B instance Ops ( Type Integer ) where bops = B.Binu { B.nullary = map zahl [ 0 .. 9 ] , B.unary...
Erdwolf/autotool-bonn
src/Algebraic/Nested/Op.hs
gpl-2.0
1,602
66
8
465
626
353
273
38
1
module Language.Lambda.Types where -- Primitive types (String, Int, Bool), and composite (union) types. data Type = StringType | IntType | BoolType | TupleType [Type] | FunctionType { _from :: Type , _to :: Type }
justinmanley/lambda
src/Language/Lambda/Types.hs
gpl-3.0
262
0
8
83
46
30
16
9
0
-- | Playing with fix points. module PwFix where import Data.Function (fix) -- | Factorial function, open recursion style. -- -- The last parenthesis are not needed. They are put there just for the sake of -- clarity. faco :: (Int -> Int) -> (Int -> Int) faco _ 1 = 1 faco r n = n * r (n - 1) -- How do we ...
capitanbatata/sandbox
pw-fix/src/PwFix.hs
gpl-3.0
996
0
8
246
182
110
72
12
1
module Common ( test_selectBestCells_group, test_culturalComputation_group ) where import FRP.FrABS import SugarScape.Model import SugarScape.Common import Test.Tasty import Test.Tasty.HUnit import Test.Tasty.QuickCheck as QC -------------------------------------------------------------------------------...
thalerjonathan/phd
coding/libraries/chimera/examples/ABS/SugarScape/Tests/Common.hs
gpl-3.0
6,522
0
16
1,407
1,392
762
630
94
1
module SCSI.Command.Inquiry ( Inquiry(..), DeviceType(..), inquiry ) where import Control.Applicative ((<$>), (<*>)) import Control.Monad import qualified Data.ByteString as BS import Data.Word import Parser import SCSI data Inquiry = Inquiry { deviceType :: DeviceType, vendor :: String, ...
ruudkoot/odin
src/SCSI/Command/Inquiry.hs
gpl-3.0
1,967
0
12
724
417
247
170
64
1
module Model.Kind ( Kinded(..) ) where import Data.String (IsString) -- | Types with a self-describing short name for their type class Kinded a where kindOf :: IsString s => a -> s
databrary/databrary
src/Model/Kind.hs
agpl-3.0
189
0
8
40
51
29
22
5
0
{-# LANGUAGE LambdaCase #-} module Data.GI.CodeGen.Callable ( genCCallableWrapper , genDynamicCallableWrapper , ForeignSymbol(..) , ExposeClosures(..) , hOutType , skipRetVal , arrayLengths , arrayLengthsMap , callableSignature , Signature(..) , fixupCallerAllocates , c...
ford-prefect/haskell-gi
lib/Data/GI/CodeGen/Callable.hs
lgpl-2.1
41,591
331
27
14,094
8,822
4,616
4,206
719
9
-- file "Ch04/InteractWith.hs" import System.Environment (getArgs) import Data.Char (toUpper, isUpper) import Data.List --(isPrefixOf, isSuffixOf, null, length, head, tail) --NOTE ghc --make InteractWith.hs produce the excutable file. --NOTE this is function as the first class. interactWith function inputFile outputFi...
Numberartificial/Realworld-Haskell
code/Ch04/InteractWith.hs
apache-2.0
4,366
0
13
1,245
1,397
723
674
95
4
{-# OPTIONS -fno-warn-type-defaults #-} {-| Constants contains the Haskell constants The constants in this module are used in Haskell and are also converted to Python. Do not write any definitions in this file other than constants. Do not even write helper functions. The definitions in this module are automatically...
leshchevds/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
146,887
0
13
28,629
24,889
14,752
10,137
-1
-1
module ConvexHull ( convexHull ) where import Data.List (sort) import GHC.Int (Int32) -- Coordinate type type R = Int32 -- Vector / point type type R2 = (R, R) -- Checks if it's shortest to rotate from the OA to the OB vector in a clockwise -- direction. clockwise :: R2 -> R2 -> R2 -> Bool clockwise o...
Chuck-Aguilar/haskell-opencv-work
src/ConvexHull.hs
bsd-3-clause
1,618
2
11
423
476
271
205
29
4
{-| Module : Network.Kademlia.Implementation Description : The details of the lookup algorithm "Network.Kademlia.Implementation" contains the actual implementations of the different Kademlia Network Algorithms. -} module Network.Kademlia.Implementation ( lookup , store , joinNetwork , JoinResult(...
froozen/kademlia
src/Network/Kademlia/Implementation.hs
bsd-3-clause
12,928
0
21
4,381
2,870
1,461
1,409
187
4
module Main where import Prelude hiding ( null ) import Data.List ( intercalate ) import Youtan.Lexical.Tokenizer import Youtan.Syntax.Parser import qualified Data.Map as Map data JS = JSNull | JSBool !Bool | JSRational !Double | JSString !String | JSArray ![ JS ] | JSObject !( Map.Map String JS ) de...
triplepointfive/Youtan
app/Main.hs
bsd-3-clause
2,927
0
16
713
1,095
584
511
104
2
module Main where import System.IO(hFlush, stdout) import System.Environment(getArgs) import System.Exit(exitFailure) import Control.Applicative((<$>)) import Control.Arrow((&&&)) import Control.Monad.Tools(doWhile, doWhile_) import LojysambanLib(ask, readRules, end) main :: IO () main = do args <- getArgs rules <-...
YoshikuniJujo/lojysamban
src/lojysamban.hs
bsd-3-clause
629
0
18
107
259
140
119
-1
-1
{-# LANGUAGE CPP , GADTs , KindSignatures , DataKinds , PolyKinds , TypeFamilies , FlexibleContexts , FlexibleInstances , TypeSynonymInstances , StandaloneDeriving #-} {-# OPTIONS_GHC -Wall -fwarn-tabs #-} ---...
zaxtax/hakaru
haskell/Language/Hakaru/Types/HClasses.hs
bsd-3-clause
21,509
0
10
4,552
4,359
2,322
2,037
369
1
{-# LANGUAGE TypeOperators, GADTs #-} -- | Simple support for new behavior primitives in Sirea, requires -- the processing be isolated to one signal. -- -- These shouldn't be necessary often, since it will only take a few -- common abstractions to support most new ideas and resources. But -- unsafeLinkB ensures that ...
dmbarbour/Sirea
src/Sirea/UnsafeLink.hs
bsd-3-clause
3,905
0
12
836
1,283
665
618
52
2
module Numeric.BMML where
DbIHbKA/BMML
src/Numeric/BMML.hs
bsd-3-clause
29
0
3
6
6
4
2
1
0
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TemplateHaskell ...
supermario/stack
src/Stack/Package.hs
bsd-3-clause
43,869
0
23
13,668
10,699
5,533
5,166
889
13
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS -Wno-orphans #-} module Hasmin.TestUtils ( module Hasmin.TestUtils , module Test.QuickCheck , module Test.Hspec , module Test.Hspec.Attoparsec ) where import Test.Hspec import Test.QuickCheck hiding (NonZero) import Test.QuickCheck.Instances() import ...
contivero/hasmin
tests/Hasmin/TestUtils.hs
bsd-3-clause
6,597
0
11
1,579
1,624
882
742
147
1
module Problem19 where getDayOfWeek :: Int -> Int -> Int -> Int getDayOfWeek 1900 1 1 = 1 getDayOfWeek year 1 1 = (base + (foldl1 (+) $ map daysOfYear [1900..(year-1)])) `mod` 7 where base = getDayOfWeek 1900 1 1 getDayOfWeek year 1 day = (day - 1 + (getDayOfWeek year 1 1)) `mod` 7 getDayOfWeek year month day = ((ge...
noraesae/euler
src/Problem19.hs
bsd-3-clause
1,361
0
13
303
630
330
300
41
2
module Data.List.TypeLevel.Witness.OrdList where import Prelude hiding (head, tail) import Data.Constraint import Data.List.TypeLevel.Cmp import Data.List.TypeLevel.Union (Union) import qualified Data.List.TypeLevel.Union as Union import Data.L...
andrewthad/vinyl-vectors
src/Data/List/TypeLevel/Witness/OrdList.hs
bsd-3-clause
6,586
0
23
1,417
2,199
1,097
1,102
-1
-1
{-# LANGUAGE DeriveDataTypeable, BangPatterns, ScopedTypeVariables #-} {-# LANGUAGE ExistentialQuantification #-} {-# OPTIONS_GHC -Wall -fno-warn-orphans #-} module Development.Cake.Core where import Development.Cake.Core.Types import Development.Cake.Options import Control.Applicative import Control.Concurrent.MVar ...
nominolo/cake
src/Development/Cake/Core.hs
bsd-3-clause
31,419
10
55
8,407
7,405
3,790
3,615
534
16
{-# LANGUAGE BangPatterns, RecordWildCards, FlexibleContexts, TemplateHaskell, RankNTypes, KindSignatures #-} module RollingVector where import qualified Data.Vector.Generic as G import Data.Word import Data.Bits import Control.Monad.ST import Control.Monad.State.Strict import Control.Lens import Control.Monad.Morph (...
aristidb/datastorage
src/RollingVector.hs
bsd-3-clause
6,254
0
16
1,765
2,762
1,396
1,366
130
3
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleContexts #-} module Y2017.Day14 (answer1, answer2) where import Control.Monad import GHC.Word import Numeric import Data.Bits import Data.Foldable import Data.Array ((!)) import qualified Data.Array as A import qualified Data.Vector as V import qualified Y2017.Day10 ...
geekingfrog/advent-of-code
src/Y2017/Day14.hs
bsd-3-clause
2,774
0
18
755
1,317
728
589
69
2
{-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TupleSections ...
athanclark/stack
src/Stack/Build.hs
bsd-3-clause
6,322
0
15
1,793
1,171
634
537
129
3
{-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies, OverloadedStrings #-} module Cataskell.Server.Main where import Control.Applicative import Control.Lens import Cataskell.Server.App (server, ServerState (..), startingState) import qualified Snap.Core as Snap import qualified Snap.Snaplet as Snap import qualifi...
corajr/cataskell
src/Cataskell/Server/Main.hs
bsd-3-clause
1,737
0
10
267
516
283
233
48
1
module Control.Lens.TH.SharedFields ( generateField , generateFields ) where import Data.Char import Language.Haskell.TH -- | Generate classes for a field that will be shared between modules -- without using 'makeFields' (which would create an extra -- instance at minimum) generateField :: String -> Q [De...
intolerable/shared-fields
src/Control/Lens/TH/SharedFields.hs
bsd-3-clause
1,161
0
12
294
374
201
173
-1
-1
module Main where import Network.Simple.TCP import Network.Socket (isWritable, isReadable) import Control.Concurrent import qualified Data.ByteString.Lazy as BS import qualified Data.ByteString.Lazy as BS (null, append) import Data.ByteString.Lazy (empty, fromStrict) import Mqtt.Broker (unsubscribe, serviceRequest, Re...
atilaneves/mqtt_hs
src/main.hs
bsd-3-clause
2,224
0
18
462
677
344
333
57
4
{-# LINE 1 "GHC.Conc.Windows.hs" #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, UnboxedTuples #-} {-# OPTIONS_GHC -Wno-missing-signatures #-} {-# OPTIONS_HADDOCK not-home #-} --------------------------------------------------------------------...
phischu/fragnix
builtins/base/GHC.Conc.Windows.hs
bsd-3-clause
10,820
0
21
2,385
2,737
1,410
1,327
217
6
{-# LANGUAGE MultiParamTypeClasses #-} module Beetle.Datasets.Streaming where import qualified Streaming.Prelude as S import Streaming.Prelude (Stream, Of) import qualified Data.ByteString.Streaming as SBS import Streaming.Cassava import Numeric.Datasets import Control.Monad.IO.Class import Data.Maybe import System.I...
filopodia/open
beetle/src/Beetle/Datasets/Streaming.hs
mit
1,361
0
14
218
515
261
254
28
1
-- This module contains settings used by multiple benchmarking functions. -- See my blog for more discussion on this. module BenchParam where sigSize :: Int sigSize = 8192 shiftSize :: Int shiftSize = 1
oqc/hqt
QuranBench/BenchParam.hs
gpl-3.0
205
0
4
36
26
17
9
5
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DescribeCustomerGateways.hs
mpl-2.0
6,976
0
15
1,436
802
488
314
93
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-cloudhsm/gen/Network/AWS/CloudHSM/ListHsms.hs
mpl-2.0
3,955
0
12
886
540
327
213
61
1
{- - Copyright (c) 2017 The Agile Monkeys S.L. <hackers@theam.io> - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless requir...
J2RGEZ/haskell-do
src/common/HaskellDo.hs
apache-2.0
1,298
0
7
263
147
88
59
19
1
module Solution where import Primes import Data.List isPrimitiveRootModulo :: Integer -> Integer -> Bool isPrimitiveRootModulo base p = [1..p-1] == sort modules where modules = map (\power -> (base^power) `mod` p) [0..p-2] findLongestCyclicNumberBefore :: Int -> Integer findLongestCyclicNumberBefore maxNum = l...
nothiphop/project-euler
026/Solution.hs
apache-2.0
514
0
12
78
149
83
66
9
1
{-# LANGUAGE ScopedTypeVariables #-} module AnnRun01 where import GHC import MonadUtils ( liftIO ) import DynFlags ( defaultFatalMessager, defaultFlushOut ) import Annotations ( AnnTarget(..), CoreAnnTarget ) import GHC.Serialized ( deserializeWithData ) import Panic import Config import Annrun01_Help import q...
rahulmutt/ghcvm
tests/suite/annotations/run/annrun01/AnnRun01.hs
bsd-3-clause
1,742
0
14
332
466
230
236
41
1
-- | -- Module : Foundation.Class.Bifunctor -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : portable -- -- Formally, the class 'Bifunctor' represents a bifunctor -- from @Hask@ -> @Hask@. -- -- Intuitively it is a bifunctor where both t...
vincenthz/hs-foundation
foundation/Foundation/Class/Bifunctor.hs
bsd-3-clause
614
0
5
105
39
32
7
4
0
{-# OPTIONS_GHC -Wall #-} module Elm.Compiler ( version , parseDependencies , compile, Context(..), Result(..) , Dealiaser, dummyDealiaser , Error, errorToString, errorToJson, printError , Warning, warningToString, warningToJson, printWarning ) where import qualified Data.Aeson as Json impo...
Axure/elm-compiler
src/Elm/Compiler.hs
bsd-3-clause
4,524
0
16
948
1,245
681
564
112
2
{- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[RnPat]{Renaming of patterns} Basically dependency analysis. Handles @Match@, @GRHSs@, @HsExpr@, and @Qualifier@ datatypes. In general, all of these functions return a renamed thing, and a set of free variables. -} {-# LANGUAGE CPP, RankNTypes, S...
vikraman/ghc
compiler/rename/RnPat.hs
bsd-3-clause
34,213
29
23
11,342
6,616
3,567
3,049
-1
-1
-- | POSIX time, if you need to deal with timestamps and the like. -- Most people won't need this module. module Data.Time.Clock.POSIX ( posixDayLength,POSIXTime,posixSecondsToUTCTime,utcTimeToPOSIXSeconds,getPOSIXTime ) where import Data.Time.Clock.UTC import Data.Time.Calendar.Days import Data.Fixed import Control....
DavidAlphaFox/ghc
libraries/time/lib/Data/Time/Clock/POSIX.hs
bsd-3-clause
1,961
4
12
278
293
169
124
24
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE DeriveDataTypeab...
akhileshs/stack
src/Stack/Setup.hs
bsd-3-clause
51,674
0
31
17,441
11,858
5,923
5,935
1,015
15
{----------------------------------------------------------------------------------------- Layout demo. -----------------------------------------------------------------------------------------} module Main where import Graphics.UI.WX main :: IO () main = start gui gui :: IO () gui = do f <- frame [text :=...
ekmett/wxHaskell
samples/wx/Layout.hs
lgpl-2.1
1,156
0
18
400
325
161
164
20
1
module A (T(..)) where data T = T
forste/haReFork
tools/base/Modules/tests/4/A.hs
bsd-3-clause
36
0
5
10
20
13
7
2
0
{-# LANGUAGE TypeFamilies, PolyKinds, DataKinds, TypeOperators #-} module T7939 where import Data.Kind (Type) class Foo a where type Bar a b type family F a type instance F Int = Bool type family G a where G Int = Bool type family H a where H False = True type family J a where J '[] = False J (h ': t) =...
sdiehl/ghc
testsuite/tests/ghci/scripts/T7939.hs
bsd-3-clause
475
0
8
128
193
113
80
20
0
{-# LANGUAGE ForeignFunctionInterface #-} -- $ ghc -O2 --make wrappers.hs functions.c import Numeric.LinearAlgebra import Data.Packed.Development import Foreign(Ptr,unsafePerformIO) import Foreign.C.Types(CInt) ----------------------------------------------------- main = do print $ myDiag $ (3><5) [1..] ------...
mightymoose/liquidhaskell
benchmarks/hmatrix-0.15.0.1/examples/devel/ej2/wrappers.hs
bsd-3-clause
952
0
15
270
261
137
124
21
2
module Foo where import Data.Binary () import Data.ByteString ()
mathhun/stack
test/integration/tests/345-override-bytestring/files/Foo.hs
bsd-3-clause
66
0
4
10
20
13
7
3
0
import qualified Data.Text as Text import qualified Data.Text.IO as Text import qualified Data.Set as Set import qualified Data.Map.Strict as Map import qualified Control.Monad.State as State import System.CPUTime --part1 :: [String] -> Int part1 dat = twos*threes where mmap = map countRepeats dat ...
jO-Osko/adventofcode2015
2018/haskell/day2.hs
mit
1,275
0
13
374
583
314
269
28
4
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RecordWildCards #-} module WebColor where import Data.Aeson import Data.Data import Data.String import qualified Data.Text as T impor...
AndrewRademacher/lens-testing
src/WebColor.hs
mit
2,185
0
16
854
708
383
325
56
0