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
module Lev1 where import Data.Array mft :: String -> String -> Array (Int, Int) Int mft f t = m where m = array bounds [ ((i, j), lev i j) | (i,j) <- range bounds ] bounds = ((0, 0), (length t, length f)) lev 0 0 = 0 lev 0 j = succ $ m ! (0 , pred j) lev i 0 = succ $ m ! (pred i, 0 ) lev ...
sordina/mfug_levenshtein_difference_2016_07_07-
src/Lev1.hs
bsd-3-clause
532
0
13
174
365
191
174
14
4
import Data.List (permutations) main = do let result = filter f $ permutations "0123456789" print $ sum $ map read result where f x = f1 x && f2 x && f3 x && f4 x && f5 x && f6 x && f7 x f1 x = read (x!!1 : x!!2 : [x!!3]) `mod` 2 == 0 f2 x = read (x!!2 : x!!3 : [x!!4]) `mod` 3 == 0 ...
stulli/projectEuler
eu43.hs
bsd-3-clause
587
0
14
197
435
223
212
12
1
{- (c) The University of Glasgow 2006 -} {-# LANGUAGE RankNTypes, CPP, MultiWayIf #-} -- | Module for (a) type kinds and (b) type coercions, -- as used in System FC. See 'CoreSyn.Expr' for -- more on System FC and how coercions fit into it. -- module Coercion ( -- * Main data type Coercion, CoercionN,...
olsner/ghc
compiler/types/Coercion.hs
bsd-3-clause
71,893
0
18
19,651
15,480
8,025
7,455
-1
-1
module Type where import Control.Applicative import Data.Int import qualified Data.List as List data Type = ObjectType ObjectType | PrimaryType PrimaryType | NullType deriving Eq instance Show Type where show (ObjectType ot) = ot show (PrimaryType pt) = show pt show NullType = "null" type ObjectType...
ademinn/JavaWithClasses
src/Type.hs
bsd-3-clause
2,653
0
9
644
1,013
513
500
90
3
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} module AuthReqBodyCheck where import Data.Text (Text) import Models import GHC.Generics import Data.Typeable import Conf...
tlaitinen/servant-cookie-hmac-auth-example
src/AuthReqBodyCheck.hs
bsd-3-clause
1,217
0
19
286
293
166
127
35
4
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE ImplicitParams #-} {-# LANGUAGE OverloadedStrings #-} module Base.Exception where import Base.Import import Control.Exception import Control.Monad.Catch (throwM) imp...
leptonyu/mint
corn/src/Base/Exception.hs
bsd-3-clause
3,150
0
12
955
754
395
359
68
1
-- Simple data type to keep track of character positions -- within a text file or other text stream. module Text.Packrat.Pos where data Pos = Pos { posFile :: !String , posLine :: !Int , posCol :: !Int } nextPos (Pos file line col) c | c == '\n' = Pos file (line +...
d3zd3z/HaskellNet-old
Text/Packrat/Pos.hs
bsd-3-clause
986
0
14
331
418
207
211
28
2
module Paths_simple ( version, getBinDir, getLibDir, getDataDir, getLibexecDir, getDataFileName, getSysconfDir ) where import qualified Control.Exception as Exception import Data.Version (Version(..)) import System.Environment (getEnv) import Prelude catchIO :: IO a -> (Exception.IOException -> IO a) ->...
Chuck-Aguilar/haskell-opencv-work
dist/build/autogen/Paths_simple.hs
bsd-3-clause
1,322
0
10
177
362
206
156
28
1
module Main where import Prelude () import Air.Env import Air.Extra import System.Nemesis.Jinjing.Angel import Test.Hspec spec :: IO () spec = hspec - do describe "main" - do it "should run spec" True main = do with_spec spec halt
nfjinjing/nemesis-jinjing
src/SpecTemplate.hs
bsd-3-clause
242
0
11
49
82
44
38
12
1
module Geordi.Request where import qualified Data.Text.Lazy as T import qualified Data.Map as M import qualified Network.HTTP.Types.Method as H import Geordi.FileInfo data Request f = Request { queries :: M.Map T.Text [T.Text] , cookies :: M.Map T.Text [T.Tex...
liamoc/geordi
Geordi/Request.hs
bsd-3-clause
580
0
11
257
148
90
58
11
0
{-# LANGUAGE OverloadedStrings, LambdaCase, TemplateHaskell, QuasiQuotes, TypeFamilies, MultiParamTypeClasses, GADTs, EmptyDataDecls, GeneralizedNewtypeDeriving #-} module Main where import Control.Monad.IO.Class import Control.Monad.Logger import Control.Monad.Trans.Maybe import Data.ByteString (ByteString) import Da...
fumieval/cardboard
app/Main.hs
bsd-3-clause
3,867
0
25
881
1,271
631
640
73
17
{-# LANGUAGE CPP #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE Safe #-} #if __GLASGOW_HASKELL__ >= 706 {-# LANGUAGE PolyKinds #-} #endif {-| A monad morphism is a natural transformation: > morph :: forall a . m a -> n a ... that obeys the following two laws: > morph $ do x <- m = do x <- morph m ...
Gabriel439/Haskell-MMorph-Library
src/Control/Monad/Morph.hs
bsd-3-clause
13,247
0
17
3,284
2,276
1,227
1,049
124
1
-- | Parsing Python code. module Language.Python.TypeInference.Parse ( parse ) where import Language.Python.Common.AST import Language.Python.Common.SrcLocation import Language.Python.TypeInference.Common import Language.Python.TypeInference.Error import Language.Python.Version3.Parser -- | Parse the source code ...
lfritz/python-type-inference
python-type-inference/src/Language/Python/TypeInference/Parse.hs
bsd-3-clause
974
0
14
237
237
130
107
17
2
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Local.Document where import Control.Monad.Reader (ask) i...
tippenein/hasken
lib/Local/Document.hs
bsd-3-clause
3,264
0
11
667
1,083
565
518
89
1
module Brain.Mirror where import Logic import Brain import MonadBrain import Data.Maybe import Control.Monad mirrorBrain :: Brain mirrorBrain = toBrain $ forever $ lastOpponentMove >>= move . fromMaybe nop
sjoerdvisscher/icfp2011
src/Brain/Mirror.hs
bsd-3-clause
212
0
8
34
54
31
23
9
1
{-# LANGUAGE DeriveFoldable , DeriveFunctor , DeriveTraversable , FlexibleContexts , FlexibleInstances , LambdaCase , MultiParamTypeClasses , RankNTypes , ScopedTypeVariables , TemplateHaskell , TupleSections #-} module Simulate ( Event(..) , JobType(..) , simulate ) where import Contr...
vizziv/qsim
src/Simulate.hs
bsd-3-clause
9,048
0
29
2,524
3,211
1,557
1,654
-1
-1
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} module Test.ZM.ADT.Word.Kf92e8339908a (Word(..)) where import qualified Prelude(Eq,Ord,Show) import qualified GHC.Generics import qualified Flat import qualified Data.Model import qualified Test.ZM.ADT.LeastSignificantFirst.K20ffacc8f8c9 import qualified T...
tittoassini/typed
test/Test/ZM/ADT/Word/Kf92e8339908a.hs
bsd-3-clause
843
0
12
59
181
121
60
14
0
module LinePt2 ( LinePt2(..), linePt2, lineP1, lineP2, lineDP , lineP1X, lineP1Y, lineP2X, lineP2Y, lineToPt2s , linesCrossed, lineCrossPt2, hasBoundaryOverlap , crossedLinePairsBrute, crossedLinePairs , LineSide(..) , pointLineSide, lineSide , pt2LineRightCrossingNumber , module Pt2 ) ...
trenttobler/hs-asteroids
src/LinePt2.hs
bsd-3-clause
4,758
0
13
1,468
2,194
1,131
1,063
110
3
module Del.Encode.Cpp where import Del.Encode.Utils import Del.Syntax encodeExp :: Exp -> String encodeExp (Num x) = show x encodeExp (Sym n _ ds) = n ++ encodeDiff ds encodeExp (Neg e) = "-" ++ encodeExp e encodeExp (Mul e1 e2) = encodeExp e1 ++ "*" ++ encodeExp e2 encodeExp (Div e1 e2) = encodeExp e1 ++ "/" ++ enco...
ishiy1993/mk-sode1
src/Del/Encode/Cpp.hs
bsd-3-clause
530
0
9
106
248
121
127
12
1
{-# LANGUAGE Trustworthy #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Ix -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org -- Stability : ...
spacekitteh/smcghc
libraries/base/Data/Ix.hs
bsd-3-clause
2,076
0
5
576
76
69
7
12
0
{-# LANGUAGE CPP #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} -- | Provides template Haskell code to generate instances for JavaScript -- object wrappers (<https://github.com/ku-fpg/sunroof-compiler/wiki/JSObject-Wrapper-Types>). module Langu...
ku-fpg/sunroof-th
Language/Sunroof/TH.hs
bsd-3-clause
8,140
0
36
3,793
1,935
1,005
930
96
12
-- CPP and GeneralizedNewtypeDeriving are needed for IArray UArray instance -- FFI is for log1p {-# LANGUAGE CPP, ForeignFunctionInterface, MultiParamTypeClasses #-} -- We don't put these in LANGUAGE, because it's CPP guarded for GHC only -- HACK: ScopedTypeVariables and InstanceSigs are for GHC 7.10 only... {-# OPTION...
wrengr/logfloat
src/Data/Number/LogFloat.hs
bsd-3-clause
22,006
0
16
4,589
2,455
1,409
1,046
120
1
module Futhark.IR.Prop.RearrangeTests (tests) where import Control.Applicative import Futhark.IR.Prop.Rearrange import Test.Tasty import Test.Tasty.HUnit import Test.Tasty.QuickCheck import Prelude tests :: TestTree tests = testGroup "RearrangeTests" $ isMapTransposeTests ++ [isMapTransposeProp] isMapTra...
diku-dk/futhark
unittests/Futhark/IR/Prop/RearrangeTests.hs
isc
1,540
0
17
464
546
313
233
44
2
{-# 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-elasticache/gen/Network/AWS/ElastiCache/ListTagsForResource.hs
mpl-2.0
3,503
0
9
681
347
217
130
48
1
{-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Ambiata.Cli.Data.Transfer ( TemporaryCreds (..) , Endpoint (..) ) where import Mismi.S3.Amazonka (AccessKey, SecretKey (..), SessionToken (..)) import P data TemporaryCreds = TemporaryCreds { tempKey ...
ambiata/tatooine-cli
src/Ambiata/Cli/Data/Transfer.hs
apache-2.0
642
0
8
152
166
100
66
21
0
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} -------------------------------------------------------------------------------- -- This code is generated by util/genC.hs. -------------------------------------------------------------------------------- module Graphics.UI.GLFW.C where --------------------...
phaazon/GLFW-b
Graphics/UI/GLFW/C.hs
bsd-2-clause
19,563
0
10
3,931
5,060
2,447
2,613
481
0
{-# LANGUAGE TemplateHaskell #-} -------------------------------------------------------------------------------- -- | -- Module : Data.Comp.Derive.Traversable -- Copyright : (c) 2010-2011 Patrick Bahr -- License : BSD3 -- Maintainer : Patrick Bahr <paba@diku.dk> -- Stability : experimental -- Portab...
spacekitteh/compdata
src/Data/Comp/Derive/Traversable.hs
bsd-3-clause
4,538
8
18
1,343
1,415
772
643
-1
-1
{-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeSynonymInstances #-} module List ( main ) where import Prelude hiding (reverse, splitAt) import Data.Foldabl...
sjakobi/brick
tests/List.hs
bsd-3-clause
11,624
0
14
2,650
3,815
1,993
1,822
-1
-1
{- (c) The University of Glasgow, 2000-2006 \section[Finder]{Module Finder} -} {-# LANGUAGE CPP #-} module ETA.Main.Finder ( flushFinderCaches, FindResult(..), findImportedModule, findExactModule, findHomeModule, findExposedPackageModule, mkHomeModLocation, mkHomeModLocation2, mkH...
pparkkin/eta
compiler/ETA/Main/Finder.hs
bsd-3-clause
27,697
1
20
7,899
5,572
2,825
2,747
434
12
{-# LANGUAGE CPP, GADTs #-} -- | -- Module : Data.Array.Accelerate.CUDA -- Copyright : [2008..2011] Manuel M T Chakravarty, Gabriele Keller, Sean Lee, Trevor L. McDonell -- License : BSD3 -- -- Maintainer : Manuel M T Chakravarty <chak@cse.unsw.edu.au> -- Stability : experimental -- Portability : non-port...
wilbowma/accelerate
Data/Array/Accelerate/CUDA.hs
bsd-3-clause
3,221
0
15
743
767
434
333
46
3
-- | Contains version information for Haste. module Haste.Version ( BootVer (..), hasteVersion, intVersion, ghcVersion, bootVersion, showBootVersion, parseBootVersion, showVersion ) where import Data.Version import Config (cProjectVersion) import Text.ParserCombinators.ReadP import Data.Maybe (listToM...
nyson/haste-compiler
src/Haste/Version.hs
bsd-3-clause
1,564
0
11
317
406
220
186
40
1
-- | Build instance tycons for the PData and PDatas type families. -- -- TODO: the PData and PDatas cases are very similar. -- We should be able to factor out the common parts. module Vectorise.Generic.PData ( buildPDataTyCon , buildPDatasTyCon ) where import Vectorise.Monad import Vectorise.Builtins import V...
acowley/ghc
compiler/vectorise/Vectorise/Generic/PData.hs
bsd-3-clause
6,448
0
14
2,170
1,330
673
657
121
5
module Goober () where import Language.Haskell.Liquid.Prelude (isEven) {-@ takeEvens :: [Int] -> [{v: Int | v mod 2 = 0}] @-} takeEvens :: [Int] -> [Int] takeEvens [] = [] takeEvens (x:xs) = if isEven x then x : takeEvens xs else takeEvens xs
mightymoose/liquidhaskell
tests/pos/modTest.hs
bsd-3-clause
293
0
7
94
83
47
36
7
2
----------------------------------------------------------------------------- -- | -- Module : Distribution.Compat.SnocList -- License : BSD3 -- -- Maintainer : cabal-dev@haskell.org -- Stability : experimental -- Portability : portable -- -- A very reversed list. Has efficient `snoc` module Distributi...
themoritz/cabal
Cabal/Distribution/Compat/SnocList.hs
bsd-3-clause
804
0
8
156
202
113
89
16
1
module T10083 where import T10083a data RSR = MkRSR SR eqRSR (MkRSR s1) (MkRSR s2) = (eqSR s1 s2) foo x y = not (eqRSR x y)
ezyang/ghc
testsuite/tests/simplCore/should_compile/T10083.hs
bsd-3-clause
132
0
7
35
67
35
32
5
1
-- !!! ds001 -- simple function and pattern bindings -- -- this tests ultra-simple function and pattern bindings (no patterns) module ShouldCompile where -- simple function bindings f x = x g x y z = f z j w x y z = g w x z h x y = f y where f a b = a -- simple pattern bindings a = b b = f c = c
wxwxwwxxx/ghc
testsuite/tests/deSugar/should_compile/ds001.hs
bsd-3-clause
313
0
7
89
93
50
43
9
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE MultiParamTypeClasses #-}...
b1g3ar5/Spreadsheet
Ref.hs
mit
4,034
0
11
879
1,883
1,015
868
86
1
{-# LANGUAGE MultiParamTypeClasses #-} module Utils.Tuplify ( Tuplify (..) ) where class Tuplify a b where toTuple :: a -> b fromTuple :: b -> a
AndrewRademacher/scotty-cass-test
src/Utils/Tuplify.hs
mit
165
0
7
46
45
26
19
6
0
transpose [] = [] transpose (xs:xss) = let h = head xs tss = map (\x -> [x]) (tail xs) yss = transpose xss in case yss of [] -> [h]:tss (zs:zss) -> (h:zs):map (\(ts, zs') -> (head ts):zs') (zip tss zss)
harryxp/haskell-things
misc/transpose.hs
mit
241
0
16
80
157
82
75
8
2
{-# OPTIONS_GHC -fno-warn-type-defaults #-} module Main where import Numeric.MCMC.Flat import qualified Data.Vector.Unboxed as U (unsafeIndex) bnn :: Particle -> Double bnn xs = -0.5 * (x0 ^ 2 * x1 ^ 2 + x0 ^ 2 + x1 ^ 2 - 8 * x0 - 8 * x1) where x0 = U.unsafeIndex xs 0 x1 = U.unsafeIndex xs 1 origin :: Ensemble ...
jtobin/flat-mcmc
test/BNN.hs
mit
540
0
17
122
224
121
103
16
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.MediaStreamAudioSourceNode (js_getMediaStream, getMediaStream, MediaStreamAudioSourceNode, castToMediaStreamAudioSourceNode, gTypeMediaStreamAudioSourceNode) where import Prelude ((.), (==), ...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/MediaStreamAudioSourceNode.hs
mit
1,528
6
10
176
371
236
135
25
1
{-# LANGUAGE FlexibleContexts #-} {-# OPTIONS_GHC -freduction-depth=50 #-} module CoqLNOutputThmSubst where import Data.Maybe ( catMaybes ) import Text.Printf ( printf ) import AST import ASTAnalysis import ComputationMonad import CoqLNOutputCommon import CoqLNOutputCombinators import MyLibrary ( sepStrings ) subs...
plclub/lngen
src/CoqLNOutputThmSubst.hs
mit
39,755
0
27
19,520
10,063
4,885
5,178
673
9
module Fass.TestHelper where import Test.Hspec import Text.Parsec import Text.Parsec.String testParser :: Parser a -> String -> Either ParseError a testParser parser = parse parser "test parser" matchRight :: (Show a, Show b, Eq b) => Either a b -> b -> IO () matchRight ex y = case ex of Left x -> fail $ show x ...
darthdeus/fass
test/Fass/TestHelper.hs
mit
544
0
9
109
224
117
107
14
2
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.IDBRequest (js_getResult, getResult, js_getError, getError, js_getSource, getSource, js_getTransaction, getTransaction, js_getReadyState, getReadyState, success, error, IDBRequest, castToIDB...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/IDBRequest.hs
mit
3,809
30
13
589
899
511
388
64
1
module Game.Output.Util ( unmanagedSurface ) where import Foreign.Ptr (Ptr) import SDL import SDL.Raw.Types -- | A helper for unmanaged 'Surface's, since it is not exposed by SDL itself. unmanagedSurface :: Ptr SDL.Raw.Types.Surface -> SDL.Surface unmanagedSurface p = SDL.Surface p Nothing
flomerz/SchaffschNie
src/Game/Output/Util.hs
mit
301
0
7
50
65
38
27
7
1
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings, TupleSections, GADTs #-} module DayX where import AdventPrelude2 input :: IO Text input = readFile "data/dayX.txt" parser = letter result1 = runEitherT $ do i <- EitherT (parseOnly (parser `sepBy` endOfLine) <$> input) pure (take 5 i)
farrellm/advent-2016
src/DayX.hs
mit
300
0
14
55
81
43
38
10
1
{-# LANGUAGE CPP #-} module GHCJS.DOM.StringCallback ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.StringCallback #else #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) import GHCJS.DOM.JSFFI.Gen...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/StringCallback.hs
mit
355
0
5
33
33
26
7
4
0
{-# LANGUAGE OverloadedStrings #-} module ClientSpec (spec) where import Helper import HTTP import Client spec :: Spec spec = do describe "client" $ do it "does a HTTP request via a Unix domain socket" $ do inTempDirectory $ do withServer (return (True, "hello")) $ d...
hspec/sensei
test/ClientSpec.hs
mit
717
0
20
212
189
97
92
20
1
laste = head . reverse
zseymour/latex-repo
CS 571/assignment3/code/laste.hs
mit
23
0
5
5
10
5
5
1
1
module Paths_Verba where -- This is here only for ease of testing -- for unpackaged builds. It will be replaced -- by the custom generated one automatically. getDataFileName :: FilePath -> IO FilePath getDataFileName = return
Jefffrey/Verba
src/Paths_Verba.hs
mit
227
0
6
37
24
15
9
3
1
{- see Chapter 41 of the Haskell 2010 Language Report -} module System.IO where
evilcandybag/JSHC
hslib/System/IO.hs
mit
83
0
3
16
7
5
2
1
0
{-| Module : Example.Mnist Description : MNIST traning example Copyright : (c) Anatoly Yakovenko, 2015-2016 License : MIT Maintainer : aeyakovenko@gmail.com Stability : experimental Portability : POSIX This module implements an example traning the MNIST data set. Using the dataset parsing code from: <ht...
aeyakovenko/rbm
Examples/Mnist.hs
mit
10,131
0
24
2,639
2,971
1,506
1,465
192
1
{-# LANGUAGE CPP #-} module Cabal ( getPackageGhcOpts , findCabalFile ) where #ifdef ENABLE_CABAL import Stack import Control.Exception (IOException, catch) import Control.Monad (when) import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.State (execStateT, modify) import Data.Char (isSpace) import ...
schell/hdevtools
src/Cabal.hs
mit
11,366
0
28
2,978
2,292
1,229
1,063
8
1
module Ternary.Examples where import Ternary.Core.Digit import Ternary.List.Exact import Ternary.List.FiniteExact import Ternary.List.FiniteExactNum import Ternary.Util.Triad x = Exact [P1,O0,undefined] 0 y = Exact [P2,P2,undefined] 0 z = Exact (cycle allT2) 0 -- x+x, x*x, y*y z2 = z *...
jeroennoels/exact-real
test/Ternary/Examples.hs
mit
773
0
10
170
256
143
113
26
1
module Data.Dar.Put ( putDARFile, putDARHeader, putINDEXHeader, calcINDEXHeader, putINDEXNode, putDATANode ) where import Data.Binary.Put import qualified Data.ByteString.Lazy.Char8 as BC import Data.Word import Data.Dar.Types -- -- ************************************************** -...
blockynight/hdarchiver
Data/Dar/Put.hs
mit
3,524
0
13
960
618
324
294
55
1
{- Parser.hs: Parser for the Flounder interface definition language Part of Flounder: a strawman device definition DSL for Barrelfish Copyright (c) 2009, ETH Zurich. All rights reserved. This file is distributed under the terms in the attached LICENSE file. If you do not ...
modeswitch/barrelfish
tools/flounder/Parser.hs
mit
9,156
5
23
4,501
2,037
1,033
1,004
164
4
module Fitness where -- | Conversion helper toFloat :: Int -> Float toFloat = fromIntegral . toInteger fitness :: Float -> Int -> Int -> Float fitness coverage towersUsed _ = if k == 0 then 0 else coverage / k where k = toFloat towersUsed
NCrashed/radio-problem
scripts/InvalidFitness2.hs
mit
246
0
7
53
78
43
35
6
2
-- Copyright 2015 Mitchell Kember. Subject to the MIT License. -- Project Euler: Problem 15 -- Lattice paths module Problem15 where import Common (combinations) routes :: Int -> Int -> Int routes w h = fromIntegral result where ww = toInteger w hh = toInteger h result = combinations ww (ww + hh) solve...
mk12/euler
haskell/Problem15.hs
mit
349
0
9
79
91
50
41
9
1
module Storyfragment where import Data.Char isNotAlpha = not . isAlpha hasAlpha = any isAlpha nonPunctuationError xs = error (show xs ++ " is not all punctuation") nonLetterError x = error (show x ++ " is not a letter") data Fragment = Fragment String Char deriving (Show) fragment punctuation letter |...
akaihola/palindromi-haskell
src/Storyfragment.hs
mit
1,925
0
12
590
839
408
431
40
5
module Items where import Data.Map (adjust) import Properties data Item = Item { itemName :: String, itemInfo :: Properties, itemActions :: [String] } deriving (Eq) instance Show Item where show (Item name info actions) = name class Inv a where findIt...
emhoracek/explora
library/Items.hs
gpl-2.0
1,175
0
9
325
201
116
85
19
1
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-} -- Copyright (C) 2008 JP Bernardy module Yi.TextCompletion ( -- * Word completion wordComplete, wordComplete', wordCompleteString, wordCompleteString', mkWordComplete, resetComplete, complet...
codemac/yi-editor
src/Yi/TextCompletion.hs
gpl-2.0
6,052
0
21
1,388
1,113
584
529
85
3
module CountingChange where import Data.List countchange :: Int -> [Int] -> Int countchange m c = countChange m $ (reverse . sort) c countChange :: Int -> [Int] -> Int countChange _ [] = 0 countChange 0 _ = 1 countChange m c@(x:xs) = if m < 0 then 0 else...
ardumont/haskell-lab
src/CountingChange.hs
gpl-2.0
800
0
9
188
157
90
67
10
2
{-# LANGUAGE OverloadedStrings #-} module Ssh.Cryption.Tests ( tests ) where import Test.Framework import Test.QuickCheck import qualified Test.HUnit as H import Test.Framework.Providers.HUnit import Test.Framework.Providers.QuickCheck2 import Data.Word import Control.Monad.State import qualified Data.ByteStrin...
bcoppens/HaskellSshClient
tests/Ssh/Cryption/Tests.hs
gpl-3.0
1,044
0
16
196
301
164
137
25
1
import Graphics.UI.GLUT import Control.Monad.Cont import Data.IORef(IORef) import qualified Data.IORef as IORef import qualified Foreign.C.Types import LiveSource newIORef x = lift (IORef.newIORef x) writeIORef x y = lift (IORef.writeIORef x y) readIORef x = lift (IORef.readIORef x) modifyIORef x y = lift (IORef.modi...
xpika/live-source
examples/live-glut-test/example.hs
gpl-3.0
1,943
0
15
448
572
284
288
49
2
{-# LANGUAGE StandaloneDeriving, FlexibleInstances #-} module Pseudoterminal w3here import System.Posix.Pty import System.Process import Data.ByteString.Char8 (pack) -- | Spawn in my regular env spawnWithEnv :: FilePath -> [String] -> (Int, Int) -> IO (Pty, ProcessHandle) spawnWithEnv = spawnWithPty N...
pscollins/Termonoid
src/Pseudoterm.hs
gpl-3.0
1,460
1
10
453
343
174
169
-1
-1
module Format where import System.Console.ANSI import Data.List import Data.Time.Clock (UTCTime) import qualified Data.Time.Format as F import Text.Printf (printf) import WeatherParse import WeatherFetch -- how do we want to display something? data OutputFormat = Plaintext | Pango | ANSI deriving (...
ibabushkin/hweather
Format.hs
gpl-3.0
3,342
0
17
1,032
1,031
526
505
77
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-android-publisher/gen/Network/Google/Resource/AndroidPublisher/Edits/APKListings/Get.hs
mpl-2.0
4,764
0
18
1,095
566
336
230
91
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.BigtableAdm...
brendanhay/gogol
gogol-bigtableadmin/gen/Network/Google/BigtableAdmin/Types/Product.hs
mpl-2.0
143,940
0
18
32,414
23,424
13,523
9,901
2,572
1
{-# OPTIONS_GHC -fno-warn-unused-imports #-} module Gonimo.Server.AuthHandlers where import Control.Concurrent.STM (STM, TVar, readTVar) import Control.Lens import Control.Monad import Control.Monad.Freer (Eff) import Control.Monad ...
charringer/gonimo-back
src/Gonimo/Server/AuthHandlers.hs
agpl-3.0
7,597
0
19
2,175
1,750
916
834
-1
-1
{-# LANGUAGE OverloadedStrings #-} import Hakyll import Control.Monad (forM_) import Control.Arrow ((>>>), arr) -- import Text.Pandoc main :: IO () main = hakyll $ do route "css/*" idRoute compile "css/*" compressCssCompiler forM_ ["images/*"] $ \f -> do route f idRoute compile f copyF...
aartamonau/haskell-holes
gh-pages/hakyll.hs
lgpl-3.0
814
0
18
227
193
95
98
21
1
maximum' :: (Ord a) => [a] -> a maximum' [] = error "Maximum of empty list" maximum' [x] = x maximum' (x:xs) | x > maxTail = x | otherwise = maxTail where maxTail = maximum' xs --alternatives: --worst case exponential growth, e.g. list is sorted in ascending order --maximum' (x:xs) = if x > maximum' xs then...
alexliew/learn_you_a_haskell
4_recursion.hs
unlicense
1,723
0
10
429
653
349
304
33
1
-- Taken from https://hackage.haskell.org/package/located-base-0.1.1.0/docs/src/GHC-Err-Located.html {-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE ImplicitParams #-} {-# LANGUAGE OverloadedStrings #-} module Spark.Core.Internal.LocatedBase (error, undefined, HasCallStack, showCallStack) where #if...
krapsh/kraps-haskell
src/Spark/Core/Internal/LocatedBase.hs
apache-2.0
1,489
0
9
199
243
137
106
-1
-1
-- Only definition nodes should be considered typos module OnlyDefinitionNodes where import Notatypo import Notatypo.Notatypo <TYPO>imatypo</TYPO> :: Notatypo <TYPO>imatypotoo</TYPO> <TYPO>imatypo</TYPO> = notatypo data <TYPO>Imatypo</TYPO> <TYPO>imatypo</TYPO> = <TYPO>Imatypo</TYPO> Notatypo newtype <TYPO>Imatypo...
carymrobbins/intellij-haskforce
tests/gold/spellchecker/OnlyDefinitionNodes.hs
apache-2.0
571
22
45
61
245
127
118
-1
-1
{-| Copyright : (C) 2012-2016, University of Twente License : BSD2 (see the file LICENSE) Maintainer : Christiaan Baaij <christiaan.baaij@gmail.com> Type and instance definitions for Primitive -} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} m...
ggreif/clash-compiler
clash-lib/src/CLaSH/Primitives/Types.hs
bsd-2-clause
1,723
0
17
400
331
193
138
35
0
{-# LANGUAGE BangPatterns, CPP, RecordWildCards, ScopedTypeVariables #-} #if __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE Trustworthy #-} #endif -- | -- Module : Data.Text.IO -- Copyright : (c) 2009, 2010 Bryan O'Sullivan, -- (c) 2009 Simon Marlow -- License : BSD-style -- Maintainer : bos@serpenti...
text-utf8/text
Data/Text/IO.hs
bsd-2-clause
12,894
0
21
3,221
2,713
1,435
1,278
181
4
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QPushButton.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:15 Warning : this file is machine generated - do n...
keera-studios/hsQt
Qtc/Gui/QPushButton.hs
bsd-2-clause
49,930
0
14
8,076
16,193
8,211
7,982
-1
-1
-- http://www.codewars.com/kata/530265044b7e23379d00076a module PointInPolygon where type Point = (Double, Double) between :: Double -> Double -> Double -> Bool between a b c = b<=a && a<=c || c<=a && a<=b pointInPoly :: [Point] -> Point -> Bool pointInPoly poly (px, py) = checkOx || checkOy where poly' = map (\(a...
Bodigrim/katas
src/haskell/3-Point-in-Polygon.hs
bsd-2-clause
858
0
12
214
432
230
202
20
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QTextTableFormat.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:16 Warning : this file is machine generated -...
uduki/hsQt
Qtc/Gui/QTextTableFormat.hs
bsd-2-clause
6,202
0
12
887
1,591
820
771
-1
-1
------------------------------------------- module Color where import Data.Maybe ------------------------------------------- data Color = Black | White deriving Eq instance Show Color where show Black = "\9787" show White = "\9786" instance Read Color where readsPrec _ input | head input == 'W' = [(Wh...
irmikrys/Gomoku
src/Color.hs
bsd-3-clause
746
0
10
160
247
124
123
22
1
{-# LANGUAGE GADTs, DataKinds, KindSignatures, StandaloneDeriving, TypeFamilies, FlexibleInstances #-} module Data.BitVector.Sparse where import Data.Bit import qualified Data.List as L -- BitVector is a compact representation of a Sparse bit vector. -- It has not specific length, other than where the 1's are. newty...
ku-fpg/ecc-ldpc
src/Data/BitVector/Sparse.hs
bsd-3-clause
1,486
0
11
405
635
341
294
28
4
{-# language CPP #-} -- No documentation found for Chapter "DynamicState" module Vulkan.Core10.Enums.DynamicState (DynamicState( DYNAMIC_STATE_VIEWPORT , DYNAMIC_STATE_SCISSOR , DYNAMIC_STATE_LINE_WIDTH ...
expipiplus1/vulkan
src/Vulkan/Core10/Enums/DynamicState.hs
bsd-3-clause
27,560
1
10
5,844
1,310
877
433
-1
-1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleContexts #-} module Main where import Control.Lens import Control.Monad.State import Data.Map.Strict (Map) import qualified Data.Map.Strict as M import FreeGame -- import Linear {- Window size: 480 x 360 Game size: 50 x 50 Cell size: 6 x 6 -} type Coord = V2 Int ...
Taneb/zombie-game
src/Main.hs
bsd-3-clause
2,937
0
15
648
1,093
557
536
-1
-1
module Sharc.Instruments.ViolinsEnsemble (violinsEnsemble) where import Sharc.Types violinsEnsemble :: Instr violinsEnsemble = Instr "violinensemb" "Violins (ensemble)" (Legend "McGill" "1" "21") (Range (InstrRange (HarmonicFreq 1 (Pitch 146.83 38 "d3")) (Pitch 195.99 4...
anton-k/sharc-timbre
src/Sharc/Instruments/ViolinsEnsemble.hs
bsd-3-clause
41,156
0
15
11,901
15,066
7,801
7,265
1,406
1
{-# LANGUAGE FlexibleInstances #-} module Kalium.Haskell.Sugar where import Kalium.Prelude import Kalium.Util (closureM) import Kalium.Haskell.Common import Language.Haskell.Exts.Syntax import Language.Haskell.Exts.SrcLoc (noLoc) sugarcoat :: Module -> Module sugarcoat = runIdentity . closureM sugar class Sugar a w...
rscprof/kalium
src/Kalium/Haskell/Sugar.hs
bsd-3-clause
10,520
0
17
3,042
4,053
2,012
2,041
-1
-1
{-# OPTIONS_GHC -fno-warn-orphans #-} -- | -- Module : Language.SequentCore.Pretty -- Description : Pretty printing of Sequent Core terms -- Maintainer : maurerl@cs.uoregon.edu -- Stability : experimental -- -- Instances and functions for pretty-printing Sequent Core terms using GHC's -- built-in pretty printe...
pdownen/sequent-core
src/Language/SequentCore/Pretty.hs
bsd-3-clause
6,544
0
17
1,561
2,375
1,166
1,209
140
3
{-# LANGUAGE ScopedTypeVariables, RankNTypes, TypeFamilies, FlexibleContexts, ExistentialQuantification #-} module Main where import Language.KansasLava import Data.Default import qualified Matrix import qualified Memory import qualified Coerce import qualified Others import qualified Protocols main :: IO () main ...
andygill/kansas-lava
tests/Main.hs
bsd-3-clause
702
0
12
230
134
80
54
19
1
module ParserAux where import DataSpec import Data.Char import Expressions import Auxiliary import Processes printExpressions [] = [] printExpressions updates = infixString [(printExpression var) ++ " := " ++ (printExpression val) | (var,val) <- updates] ", " data Item = DataActions [(String, ActionType)] ...
utwente-fmt/scoop
src/ParserAux.hs
bsd-3-clause
2,666
0
10
805
671
378
293
57
2
module Data.Functor.Listable ( Listable(..) , cons0 , cons1 , cons2 , cons3 , cons4 , cons5 , cons6 , (\/) , Listable1(..) , tiers1 , Listable2(..) , tiers2 , liftCons1 , liftCons2 , liftCons3 ) where import Test.LeanCheck class Listable1 l where liftTiers :: [[a]] -> [[l a]] tiers1 :: (Listable a, Listable1 l) =>...
robrix/ui-effects
src/Data/Functor/Listable.hs
bsd-3-clause
1,251
0
12
252
629
355
274
39
1
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-} ------------------------------------------------------------------------------ -- | This module is where all the routes and handlers are defined for your -- site. The 'app' function is the initializer that combines everything -- t...
nurpax/hstodo
src/Site/Site.hs
bsd-3-clause
8,968
0
23
2,235
2,332
1,206
1,126
181
3
module HJScript.DOM.Node ( Node(..), IsNode(..), NodeType(..), nodeTypeVal, nodeName, nodeType, nodeValue, ownerDocument, prefix, cloneNode ) where import HJScript.Lang --import HJScript.DOM.Document import HJScript.DOM.NodeTypes ----------------------------...
seereason/HJScript
src/HJScript/DOM/Node.hs
bsd-3-clause
1,645
0
8
297
336
181
155
28
1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE ExplicitNamespaces #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} {-# LANG...
palf/free-driver
packages/drive-base/lib/Drive/Interpreter.hs
bsd-3-clause
1,867
0
12
552
868
468
400
65
2
module Main ( main ) where -- import AI.SVM.Simple import Control.Applicative import Control.Exception ( tryJust ) import Control.Lens ( Lens', lens, (.~), view, set ) import Control.Monad ( guard, liftM ) import qualified Data.ByteString.Lazy as LBS import qualified Data.Csv as CSV import qualified Data.Foldable as F...
travitch/iiglue
tools/IIGlue.hs
bsd-3-clause
10,217
0
23
2,606
2,098
1,104
994
189
5
{-# LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes, ExistentialQuantification, NoImplicitPrelude #-} module Unfold.Pure where import Lib hiding (foldM) import Data.Strict.Tuple import Data.Strict.Maybe import Data.Strict.Drive import qualified Prelude as P data Unfold ...
effectfully/prefolds
src/Unfold/Pure.hs
bsd-3-clause
1,060
0
11
190
263
145
118
18
1
module HaskQuery ( module HaskQuery.AutoIndex, Relation, Cont, Control.Monad.Trans.Cont.cont, Control.Monad.Trans.Cont.runCont, runQueryWithCollector, empty, emptyWithIndex, size, reindex, runQuery, select, runQueryM, executeM, selectM, filterM, HaskQuery.filter, selectWithIndex, selectWithIndexM, selectMaybe, selectDy...
stevechy/HaskQuery
HaskQuery.hs
bsd-3-clause
7,064
0
15
1,088
2,388
1,318
1,070
109
2
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} module Config where import Control.Exception (throwIO) import Control.Monad.Except (ExceptT, MonadError) import Control.Monad.Logger (runNoLoggingT, ...
annakopp/potteryapp
src/Config.hs
bsd-3-clause
2,869
0
17
1,103
565
317
248
64
2
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.CA.Corpus (corpus) where import Data.String import P...
facebookincubator/duckling
Duckling/Numeral/CA/Corpus.hs
bsd-3-clause
3,421
0
11
1,341
798
443
355
110
1
-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} module NumberSix.Handlers.Weather.Tests ( tests ) where -------------------------------------------------------------------------------- import Data.Maybe (fromJust) im...
jaspervdj/number-six
tests/NumberSix/Handlers/Weather/Tests.hs
bsd-3-clause
943
0
17
232
147
82
65
15
1
{-# LANGUAGE ImplicitParams #-} module Main where import JKF.Parser.Kif import Data.Encoding import Data.Encoding.ISO2022JP -- import Data.Encoding.CP932 import System.IO.Encoding (readFile) import Prelude hiding (readFile) import Control.Applicative ((<$>)) main :: IO () main = do let ?enc = ISO2022JP -- s <...
suzuki-shin/jkf-hs
app/Main.hs
bsd-3-clause
841
0
9
139
140
79
61
17
1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1993-1998 -} {-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} module GHC.Iface.Syntax ( module GHC.Iface.Type, IfaceDecl(..), IfaceFamTyConFlav(..), IfaceClassOp(..), IfaceAT(..), IfaceConDecl(..), IfaceConD...
sdiehl/ghc
compiler/GHC/Iface/Syntax.hs
bsd-3-clause
98,706
109
79
31,831
22,782
11,505
11,277
1,803
14
{-# LANGUAGE OverloadedStrings #-} import Test.Hspec import LibText import Prelude hiding (readFile, unlines) import Data.Text import Data.Text.IO import Data.List as L main :: IO () main = do src <- readFile "test/testdata/TestMod.hs" let expect...
clojj/haskell-view
test/SpecLibText.hs
bsd-3-clause
6,213
0
20
1,300
3,151
1,992
1,159
89
1