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
{-# LANGUAGE ScopedTypeVariables #-} module CAProtoMain where import ProtoTypes import ProtoMonad import ProtoActions import Keys import TPM import TPMUtil import VChanUtil hiding (send, receive) import System.IO import System.Random import Control.Monad.IO.Class --import qualified Control.Monad.Trans.Reader as T im...
armoredsoftware/protocol
tpm/mainline/protoMonad/CAProtoMain.hs
bsd-3-clause
6,602
0
21
1,740
1,726
872
854
148
3
module System.HFind.Expr.Types ( module X , TypedName(..) ) where import qualified Data.Text as T import System.HFind.Expr.Types.AST as X import System.HFind.Expr.Types.Value as X data TypedName = TypedName !X.ValueType !X.Name instance Show TypedName where show (TypedName ty name) = show ty ++ " " ++ T...
xcv-/pipes-find
src/System/HFind/Expr/Types.hs
mit
333
0
8
61
106
64
42
13
0
{-# LANGUAGE OverloadedStrings, ExtendedDefaultRules #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Plot traces to html using blaze-html Example code: @ plotHtml :: Html () plotHtml = toHtml $ plotly "myDiv" [trace] & layout . title ?~ "my plot" & layout . width ?~ 300 @ ...
diffusionkinetics/open
plotlyhs/src/Graphics/Plotly/Blaze.hs
mit
1,393
0
15
262
290
161
129
23
1
{- Copyright 2012-2013 Google Inc. All Rights Reserved. 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 required by applicable law or agreed t...
mzero/plush
src/Plush/Run/BuiltIns/ShellState.hs
apache-2.0
9,946
0
21
2,785
3,094
1,605
1,489
207
15
module L06.MoreParser where import L01.Validation import L03.Parser import Data.Char import Numeric import Control.Applicative import Control.Monad -- Parses the given input and returns the result. -- The remaining input is ignored. (<.>) :: Parser a -> Input -> Validation a (<.>) = error "todo" -- Exercise ...
juretta/course
src/L06/MoreParser.hs
bsd-3-clause
5,629
0
9
1,125
678
381
297
129
1
{- Monads -} -- Functor => Applicative Functor => Monads fmap :: (Functor f) => (a -> b) -> f a -> f b (<*>) :: (Applicative f) => f (a -> b) -> f a -> f b (>>=) :: (Monad m) => m a -> (a -> m b) -> m b -- notice the differences among the functions intaken. {- # Monad Class every monad is an applicative functor -} ...
idf/haskell-examples
fundamentals/11_monads.hs
bsd-3-clause
4,186
0
14
1,069
1,282
662
620
80
1
{-# LANGUAGE Haskell2010 #-} {-# LINE 1 "Network/HPACK/Types.hs" #-} {-# LANGUAGE DeriveDataTypeable #-} module Network.HPACK.Types ( -- * Header HeaderName , HeaderValue , HeaderStuff , Header , HeaderList , TokenHeader , TokenHeaderList -- * Misc , Index , HIndex(..) -- * Encoding and decod...
phischu/fragnix
tests/packages/scotty/Network.HPACK.Types.hs
bsd-3-clause
3,322
0
9
758
450
293
157
68
1
{- (c) The GRASP/AQUA Project, Glasgow University, 1993-1998 \section[Specialise]{Stamping out overloading, and (optionally) polymorphism} -} {-# LANGUAGE CPP #-} module ETA.Specialise.Specialise ( specProgram, specUnfolding ) where #include "HsVersions.h" import ETA.BasicTypes.Id import ETA.TypeCheck.TcType hiding...
alexander-at-github/eta
compiler/ETA/Specialise/Specialise.hs
bsd-3-clause
87,509
1
22
25,401
10,739
5,829
4,910
-1
-1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE GADTs #-} -- This module is full of orphans, unfortunately module GHCi.TH.Binary () where import Prelude -- See note [Why do we import Prelude here?] import Data.Binary...
sdiehl/ghc
libraries/ghci/GHCi/TH/Binary.hs
bsd-3-clause
2,451
0
12
347
703
342
361
73
0
-- -- Copyright (c) 2013 Citrix Systems, Inc. -- -- 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 your option) any later version. -- -- This progra...
jean-edouard/manager
xenmgr/Vm/Utility.hs
gpl-2.0
4,525
0
15
1,013
1,287
656
631
82
8
{-# LANGUAGE RebindableSyntax, NPlusKPatterns #-} {-# OPTIONS -Wno-error=missing-monadfail-instances #-} module Main where { -- import Prelude; import qualified Prelude; import Prelude(String,undefined,Maybe(..),IO,putStrLn, Integer,(++),Rational, (==), (>=) ); deb...
sdiehl/ghc
testsuite/tests/rebindable/rebindable4.hs
bsd-3-clause
4,543
1
23
2,059
1,144
625
519
84
1
{- hsc2hs program as a temporary solution, this is a wrapper around an existing hsc2hs, this should be replaced by a custom preprocessor to generate the code for the JS architecture. -} import Data.Char import Data.List import System.Exit import System.Process import q...
beni55/ghcjs
src-bin/Hsc2Hs.hs
mit
950
0
16
211
189
106
83
15
1
module LilRender.Image.DrawingPrimitives (drawFilledTriangle , drawTri, wrapColorGetter, wrapGetColor ) where import Control.Monad.Primitive import qualified Data.Vector.Storable as V import qualified Data.Vector.Storable.Mutable as MV import Foreign.C import Foreign.Fore...
SASinestro/lil-render
src/LilRender/Image/DrawingPrimitives.hs
isc
2,090
0
17
487
680
345
335
30
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE LambdaCase #-} import Control.Concurrent.STM (atomically) import Control.Concurrent.STM.TVar (swapTVar, readTVar) import Data.Conduit import qualified Data.Conduit.List as CL import qualified Data.Conduit.C...
jpfuentes2/swim
test/Spec.hs
mit
6,743
0
26
1,887
2,159
1,130
1,029
143
2
module CCNxPacketGenerator ( preparePacket , produceInterestPackets , produceInterests , produceContents , produceNamelessContents , produceContentPackets , producePacketPairs , balancedManifestTree , createInterest , createContent , createPayload ) where import System.IO im...
chris-wood/ccnx-pktgen
src/CCNxPacketGenerator.hs
mit
21,023
0
20
4,647
6,479
3,445
3,034
338
2
module Tarefa1_2017li1g183 where import LI11718 --------------- from Nuno testesT1 :: [Caminho] testesT1 = [c_ex1,c_ex1',c_ex2,c_ex4,c_ex5,c_ex6 ,c_exOP,c_exDM,c_exOL,c_exHM,c_exR,c_exE] -- ,m_ex1,m_ex2,m_ex3 -- ,m_exPI,m_exLV,m_exEX,m_exLH] c_ex1 :: Caminho c_ex1 = [Avanca,CurvaEsq...
hpacheco/HAAP
examples/plab/svn/2017li1g183/src/Tarefa1_2017li1g183.hs
mit
5,198
0
12
954
2,161
1,259
902
83
1
{-# LANGUAGE DataKinds, FlexibleContexts, FlexibleInstances, GADTs, MultiParamTypeClasses, TypeFamilies, TypeOperators, UndecidableInstances #-} module Data.Nested.Naturals where import GHC.TypeLits hiding ((+)(), (*)(), (-)(), (^)()) import qualified GHC.TypeLits as N -- Peano Numbers for type-level computation. d...
filonik/nfunctors
src/Data/Nested/Naturals.hs
mit
1,694
11
10
427
853
478
375
-1
-1
module Tfoo.Foundation where import Tfoo.Game import Yesod.Static import Control.Concurrent.MVar data Tfoo = Tfoo { seed :: Int, games :: MVar [IO Game], nextGameId :: MVar Int, tfooStatic :: Static } -- Increment Tfoo's Game counter and return id of the next new Game. newGame :: Tfoo ->...
nbartlomiej/tfoo
Tfoo/Foundation.hs
mit
490
0
11
116
140
78
62
14
1
module Challenge263.Intermediate where import Data.List import Data.Map (Map, (!)) import qualified Data.Map as Map import Data.Maybe import qualified Text.Read as R import Text.Trifecta import Text.Trifecta.Delta type Stress = Integer ...
z0isch/reddit-dailyprogrammer
Challenge263/src/Challenge263/Intermediate.hs
mit
3,589
0
13
734
1,262
646
616
75
24
module Main where import Graphics.GLUtil (offset0) import Graphics.Rendering.OpenGL import Graphics.UI.GLUT import Foreign.Marshal.Array (withArray) import Foreign.Storable (sizeOf) main :: IO () main = do getArgsAndInitialize initialDisplayMode $= [DoubleBuff...
triplepointfive/hogldev
tutorial03/Tutorial03.hs
mit
1,604
0
10
414
451
221
230
45
1
{-# htermination (fromIntRatio :: MyInt -> Ratio MyInt) #-} import qualified Prelude data MyBool = MyTrue | MyFalse data List a = Cons a (List a) | Nil data MyInt = Pos Nat | Neg Nat ; data Nat = Succ Nat | Zero ; data Ratio a = CnPc a a; fromIntMyInt :: MyInt -> MyInt fromIntMyInt x = x; intToRatio x = C...
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/fromInt_1.hs
mit
443
0
11
98
152
86
66
11
1
module First where
JoshuaGross/haskell-learning-log
Code/Haskellbook/State/src/First.hs
mit
20
0
2
4
4
3
1
1
0
{-# LANGUAGE FlexibleContexts #-} module Env where import Control.Monad.Except import Data.IORef import Data.Maybe import Types nullEnv :: (MonadIO m) => m Env nullEnv = liftIO $ newIORef [] isBound :: (MonadIO m) => Env -> String -> m Bool isBound envRef var = do env <- liftIO $ readIORef envRef return . is...
ublubu/wyascheme
src/Env.hs
mit
1,644
0
16
446
574
284
290
54
2
module CompileTex ( processExternal ) where import System.Process (system) import GHC.IO.Exception (ExitCode(..)) import Data.List (intersperse) import Control.Monad (when) type VerboseFlag = Bool type FileName = String type TexHeader = String type TexCommands = String type TexWrap = (TexHeader,...
dino-r/TexErupter
src/CompileTex.hs
mit
3,738
0
19
1,109
838
439
399
67
3
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Language.Pal.Eval ( eval , initialEnv ) where import Control.Applicative import Control.Error import Control.Monad.Error (MonadError, throwError) import Control.Monad.State import Data.Monoid ((<>)) import Language.Pal.Types newtype EvalT m a = EvalT { unEva...
samstokes/pal
Language/Pal/Eval.hs
mit
5,920
0
12
1,235
2,387
1,215
1,172
-1
-1
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} module Lambda_utils where import LmLanguage import LmPathfinder (pathfind, fPathfind, pathfindModule, coordEq) import Lmcompile hiding (block) import Lambda_compiler_2 import Quad_tree import Prelude (Num(..), ($), (.),...
ychin/icfp_2014_CannonBrawl
code/lambda_utils.hs
mit
40,684
334
56
7,770
11,276
5,899
5,377
-1
-1
module Main where import Data.List (minimumBy) import Data.Maybe import qualified Data.Map as Map import Text.Regex.Posix import System.IO import System.IO.Error import System.Environment type Time = Int type Node = Char data Street = Street { start :: Node, end :: Node, name :: String, times...
devonhollowood/dailyprog
2015-01-14/shortest_path.hs
mit
3,874
0
15
1,141
1,319
675
644
76
3
{-# LANGUAGE TemplateHaskell, DeriveDataTypeable #-} {- Copyright (C) 2012-2017 Kacper Bak, Jimmy Liang, Michal Antkiewicz, Luke Michael Brown <http://gsd.uwaterloo.ca> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), ...
juodaspaulius/clafer
src/Language/Clafer/Intermediate/Intclafer.hs
mit
15,702
0
15
3,806
3,865
2,063
1,802
245
1
{-# LANGUAGE NoMonomorphismRestriction #-} import Text.XML.HXT.Core import Text.HandsomeSoup import Network.HTTP.Conduit (simpleHttp) import Data.ByteString.Lazy.UTF8 (toString) import System.Environment import Data.Tree.NTree.TypeDefs base :: String base = "https://gist.github.com" main :: IO () main = getArgs...
sordina/gists
Gists.hs
mit
1,415
0
13
299
490
256
234
-1
-1
import Control.Concurrent import System.IO import Network blockSize :: Int blockSize = 500000 startServer = withSocketsDo $ do sock <- listenOn $ PortNumber 32101 sockHandler sock list where list :: [Int] list = [0, blockSize .. ] sockHandler :: Socket -> [Int] -> IO () sockHand...
Joss-Steward/Primality
server.hs
mit
893
0
14
274
325
162
163
24
1
-- Copyright 2015 Mitchell Kember. Subject to the MIT License. -- Project Euler: Problem 36 -- Double-base palindromes module Problem36 where import Common (isPalindrome, digits) import Data.Bits (unsafeShiftL, unsafeShiftR, (.&.), (.|.)) isBinPalindrome :: Int -> Bool isBinPalindrome n = odd n && binReverse n == n...
mk12/euler
haskell/Problem36.hs
mit
602
0
11
146
197
110
87
13
2
-- | A very simple implementation of the Levenshtein algorithm. module Data.Text.Levenshtein where import Algebra.Structure.Semiring import Data.Text (Text) import qualified Data.Text as T import qualified Data.Vector.Unboxed as VU import qualified Data.Vector.Align.Global.Linear2 as Align --...
choener/AlignmentAlgorithms
Data/Text/Levenshtein.hs
gpl-3.0
960
0
10
184
177
105
72
-1
-1
{-# LANGUAGE ImplicitParams, FlexibleInstances, FlexibleContexts, ViewPatterns, RecordWildCards, NamedFieldPuns, ScopedTypeVariables, TypeSynonymInstances, NoMonomorphismRestriction, TupleSections, StandaloneDeriving, GeneralizedNewtypeDeriving #-} {-# OPTIONS -Wall -fno-warn-unused-imports #-} module Blender.Build whe...
DanielSchuessler/hstri
Blender/Build.hs
gpl-3.0
7,446
0
20
1,867
2,215
1,107
1,108
160
2
{- mtlstats Copyright (C) 1984, 1985, 2019, 2020, 2021 Rhéal Lamothe <rheal.lamothe@gmail.com> 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 3 of the License, or (at your option) an...
mtlstats/mtlstats
test/HelpersSpec.hs
gpl-3.0
1,015
0
8
164
79
48
31
10
1
{-# LANGUAGE TupleSections, OverloadedStrings #-} module Handler.Home where import Import -- we import Yesod.Auth(maybeAuthId) because it doesn't seem to like being imported -- from the Import.hs file and we need it to display or hide the snip creation form -- in the Snips handler import Yesod.Auth (maybeAuthId,Ro...
ciderpunx/snippio
Handler/Home.hs
agpl-3.0
3,454
0
18
815
692
344
348
-1
-1
-- Copyright (C) 2017 Red Hat, Inc. -- -- This library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Lesser General Public -- License as published by the Free Software Foundation; either -- version 2.1 of the License, or (at your option) any later version. -- -- This library i...
dashea/bdcs
importer/BDCS/RPM/Utils.hs
lgpl-2.1
1,532
0
14
294
310
180
130
12
3
{-# OPTIONS_GHC -Wall #-} import Data.Char -- Credit card validator intToString :: Int -> String intToString n = (if d /= 0 then intToString d else "") ++ [intToDigit m] where (d, m) = n `divMod` 10 toDigits :: Integer -> [Integer] toDigits = map (toInteger . digitToInt) . intToString . fromInte...
spanners/cis194
01-intro/01-intro.hs
unlicense
1,003
0
9
197
366
204
162
25
2
module Geometry.Cuboid ( volume , area ) where volume :: Float -> Float -> Float volume a b c = rectArea a b * c area :: Float -> Float -> Float area a b c = rectArea a b * 2 + rectArea a c * 2 + rectArea b c * 2 rectArea :: Float -> Float -> Float rectArea a b = a * b
alexliew/learn_you_a_haskell
code/Geometry/Cuboid.hs
unlicense
273
0
10
71
135
69
66
9
1
{-#LANGUAGE OverloadedStrings#-} module Data.P440.XML.Instances.Render.ZSO where import qualified Data.P440.Domain.ZSO as ZSO import Data.P440.Domain.ComplexTypes import Data.P440.XML.Render import qualified Data.P440.XML.Instances.Render.ComplexTypes as C instance ToNode ZSO.Файл where toNode (ZSO.Файл идЭС тип...
Macil-dev/p440
src/Data/P440/XML/Instances/Render/ZSO.hs
unlicense
4,410
0
11
1,191
2,252
1,130
1,122
83
0
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} module Data.CRF.Chain2.Tiers.Array ( -- * Array Array , mkArray , unArray , (!?) -- * Bounds , Bounds (..) ) where import Control.Applic...
kawu/crf-chain2-tiers
src/Data/CRF/Chain2/Tiers/Array.hs
bsd-2-clause
2,651
0
11
777
928
511
417
69
2
{-# LANGUAGE TemplateHaskell #-} module Model where import Data.ByteString import qualified Data.ByteString as BS import Data.List (find) import Data.Maybe (fromJust) import qualified Data.Text as T import Data.Text(Text) import...
kmels/tersus
Model.hs
bsd-2-clause
1,174
0
6
312
212
137
75
22
0
module Graphics.GL.Low.Depth where import Control.Monad.IO.Class import Graphics.GL -- | Enable the depth test. Attempting to render pixels with a depth value -- greater than the depth buffer at those pixels will have no effect. Otherwise -- the depth in the buffer will get updated to the new pixel's depth. enableDep...
sgraf812/lowgl
Graphics/GL/Low/Depth.hs
bsd-2-clause
675
0
7
107
106
61
45
9
1
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module CLaSH.GHC.GHC2Core ( GHC2CoreState , coreToTerm , coreToId , makeAllTyCons , emptyGHC2CoreSta...
christiaanb/clash-compiler
clash-ghc/src-ghc/CLaSH/GHC/GHC2Core.hs
bsd-2-clause
23,669
0
36
8,500
7,025
3,600
3,425
479
32
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE OverlappingInstances #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE EmptyDataDecls #-...
arirahikkala/yaml-with-class
src/Data/YamlObject/Generic.hs
bsd-3-clause
9,886
0
20
2,247
2,943
1,544
1,399
-1
-1
module Beekeeper.Core.Declaration where import Beekeeper.Core.Identifiers (PythonTree, ModuleName, ImportSource) data Declaration = LocalVar {declarationName :: String} | Dereference {declarationName :: String} | FunctionDec {declarationName :: String} | ClassDec {d...
dsj36/beekeeper
src/Beekeeper/Core/Declaration.hs
bsd-3-clause
833
0
8
290
153
97
56
15
0
module Render (render_world, load_tiles) where import World import qualified Data.Map.Strict as Map import Graphics.Gloss import Data.Maybe import Data.Ratio load_tiles :: FilePath -> IO (Map.Map Tile Picture) load_tiles p = ((sequenceA . map sequenceA) (fmap (\x -> (fst x, loadBMP (toFileName x))) ...
coddinkn/sns
app/Render.hs
bsd-3-clause
1,832
0
15
420
992
536
456
37
2
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ViewPatterns #-} module Stack.Setup.Installed ( getCompilerVersion , markInstalled , unmarkInstalled , listInstalled , Tool (..) , toolString , toolNameString , parseToolTex...
meiersi-11ce/stack
src/Stack/Setup/Installed.hs
bsd-3-clause
6,288
0
19
1,850
1,777
924
853
145
5
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Stack.Options (BuildCommand(..) ,GlobalOptsContext(..) ,benchOptsParser ,buildOptsParser ,cleanOptsParser ,configCmdSetParser ,configOptsParser ,dockerOptsParser ,dockerCleanupOptsParser ,dotOptsParser ...
AndrewRademacher/stack
src/Stack/Options.hs
bsd-3-clause
38,497
0
33
14,560
6,649
3,317
3,332
890
9
module LA ( module LA.Instances , module LA.Algebra , module LA.Epsilon , (~=) )where import qualified LA.Instances import LA.Epsilon import LA.Algebra (~=) :: (Additive a, Epsilon a) => a -> a -> Bool (~=) a b = closeToZero $ (a .- b)
chalmers-kandidat14/LA
LA.hs
bsd-3-clause
285
0
7
91
98
60
38
9
1
{-| FGL To Dot is an automatic translation and labeling of FGL graphs (see the 'Graph' class) to graphviz Dot format that can be written out to a file and displayed. @ let dot = showDot (fglToDot graph) writeFile \"file.dot\" dot system(\"dot -Tpng -ofile.png file.dot\") @ -} module Data.Graph...
TomMD/fgl-visualize
Data/Graph/Inductive/Dot.hs
bsd-3-clause
1,609
0
15
310
423
224
199
18
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecursiveDo #-} {-# LANGUAGE TemplateHaskell #-} module Main where import Control.Lens import Control.Monad import Control.Monad.IO.Class (liftIO) import qualified Control.Exception as E impor...
Lemmih/fvg
site/Main.hs
bsd-3-clause
4,954
0
17
1,576
1,081
558
523
102
2
----------------------------------------------------------------------------- -- | -- Module : Data.Pass.Trans -- Copyright : (C) 2012-2013 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com> -- Stability : experimental -- Portability : non-p...
ekmett/multipass
Data/Pass/Trans.hs
bsd-3-clause
645
0
9
105
94
57
37
7
0
module Graphics.UI.SDL.Event ( -- * Event Handling addEventWatch, delEventWatch, eventState, filterEvents, flushEvent, flushEvents, getEventFilter, getNumTouchDevices, getNumTouchFingers, getTouchDevice, getTouchFinger, hasEvent, hasEvents, loadDollarTemplates, peepEvents, pollEvent, pumpEvents, push...
ekmett/sdl2
Graphics/UI/SDL/Event.hs
bsd-3-clause
13,572
198
12
1,640
3,132
1,647
1,485
244
1
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DeriveDataTypeable #-} #if __GLASGOW_HASKELL__ >= 707 {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE KindSignatur...
bennofs/dynamic-cabal
src/Distribution/Client/Dynamic/Query.hs
bsd-3-clause
8,426
0
21
1,807
2,356
1,200
1,156
142
2
module B.Shake.Core.Action ( Action , apply , apply1 , actionOnException , actionFinally ) where import B.Shake.Core.Action.Internal (Action(..)) import B.Shake.Core.Rule.Internal (Rule, RuleKey(..)) import qualified B.Build as B apply :: (Rule key value) => [key] -> Action [value] apply keys = Action $...
strager/b-shake
B/Shake/Core/Action.hs
bsd-3-clause
700
0
8
120
234
130
104
18
1
{-# LANGUAGE OverloadedStrings #-} module Test.Indices where import Test.Common import Test.Import import qualified Data.List as L import qualified Data.List.NonEmpty as NE import qualified Data.Map as M spec :: Spec spec = do describe "Index create/delete API" $ do it "creates and then deletes the requested i...
bitemyapp/bloodhound
tests/Test/Indices.hs
bsd-3-clause
7,889
0
25
2,498
1,851
891
960
157
3
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE IncoherentInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UndecidableInstances #-} module FPNLA.Utils ( iif, mapPair, splitSlice, prevEnum, nextEnum, enumerate, ) where mapPair :: (a -> b) -> (c -> d)-> (a, c) -> (b, d) mapP...
mauroblanco/fpnla-examples
src/FPNLA/Utils.hs
bsd-3-clause
1,242
0
8
296
413
224
189
28
2
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-} module Development.Shake.Binary( BinaryWith(..), module Data.Binary ) where import Control.Monad import Data.Binary class BinaryWith ctx a where putWith :: ctx -> a -> Put getWith :: ctx -> Get a instance (BinaryWith ctx a, BinaryWith ctx b) ...
nh2/shake
Development/Shake/Binary.hs
bsd-3-clause
899
0
10
201
371
186
185
18
0
{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE...
achirkin/easytensor
easytensor/src/Numeric/PrimBytes.hs
bsd-3-clause
76,161
0
18
20,096
20,278
10,332
9,946
1,432
2
{- | This modules defines `Builder`s, which are simple parsers on `Integer`. -} module Scat.Builder ( -- * Type Builder -- * Execution , runBuilder , evalBuilder , execBuilder -- * Primitives -- ** Numbers , lessThan , inRange -- ** Char , digit , lett...
rnhmjoj/scat
src/Scat/Builder.hs
bsd-3-clause
3,165
0
12
810
1,003
541
462
76
2
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell data TokenType = Foo | Char [lq| bar :: Char |] bar :: Char bar = undefined
spinda/liquidhaskell
tests/gsoc15/unknown/pos/TokenType.hs
bsd-3-clause
134
0
5
31
32
20
12
6
1
module Main where import Test.Tasty import Test.Tasty.HUnit -- import Test.Tasty.Runners.AntXML -- For cabal builds on Jenkins import Control.Applicative import Control.Monad.IO.Class import Prosper import Prosper.Monad import Prosper.MarketDataUser noteTestGroup :: ProsperState -> TestTree noteTestGroup ps = testG...
WraithM/notescript
test/RunTests.hs
bsd-3-clause
740
0
10
141
195
103
92
21
1
module Text.XML.SpreadsheetML.Builder where import Text.XML.SpreadsheetML.Types -- | Construct empty values emptyWorkbook :: Workbook emptyWorkbook = Workbook Nothing Nothing [] emptyDocumentProperties :: DocumentProperties emptyDocumentProperties = DocumentProperties Nothing Nothing Nothing Nothing Nothing Nothin...
dagit/SpreadsheetML
src/Text/XML/SpreadsheetML/Builder.hs
bsd-3-clause
2,010
0
9
349
603
322
281
45
1
{-# LANGUAGE Arrows #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Main where import Data.Aeson import Data.Profunctor.Product import Data.Profunctor.Pro...
meditans/haskell-webapps
doc/docs/opaleye/code/opaleye-tenants-and-products.hs
mit
11,687
0
11
2,399
2,640
1,437
1,203
248
1
-- Copyright (c) Microsoft. All rights reserved. -- Licensed under the MIT license. See LICENSE file in the project root for full license information. {-# LANGUAGE DeriveDataTypeable #-} {-# OPTIONS_GHC -fno-warn-missing-fields #-} {-# OPTIONS_GHC -fno-cse #-} module Options ( getOptions , processOptions ...
gencer/bond
compiler/Options.hs
mit
6,426
0
14
1,583
1,328
732
596
126
1
module BasicIO (tests) where import Test.Hspec (Spec, describe, it) import Test.HUnit (assertBool, assertEqual) tests :: Spec tests = describe "BasicIO" $ do testReadingChar testReadingLine failIO :: String -> IO a failIO fnName = fail $ "\n\n\t\x1B[32;1mCheck documentation\x1B[0m of \x1B[33;1m" ...
HaskVan/HaskellKoans
test/BasicIO.hs
mit
947
0
9
231
179
91
88
27
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE NoMonomorphismRestriction #-} module TAC.Data where import Autolib.Reader import Autolib.ToDoc import Autolib.FiniteMap import Autolib.Util.Zufall type Program = [ Statement ] data Statement = Constant Int Int | Add Int Int Int | Mul Int Int Int deri...
florianpilz/autotool
src/TAC/Data.hs
gpl-2.0
2,210
7
15
681
1,001
494
507
68
3
{-# 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 #-} -- ...
olorin/amazonka
amazonka-redshift/gen/Network/AWS/Redshift/DeleteHSMConfiguration.hs
mpl-2.0
3,565
0
9
659
365
224
141
55
1
module Hailstorm.Logging ( initializeLogging ) where import System.IO import System.Log.Formatter import System.Log.Logger import System.Log.Handler (setFormatter) import System.Log.Handler.Simple initializeLogging :: IO () initializeLogging = do hdlr <- streamHandler stderr INFO let fmtr = simpleLogFormatter...
hailstorm-hs/hailstorm
src/Hailstorm/Logging.hs
apache-2.0
449
0
10
68
113
60
53
13
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE DeriveFunctor #-} ----------------------------------------------------------------------------- -- | -- Module : Text.ParserCombinators.ReadP -- Copyright : (c) The University of...
sdiehl/ghc
libraries/base/Text/ParserCombinators/ReadP.hs
bsd-3-clause
14,956
1
17
3,998
3,905
2,018
1,887
223
6
-- Copyright (c) 2014 Eric McCorkle. All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions -- are met: -- -- 1. Redistributions of source code must retain the above copyright -- notice, this list of conditi...
saltlang/compiler-toolbox
test/Tests/Text.hs
bsd-3-clause
1,713
0
7
289
74
58
16
5
1
--------------------------------------------------------- -- The main program for the hpc-markup tool, part of HPC. -- Andy Gill and Colin Runciman, June 2006 --------------------------------------------------------- module HpcMarkup (markup_plugin) where import Trace.Hpc.Mix import Trace.Hpc.Tix import Trace.Hpc.Uti...
mcmaniac/ghc
utils/hpc/HpcMarkup.hs
bsd-3-clause
18,210
0
52
5,952
4,677
2,458
2,219
369
16
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Install -- Copyright : Isaac Jones 2003-2004 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This is the entry point into installing a built pa...
bennofs/cabal
Cabal/Distribution/Simple/Install.hs
bsd-3-clause
11,550
0
16
2,732
2,179
1,119
1,060
166
14
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 Pattern-matching constructors -} {-# LANGUAGE CPP #-} {-# LANGUAGE TypeFamilies #-} module MatchCon ( matchConFamily, matchPatSyn ) where #include "HsVersions.h" import GhcPrelude import {-# SOURCE #-} Match ( mat...
ezyang/ghc
compiler/deSugar/MatchCon.hs
bsd-3-clause
11,069
0
20
3,096
1,781
939
842
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} module Stack.Options.ConfigParser where import Data.Char import qualified Data.Set as Set import Options.Applicative import Options.Applicative.Builder.Extra import Path import Stack.Constants import ...
MichielDerhaeg/stack
src/Stack/Options/ConfigParser.hs
bsd-3-clause
6,219
0
38
1,977
1,039
542
497
135
3
-- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apache License, Version 2.0 (the -- "License"); you ma...
xJom/mbunit-v3
tools/Thrift/src/lib/hs/src/Thrift/Protocol/Binary.hs
apache-2.0
4,800
0
14
1,253
1,640
826
814
-1
-1
import Control.Monad (unless) import Test.HUnit import Metrics assertAlmostEqual :: String -> Double -> Double -> Double -> Assertion assertAlmostEqual preface delta expected actual = unless (abs (expected - actual) < delta) (assertFailure msg) where msg = (if null preface then "" else preface ++ "\n") ++ ...
AaronRanAn/Metrics
Haskell/testMetrics.hs
bsd-2-clause
7,274
0
14
2,891
2,888
1,615
1,273
98
2
module Expression.Type where import Context.Type import Way.Type import Builder import qualified Hadrian.Expression as H -- | @Expr a@ is a computation that produces a value of type @Action a@ and can -- read parameters of the current build 'Target'. type Expr a = H.Expr Context Builder a -- | The following express...
snowleopard/hadrian
src/Expression/Type.hs
mit
579
0
6
107
86
53
33
9
0
module Main where import P main = print p
themoritz/cabal
cabal-testsuite/PackageTests/NewBuild/T3827/q/Main.hs
bsd-3-clause
42
0
5
9
15
9
6
3
1
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-} -- Trac #2494, should compile ok module Foo where foo :: (forall m. Monad m => Maybe (m a) -> Maybe (m a)) -> Maybe a -> Maybe a {-# NOINLINE [1] foo #-} foo _ x = x {-# RULES "foo/foo" forall (f :: forall m. Monad m => Maybe (m a) -> Maybe (m a)) (g :: f...
ghc-android/ghc
testsuite/tests/typecheck/should_compile/T2494-2.hs
bsd-3-clause
410
0
12
108
74
39
35
10
1
module Control.Disruptor.SequenceBarrier where import Control.Disruptor.Sequence import qualified Data.Foldable as F import Data.IORef -- TODO figure out if we need this at all data AlertException = AlertException alertException = AlertException data WaitResult = Alert AlertException ...
iand675/disruptor
src/Control/Disruptor/SequenceBarrier.hs
mit
648
0
14
156
147
85
62
15
1
import Control.Monad import qualified Data.Vector as V readNumbers :: String -> [Int] readNumbers = map read . words readInput [a, b] = (a, b) minVehicle lanes (i, j) = V.minimum s where s = V.slice i (j - i + 1) lanes main :: IO () main = do input <- getLine let (n, t) = readInput (readNumbers ...
mgrebenets/hackerrank
alg/warmup/service-lane.hs
mit
592
0
12
153
243
123
120
17
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Shiva.HTML ( -- * Pages feedPage, mainPage, articlePage, errorPage, -- * Helpers htmlFromEither ) where import Shiva.Config (Source (..), titleCode) import Shiva.Feeds import Shiva...
BlackBrane/shiva
src/Shiva/HTML.hs
mit
3,335
0
17
1,021
1,093
524
569
92
1
module TestBallots ( tests ) where -- local imports import Control.Consensus.Paxos import Control.Consensus.Paxos.Protocol.Courier import Control.Consensus.Paxos.Storage.Memory import Network.Transport.Memory import SimpleDecree -- external imports import Control.Concurrent import Control.Concurrent.Async impo...
hargettp/paxos
tests/TestBallots.hs
mit
4,225
0
20
974
1,255
622
633
105
2
-- 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. -- What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? -- smallest positive number that is evenly divisible by all of the numbers from 1 to n -- lcm [1 to n] lcm...
sravan-s/euler
euler-0005/smallestMultiple.hs
mit
441
0
7
96
70
39
31
5
1
module Nix.Spec.OperatorsSpec (main, spec) where import Nix.Common import Nix.Atoms import Nix.Eval import Nix.Expr import Nix.Evaluator import Nix.Spec.Lib import Nix.Values import Nix.Values.NativeConversion import Test.Hspec import Test.QuickCheck main :: IO () main = hspec spec spec :: Spec spec = do divisionS...
adnelson/nix-eval
tests/Nix/Spec/OperatorsSpec.hs
mit
3,700
0
21
913
1,367
665
702
88
2
module Gaia.UserPreferences ( getXCacheRoot, getFSRootsListingFilePath ) where import Gaia.Types import System.Directory as Dir import System.Environment (getEnv) import System.FilePath (normalise, (</>)) import System.IO.Error (catchIOError, isDoesNotExistErro...
shtukas/Gaia
src/Gaia/UserPreferences.hs
mit
1,026
0
9
176
225
121
104
22
2
{-# OPTIONS_GHC -F -pgmF htfpp #-} module Compiler.Test (htf_thisModulesTests) where import Test.Framework import Test.HUnit (Assertion) import Compiler import Types {- compilerTest :: [Declaration] -> [Deployment] -> Assertion compilerTest dc dp = assertEqual dp $ compile...
plietar/super-user-spark
test/Compiler/Test.hs
mit
1,263
0
5
245
34
22
12
6
0
import qualified Data.List as List compartments = 4 main = do weights <- map read <$> lines <$> getContents let capacity = sum weights `div` compartments let compartments = filter ((== capacity) . sum) $ distribute weights let passengerCompartmentPackageCount = minimum $ map length compartments let passenge...
SamirTalwar/advent-of-code
2015/AOC_24_2.hs
mit
910
0
14
155
337
172
165
17
1
module Hello ( sayHello ) where sayHello :: String -> IO () sayHello name = do putStrLn ("Hi " ++ name ++ "!")
brodyberg/Notes
hello/src/Hello.hs
mit
119
0
10
31
48
25
23
5
1
{-# LANGUAGE GeneralizedNewtypeDeriving , DeriveGeneric , DeriveDataTypeable , OverloadedStrings #-} module Veva.Types.Status ( Status(..) , Id(..) , Author(..) , Content(..) ) where import Data.JSON.Schema import Data.UUID.Aeson () import Hasql.Postgres (Postgres) import Hasq...
L8D/veva
lib/Veva/Types/Status.hs
mit
2,201
0
13
657
657
373
284
65
0
module FieldMarshal.Cpp where import Data.List data Name = Name [String] String deriving Eq instance Show Name where show (Name namespaces name) = concat $ intersperse "::" $ namespaces ++ [name] data Pointer = Pointer Name | NestedPointer Pointer | PointerToConst Const deriving Eq instance Show Pointer w...
scott-fleischman/field-marshal
FieldMarshal.Cpp.hs
mit
2,700
0
13
520
923
469
454
67
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Language.Dash.IR.Data ( Constant (..) , ConstTable , SymbolNameList , Reg , mkReg , regToInt , SymId , mkSymId , symIdToInt , FuncAddr , mkFuncAddr , funcAddrToInt , ConstAddr , mkConstAddr , constAddrToInt , HeapAddr , mkHeapAddr , heapAddrToInt , Name ) where imp...
arne-schroppe/dash
src/Language/Dash/IR/Data.hs
mit
2,036
0
10
427
607
341
266
78
1
module Y2020.M08.D28.Exercise where {-- Clean words. Today let's make those words clean. What words, you ask? Welp, one answer is: "alles o' dems wordz!" so, ... yeah: that. Yesterday, we found we have some weird words in a document we were scanning, and, also, we found the weird characters in those weird words. So....
geophf/1HaskellADay
exercises/HAD/Y2020/M08/D28/Exercise.hs
mit
4,111
0
7
671
279
162
117
-1
-1
-------------------------------------------------------------------------- -- Copyright (c) 2007-2010, ETH Zurich. -- All rights reserved. -- -- This file is distributed under the terms in the attached LICENSE file. -- If you do not find this file, copies can be found by writing to: -- ETH Zurich D-INFK, Haldeneggsteig...
modeswitch/barrelfish
hake/X86_64.hs
mit
5,581
4
17
2,191
782
445
337
99
1
module HaskSplit.Algorithm ( encode , decode ) where import System.Random import FiniteField.PGF256 import FiniteField.GF256 import HaskSplit.Util import Prelude hiding ((/)) encode :: [GF256Elm] -> Int -> StdGen -> GF256Elm -> [GF256Elm] encode xs degree g d = let poly = d:(generateCoef...
jtcwang/HaskSplit
src/lib/HaskSplit/Algorithm.hs
mit
1,545
0
14
508
550
298
252
35
2
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE BangPatterns #-} module Control.Workflow.Language.TH (build) where import Control.Arrow.Free (mapA, effect) import Control.Arrow (arr, (>>>)) import qualified Data.Text a...
kaizhang/SciFlow
SciFlow/src/Control/Workflow/Language/TH.hs
mit
7,915
0
27
2,788
2,570
1,372
1,198
153
6
sumsqreven = compose [sum, map (^ 2), filter even] compose :: [a -> a] -> (a -> a) compose = foldr (.) id
AlexMckey/FP101x-ItFP_Haskell
Sources/sumsqreven.hs
cc0-1.0
106
0
8
23
63
35
28
3
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} ----------------------------------------------------------------------------- -...
573/leksah
src/IDE/Pane/Modules.hs
gpl-2.0
64,688
0
33
23,344
17,329
8,586
8,743
1,227
12
module Computability.FiniteStateAutomata.Macro where import Types import Macro.MetaMacro import Macro.Tuple -- * Automata -- ** NFSA -- | NFSA definition nfsa :: Note -- ^ Set of states -> Note -- ^ Alphabet -> Note -- ^ Transition function -> Note -- ^ Set of acceptin...
NorfairKing/the-notes
src/Computability/FiniteStateAutomata/Macro.hs
gpl-2.0
695
0
9
186
118
75
43
21
1