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 NES.ROM ( ROM(..) , NESHeader(..) , loadROM ) where import Data.Word (Word8) import qualified Data.ByteString as B {- iNES file format: http://wiki.nesdev.com/w/index.php/INES An iNES file consists of the following sections, in order: 1. Header (16 bytes) 2...
ksaveljev/hNES
NES/ROM.hs
mit
2,403
0
11
1,039
423
242
181
34
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module EngineSpec where import Control.Applicative import Control.Monad import Control.Monad.State import qualified Data.Map as M import Test.Hspec import Cache import Engine import qualified FactorTable as FT spec :: Spec spec = do describe "getFactorTable" $ do it ...
mg50avant/factorizer
test/EngineSpec.hs
mit
1,718
0
19
526
462
240
222
38
1
module Haskakafka ( fetchBrokerMetadata , withKafkaConsumer , consumeMessage , consumeMessageBatch , withKafkaProducer , produceMessage , produceKeyedMessage , produceMessageBatch , storeOffset , getAllMetadata , getTopicMetadata -- Internal objects , IS.newKafka , IS.newKafkaTopic , IS.dumpConfFromKafka , IS.dumpCon...
donatello/haskakafka
src/Haskakafka.hs
mit
20,674
2
21
4,970
4,113
2,115
1,998
339
5
module Graphics.Urho3D.UI.Internal.Slider( Slider , sliderCntx , sharedSliderPtrCntx , SharedSlider ) where import qualified Language.C.Inline as C import qualified Language.C.Inline.Context as C import qualified Language.C.Types as C import Graphics.Urho3D.Container.Ptr import qualified Data.Map as Map d...
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/UI/Internal/Slider.hs
mit
492
0
11
87
120
80
40
-1
-1
{-# LANGUAGE OverloadedStrings,BangPatterns, MultiWayIf #-} module Main where import Control.Monad import Control.Applicative import Control.Concurrent import Control.Concurrent.MVar import Control.Concurrent.Chan import Control.Exception import Data.Monoid import System.Random import System.Environment import quali...
EXio4/hsrelay
src/Main.hs
mit
7,813
9
28
3,074
2,295
1,140
1,155
174
8
{-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} import Control.Monad (unless) import Control.Monad.IO.Class (liftIO) impor...
W8UPD/door
doorcgi/Main.hs
gpl-2.0
3,421
0
27
861
1,021
502
519
80
5
{-# LANGUAGE TemplateHaskell #-} import System.Random import Numeric.LinearAlgebra import Numeric.LinearAlgebra.HMatrix import Control.Lens hiding ((<.>), (??)) import Data.Default import Data.List.Split ---------- data Config = Config { _epsilonInit :: R , _learningRate :: R ...
artuuge/regression-classification
linear/linear.hs
gpl-2.0
3,548
0
15
921
1,371
690
681
88
1
{-# LANGUAGE DeriveDataTypeable, RankNTypes #-} import Data.Data (Data, gmapM) import Data.Typeable (Typeable) import Data.Generics (mkQ, mkM, GenericQ, GenericM) data D = A Int | B D D deriving (Show, Data, Typeable) trav :: D -> IO D trav o = print o >> return o exclude :: D -> Bool exclude (B _ _) = True ...
copton/ocram
try/syb/Recurse.hs
gpl-2.0
627
0
10
153
307
154
153
21
1
{-# LANGUAGE NoImplicitPrelude, GADTs , DataKinds, TypeFamilies, TypeOperators, RankNTypes, DeriveFunctor #-} module Singletons where import Prelude hiding (drop, take, head, tail, index, zipWith, replicate, map, (++)) data Vec a n where VNil :: Vec a Zero VCons :: a -> Vec a n -> Vec a (Succ n) -- promoted to ...
KenetJervet/mapensee
haskell/problems/Singleton.hs
gpl-3.0
2,323
6
10
559
1,175
622
553
53
1
-- License: GPL v2 or later module Clock (millisecondsNow) where import Data.Word (Word32) import System.Clock millisecondsNow :: IO Word32 millisecondsNow = fmap timeSpecToMilliseconds (getTime Monotonic) timeSpecToMilliseconds :: (Integral i) => TimeSpec -> i -- We place these fromIntegrals being cautious about no...
idupree/Pollutocracy
Clock.hs
gpl-3.0
526
0
10
99
112
62
50
8
1
{-# LANGUAGE OverloadedStrings #-} ------------------------------------------------------------------------------- -- | -- Module : OpenSandbox.Protocol -- Copyright : (c) 2016 Michael Carpenter -- License : GPL3 -- Maintainer : Michael Carpenter <oldmanmike.dev@gmail.com> -- Stability : experimental...
oldmanmike/opensandbox
src/OpenSandbox/Protocol.hs
gpl-3.0
1,972
0
14
303
442
251
191
38
4
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} module Lib where import Control.Monad.Reader import Data.Aeson import qualified Data.Text as T import Data.Time import GHC.Generics import System.IO server :: Strin...
Arguggi/irc-log
lib/src/Lib.hs
gpl-3.0
1,228
0
9
394
278
164
114
46
1
{-# LANGUAGE CPP, StandaloneDeriving, GeneralizedNewtypeDeriving #-} {-# OPTIONS -fno-warn-orphans #-} module Data.Monoid.Instances () where import Data.Binary (Binary) import Data.Monoid (Any(..)) #if !MIN_VERSION_deepseq(1,4,0) import Control.DeepSeq (NFData) deriving instance NFData Any #endif deriving instance ...
rvion/lamdu
bottlelib/Data/Monoid/Instances.hs
gpl-3.0
331
0
6
38
64
40
24
8
0
{-# LANGUAGE ViewPatterns #-} module Utils.Generation where import Prelude hiding (null) import Data.ByteString.Lazy import Data.Maybe import Control.DeepSeq import Control.Monad import System.Random (randomIO) import Test.QuickCheck.Random (mkQCGen) import Test.QuickCheck.Gen import Test.QuickFuzz.Gen.FormatInfo ...
elopez/QuickFuzz
app/Utils/Generation.hs
gpl-3.0
2,353
15
19
653
663
345
318
49
5
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Slides.Types.Sum -- Copyright : (c) 2015-2016 Brendan ...
rueshyna/gogol
gogol-slides/gen/Network/Google/Slides/Types/Sum.hs
mpl-2.0
132,065
0
11
32,323
14,473
7,953
6,520
1,904
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-logging/gen/Network/Google/Resource/Logging/Organizations/Locations/Buckets/Patch.hs
mpl-2.0
7,518
0
17
1,481
882
523
359
127
1
{-# LANGUAGE ExistentialQuantification #-} module Lib ( ThreadSafeList(..) , ListType(..) , allTypes , newEmptyList , fromList , add , remove , toPureList , contains ) where import Data.Foldable import qualified ThreadSafeList as TSL import qualified CoarseGrained as CG import...
paulolieuthier/haskell-concurrent-lists
src/Lib.hs
lgpl-2.1
1,715
0
10
334
541
292
249
50
1
-- this is a haskell sample client for Terraforming import Control.Applicative import Control.Arrow import Control.Monad import System.IO -- entity definitions type Point = (Int, Int) -- x * y data Tile = Tile { playerId :: Int , robotsNumber :: Int , resourcesNumber :: Int ...
AI-comp/Terraforming
SampleAI/Haskell/Main.hs
apache-2.0
1,764
0
12
559
642
359
283
45
2
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} module Main where impo...
anchor/rest-postgresql-generic
tests/RoundtripTest.hs
bsd-2-clause
6,412
0
17
1,496
2,158
1,143
1,015
158
1
module MultiIndex ( tests ) where import Distribution.TestSuite.QuickCheck import Prelude.Unicode import Data.MultiIndex tests ∷ IO [Test] tests = return [toListTest, fromListTest] toListTest ∷ Test toListTest = testGroup "toList" [ testProperty "" (toList Nil ≡ ([] ...
tensor5/tensor
tests/MultiIndex.hs
bsd-3-clause
946
0
14
277
358
199
159
-1
-1
{- Joel Svensson 2012 -} module Intel.ArBB.Util.Image ( loadBMP_RGB , loadRAW_RGB , loadRAW_Gray , saveBMP_Gray , saveBMP_RGB , saveRAW_Gray ...
svenssonjoel/EmbArBB
Intel/ArBB/Util/Image.hs
bsd-3-clause
5,949
0
15
1,946
1,886
964
922
127
2
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[TcMonoType]{Typechecking user-specified @MonoTypes@} -} {-# LANGUAGE CPP, TupleSections, MultiWayIf #-} module TcHsType ( -- Type signatures kcHsSigType, tcClassSigType, tcHsSigType, tcHsS...
snoyberg/ghc
compiler/typecheck/TcHsType.hs
bsd-3-clause
90,841
150
37
26,003
13,534
7,214
6,320
1,028
7
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE...
rolph-recto/liquid-fixpoint
src/Language/Fixpoint/Types/Refinements.hs
bsd-3-clause
21,677
0
16
6,438
6,635
3,431
3,204
559
8
{-# LANGUAGE EmptyDataDecls, TypeSynonymInstances #-} {-# OPTIONS_GHC -fcontext-stack41 #-} module Games.Chaos2010.Database.Base_relvars where import Games.Chaos2010.Database.Fields import Database.HaskellDB.DBLayout type Base_relvars = Record (HCons (LVPair Relvar_name (Expr (Maybe String))) HNil) base_relva...
JakeWheat/Chaos-2010
Games/Chaos2010/Database/Base_relvars.hs
bsd-3-clause
384
0
13
44
76
44
32
9
1
{-# LANGUAGE FlexibleContexts, GADTs, RankNTypes, ScopedTypeVariables #-} -- | Internal helpers for taking asynchronous machine steps. module Data.Machine.Concurrent.AsyncStep where import Control.Concurrent.Async.Lifted (Async, async, wait) import Control.Monad.Trans.Control (MonadBaseControl, StM) import Data.Machine...
acowley/concurrent-machines
src/Data/Machine/Concurrent/AsyncStep.hs
bsd-3-clause
2,520
0
16
670
740
384
356
38
3
{-# LANGUAGE MagicHash #-} {-# LANGUAGE TypeInType #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UnboxedTuples #-} {-# LANGUAGE BangPatterns #-} module Offheap.GetBS ( GetBS (..) , runByteString , getPrim , getInt16Host , getInt32Host , getInt64Host , getByteString ...
schernichkin/BSPM
offheap/src/Offheap/GetBS.hs
bsd-3-clause
4,552
0
15
1,102
1,215
653
562
-1
-1
{-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-partial-type-signatures #-} {-# LANGUAGE CPP #-} -- #define DEBUG {-| Experimenting with programming in CIDR shallow embedding in Haskell/AERN2. CIDR is an experimental core language for exact real computation brief...
michalkonecny/aern2
aern2-real/attic/CIDR.hs
bsd-3-clause
7,757
1
16
1,584
2,129
1,111
1,018
-1
-1
{- | Copyright : Galois, Inc. 2012-2015 License : BSD3 Maintainer : jhendrix@galois.com Stability : experimental Portability : non-portable (language extensions) -} module Tests.Parser where import Control.Applicative import Control.Lens import Control.Monad.Identity import Data.Bits import Text.PrettyPrint....
iblumenfeld/saw-core
tests/src/Tests/Parser.hs
bsd-3-clause
1,699
0
21
340
519
266
253
38
1
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC-fno-warn-unused-imports#-} module Restsig.Client.Stocks where import Rest.Client.Internal import qualified Rest.Types.Void import qualified Type.Stock.Internal type Identifier = String readId :: Identifier -> [String] readId x = ["code", showUrl x] byCode :: ...
cutsea110/sig
client/src/Restsig/Client/Stocks.hs
bsd-3-clause
725
0
12
182
184
107
77
22
1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[Name]{@Name@: to transmit name info from renamer to typechecker} -} {-# LANGUAGE RecordWildCards #-} -- | -- #name_types# -- GHC uses several kinds of name internally: -- -- * 'OccName.OccName': see "OccName#name...
vTurbine/ghc
compiler/basicTypes/Name.hs
bsd-3-clause
26,556
0
16
7,559
4,362
2,348
2,014
320
11
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Web.Mongrel2.Types where import Data.Default import System.ZMQ import qualified Data.Text.Lazy as T data RequestMethod = POST | GET | HEAD | PUT | DELETE instanc...
GunioRobot/web-mongrel2
src/Web/Mongrel2/Types.hs
bsd-3-clause
3,386
0
11
823
639
400
239
84
0
module LookupGitDirs (getGitDirectories, getGits) where import System.FilePath.Find (FindClause, find, fileName, depth, (<=?), (==?), (/~?), (&&?), filePath) import Control.Monad import Data.Maybe (catMaybes) import System.Process (readProcessWithExitCode) import System.Exit (ExitCode(..)) getIgnoredList :: IO [Strin...
steveshogren/gitStats
src/LookupGitDirs.hs
bsd-3-clause
1,413
0
12
193
444
246
198
27
2
{-# language CPP #-} -- No documentation found for Chapter "Promoted_From_VK_KHR_16bit_storage" module Vulkan.Core11.Promoted_From_VK_KHR_16bit_storage ( PhysicalDevice16BitStorageFeatures(..) , StructureType(..) ...
expipiplus1/vulkan
src/Vulkan/Core11/Promoted_From_VK_KHR_16bit_storage.hs
bsd-3-clause
6,819
0
14
1,090
1,167
677
490
-1
-1
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleInstances #-} module Data.EdgeLabeledGraph ( Vertex (..) , Graph , empty , addVertex , removeVertex , removeVertex' , removeVertices , removeVertices' , addEdge , removeEdge , removeEdge' , outEdges , outEdges' , inEdges' ,...
jsnajder/fer3-catalogue
src/Data/EdgeLabeledGraph.hs
bsd-3-clause
6,238
0
17
1,534
3,170
1,678
1,492
145
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE Safe #-} ----------------------------------------------------------------------------- -- | -- Module : Text.Printf -- Copyright : (c) Lennart Augustsson and Bart Massey 2013 -- License : BSD-style (see the file LICENSE in this distribution) -- -- Maintainer : Bart M...
jstolarek/ghc
libraries/base/Text/Printf.hs
bsd-3-clause
30,621
0
23
7,982
6,137
3,411
2,726
417
13
{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE NoImplicitPrelude #-} module CatEye.Type where import qualified MPSUTF8 as MPS import qualified Control.Monad.Error as E import MPSUTF8 hiding (split') import MPS.TH import UTF8Prelude hid...
nfjinjing/cateye
src/CatEye/Type.hs
bsd-3-clause
3,673
63
9
818
1,284
674
610
92
1
{-# LANGUAGE ForeignFunctionInterface, DoAndIfThenElse, CPP #-} ----------------------------------------------------------------------------- -- | -- Licence : BSD-style (see LICENSE) -- -- Windows specific bootstapping and exports. -- Exposes some of the methods of the ICLRRuntimeHost COM interface, which -- can ...
tim-m89/Salsa
Foreign/Salsa/Win/CLRHost.hs
bsd-3-clause
21,927
12
31
4,802
4,145
2,081
2,064
286
3
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MonadComprehensions #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RebindableSyntax #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANG...
ulricha/dsh-example-queries
Queries/TPCH/Standard/Q21.hs
bsd-3-clause
4,225
0
18
1,091
1,345
667
678
118
1
module Websave.Web.App ( run ) where import Websave.Db.Pool (pool) import Websave.Web.AppData (App (..)) import Websave.Web.Dispatch () import Yesod.Core (warp) import Yesod.Static (static) run :: IO () run = do connectionPool <- pool appStatic <- static "static" warp 3000 App { getConnectionPool = con...
dimsmol/websave
src/Websave/Web/App.hs
bsd-3-clause
366
0
9
73
121
70
51
14
1
module Data.JSON ( fromJSON , toJSON , parseJSON , get ) where import Data.Data import Data.ByteString (ByteString) import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as L import qualified Data.HashMap.Strict as H import Data.Text (Text) import Data.At...
sol/json-fu
src/Data/JSON.hs
mit
878
0
9
200
302
172
130
27
2
-- -- -- ----------------- -- Exercise 10.9. ----------------- -- -- -- module E'10''9 where iter :: Integer -- Iterations (number of function applications). -> (t -> t) -- Function (with an arbitrary type). -> t -- Input to the function. -> t -- Result (after itera...
pascal-knodel/haskell-craft
_/links/E'10''9.hs
mit
601
0
8
173
91
56
35
8
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-cloudsearch/gen/Network/AWS/CloudSearch/CreateDomain.hs
mpl-2.0
4,404
0
13
892
557
339
218
70
1
module Openshift.Integer ( ) where
minhdoboi/deprecated-openshift-haskell-api
openshift/scripts/Integer.hs
apache-2.0
36
0
3
6
9
6
3
1
0
{-# OPTIONS_GHC -ddump-types -dsuppress-module-prefixes #-} {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts #-} -- See #1456 -- The key thing here is that foo should get the type -- foo :: forall b s t1. (Zork s (Z [Char]) b) -- => Q s (Z [Char]) t1 -> ST s () -- Note the qua...
sdiehl/ghc
testsuite/tests/typecheck/should_compile/tc231.hs
bsd-3-clause
669
0
9
161
148
83
65
11
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-autoscaling/gen/Network/AWS/AutoScaling/DescribeNotificationConfigurations.hs
mpl-2.0
5,993
0
12
1,172
719
424
295
81
1
{-# LANGUAGE GADTs #-} ----------------------------------------------------------------------------- -- -- Monad for Stg to C-- code generation -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- module StgCmmMonad ( FCode, -- ty...
lukexi/ghc-7.8-arm64
compiler/codeGen/StgCmmMonad.hs
bsd-3-clause
27,300
0
14
7,356
5,342
2,927
2,415
-1
-1
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, DeriveFunctor, TypeSynonymInstances, PatternGuards #-} module Idris.AbsSyntax(module Idris.AbsSyntax, module Idris.AbsSyntaxTree) where import Idris.Core.TT import Idris.Core.Evaluate import Idris.Core.Elaborate hiding (Tactic(..)) import Idris.Core....
raichoo/Idris-dev
src/Idris/AbsSyntax.hs
bsd-3-clause
95,247
8
29
35,472
35,977
17,857
18,120
1,776
49
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Configure -- Copyright : Isaac Jones 2003-2005 -- License : BSD3 ...
Helkafen/cabal
Cabal/Distribution/Simple/Configure.hs
bsd-3-clause
81,953
1
26
26,119
14,106
7,440
6,666
1,195
15
{-# LANGUAGE Safe #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Monad.Zip -- Copyright : (c) Nils Schweinsberg 2011, -- (c) George Giorgidze 2011 -- (c) University Tuebingen 2011 -- License : BSD-style (see the fil...
mpickering/ghc-exactprint
tests/examples/ghc710/Undefined2.hs
bsd-3-clause
1,585
0
10
376
255
148
107
16
0
{-# LANGUAGE CPP, ForeignFunctionInterface #-} module Util.System(tempfile,withTempdir,rmFile,catchIO, isWindows, writeSource, writeSourceText, readSource, setupBundledCC, isATTY) where -- System helper functions. import Control.Exception as CE import Control.Monad (when) import ...
ExNexu/Idris-dev
src/Util/System.hs
bsd-3-clause
3,676
0
14
1,276
873
453
420
57
2
{-# LANGUAGE QuasiQuotes, TypeFamilies, OverloadedStrings #-} {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TemplateHaskell #-} import Yesod.Core import Control.Monad.IO.Class (liftIO) import Network.Wai.Handler.Warp (run) import Data.Text (unpack, pack) import...
ygale/yesod
yesod-core/helloworld.hs
mit
1,646
0
12
296
425
217
208
-1
-1
module Annfail11 where {-# ANN length "Cannot annotate other modules yet" #-} {-# ANN type Integer "Cannot annotate other modules yet" #-}
siddhanathan/ghc
testsuite/tests/annotations/should_fail/annfail11.hs
bsd-3-clause
139
0
2
22
6
5
1
3
0
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.AutocompleteErrorEvent (js_getReason, getReason, AutocompleteErrorEvent, castToAutocompleteErrorEvent, gTypeAutocompleteErrorEvent) where import Prelude ((.), (==), (>>=), return, IO, Int, Fl...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/AutocompleteErrorEvent.hs
mit
1,471
6
11
184
371
235
136
26
1
module PoemLines where firstSen = "Tyger Tyger, burning bright\n" secondSen = "In the forests of the night\n" thirdSen = "What immortal hand or eye\n" fourthSen = "Could frame thy fearful symmetry?" sentences = firstSen ++ secondSen ++ thirdSen ++ fourthSen myLines :: String -> [String] myLines = splitOnChar '\n' ...
ashnikel/haskellbook
ch09/ch09.6_poemLines.hs
mit
825
0
11
202
231
124
107
23
1
module Handler.EditUser where import Import userForm :: RenderMessage App msg => msg -> UserId -> User -> Html -> MForm Handler (FormResult User, Widget) userForm msg userId user extra = do mauth <- lift maybeAuth let ownPage = case mauth of Just (...
bholst/blog
Handler/EditUser.hs
mit
2,031
0
16
578
599
292
307
-1
-1
-- Applicative parser for infix arithmetic expressions without any -- dependency on hackage. Builds an explicit representation of the -- syntax tree to fold over using client-supplied semantics. module Homework.Week05.Parser ( parseExp, -- Use for #2 evalParser, Parser, num, eatSpace, char, eof ) where im...
jxv/cis-194-winter-2016
src/Homework/Week05/Parser.hs
mit
3,835
0
15
1,003
1,163
611
552
72
3
module Befunge93 where import System.Random import qualified Data.Map as M import Data.Char type Code = M.Map (Int, Int) Char -- rng dir position code stack outstr data Inter = Inter StdGen Int (Int, Int) Code [Int] String deriving (Show) xmax :: Int xmax = 80 ymax :: ...
delta4d/codewars
kata/befunge-interpreter/Befunge93.hs
mit
4,921
0
13
1,731
2,539
1,321
1,218
116
36
module Hakyll.Web.Template.Context.Title ( titlerunningField , subtitleField ) where import Hakyll import Data.List.Extra as L import Text.Printf (printf) titlerunningField :: Context String titlerunningField = Context go where go "titlerunning" _ i = do title <- maybe (fail "No title") return =<< g...
wenkokke/sf
hs/Hakyll/Web/Template/Context/Title.hs
mit
1,112
0
14
260
331
166
165
22
3
module Main where import Control.Monad (when, unless) import Data.IORef import Data.Maybe (isNothing, fromJust) import Graphics.Rendering.OpenGL import Graphics.GLUtil import Graphics.UI.GLUT hiding (exit) import Foreign.Marshal.Array (withArray) im...
triplepointfive/hogldev
tutorial16/Tutorial16.hs
mit
7,356
0
18
2,094
1,890
931
959
175
1
{-# LANGUAGE ForeignFunctionInterface, OverloadedStrings #-} {-# LANGUAGE CPP #-} module Network.Wai.Handler.Warp.Recv ( receive , receiveBuf , makeReceiveN , makePlainReceiveN , spell ) where import qualified Control.Exception as E import qualified Data.ByteString as BS import Data.IORef import Foreign...
creichert/wai
warp/Network/Wai/Handler/Warp/Recv.hs
mit
4,196
0
19
1,084
1,215
632
583
90
4
module Calculator.RpnSpec where import SpecHelper import Control.Exception (evaluate) spec :: Spec spec = do describe "solveRPN" $ do context "with text input" $ do it "should do simple add of two numbers" $ do let rpnString = "1 2 +" solveRPN rpnString `shouldBe` 3 it "should do si...
weswilliams/learn-haskell
test/Calculator/RpnSpec.hs
mit
1,236
0
19
353
300
141
159
30
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module FileDB (FileDB(..), Page(..), Mode(..), TemplateName, Params, listPages, makePage, makePreview, getPagesNoContent, makePages, getStaticDirRoutes, defaultFileDB, getTemplate, title, slug, tags, keywords, categories, description, aut...
mayeranalytics/nanoPage
src/FileDB.hs
mit
4,706
0
15
1,710
881
535
346
-1
-1
import Control.Lens import Control.Monad.Loops import Control.Monad.State.Strict import Data.List import Data.List.Split import Data.Maybe data SudokuValue = S1 | S2 | S3 | S4 | S5 | S6 | S7 | S8 | S9 deriving (Eq, Enum) instance Show SudokuValue where show s = show $ fromJust (s `elemIndex` [S1 ..]) + 1 type Matri...
michalc/haskell-experiments
sudoku.hs
mit
2,970
0
12
637
957
527
430
46
3
module Drawhub.KMeans ( Distance, distL1, distL2sq, distLInf, FeatureSelection, Cluster, kmeans, makeCluster, clusterElems ) where import Data.List import Data.Foldable import Data.Function (on) import Data.Maybe import Data.Ord import Data.Vector (Vector) import qualified Data.V...
TurpIF/Drawhub
src/main/Drawhub/KMeans.hs
mit
2,868
0
13
667
1,277
655
622
69
2
-- ex3.3.hs {-# LANGUAGE RecordWildCards #-} import Chapter2 productP :: Num a => [a] -> a productP [] = 1 productP (x:xs) = x * (productP xs) product' :: Num a => [a] -> a product' = foldr (*) 1 getClientName :: ClientR -> String getClientName GovOrgR { .. } = clientRName getClientName CompanyR { .. } = clientRNam...
hnfmr/beginning_haskell
ex3.3.hs
mit
1,031
0
12
295
404
212
192
28
2
-----------------runningOnAndOn-------------------------- main :: IO () main = do return 0 putStrLn "haha, still running" return "halt!" putStrLn "you can't stop me!"
HaskellForCats/HaskellForCats
IO/runningOnAndOn.hs
mit
191
0
7
45
41
17
24
6
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-abortincompletemultipartupload.html module Stratosphere.ResourceProperties.S3BucketAbortIncompleteM...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/S3BucketAbortIncompleteMultipartUpload.hs
mit
1,877
0
13
165
175
101
74
23
1
{-# LANGUAGE DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-} module Partition.Central ( Partition , make_fixed , make_quiz ) where import Challenger.Partial import Inter.Types import Inter.Quiz import Partition.Beispiel import Partition.Roll import Partition.Param import Autolib....
Erdwolf/autotool-bonn
src/Partition/Central.hs
gpl-2.0
3,014
35
13
1,034
887
460
427
74
2
-- Vida.hs -- El juego de la vida -- José A. Alonso Jiménez https://jaalonso.github.com -- ===================================================================== module Tema_13.Vida where -- Descripción del juego de la vida -- + El tablero del juego de la vida es una malla formada por cuadrados -- ("células") que se...
jaalonso/I1M-Cod-Temas
src/Tema_13/Vida.hs
gpl-2.0
5,377
0
11
1,218
986
567
419
56
1
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-} module Lamdu.GUI.ExpressionEdit.InjectEdit ( make ) where import Control.Lens.Operators import qualified Lamdu.GUI.ExpressionEdit.TagEdit as TagEdit import Lamdu.GUI.ExpressionGui (ExpressionGui) import qualified Lamdu.GUI.ExpressionGui ...
da-x/lamdu
Lamdu/GUI/ExpressionEdit/InjectEdit.hs
gpl-3.0
1,800
0
16
385
465
261
204
-1
-1
module Main where import Test.Framework (defaultMain) import TestLongrun (testLongrun) import TestQueue (testQueue) import TestSubprocess (testSubprocess) import TestTimer (testTimer) import TestVariable (testVariable) import TestWait (testWait) main :: IO () main = defaultMain [ testLongrun , testQueue ...
zoranbosnjak/longrun
test/Main.hs
gpl-3.0
393
0
6
75
98
60
38
16
1
-- Logging utilities. module ATP.Util.Log ( module ATP.Util.Log.Class , initialize , stdout , logFileName , readPrio , setLevel , defaultPrio ) where import Prelude hiding (log) import qualified Directory import ATP.Util.Log.Class import qualified IO import qualified System.Log.Handler.Simple as S i...
andre-artus/handbook-of-practical-logic-and-automated-reasoning-haskell
src/ATP/Util/Log.hs
gpl-3.0
2,847
0
14
717
572
297
275
51
4
module Builtin.Hash where import Control.Monad.Except import Control.Monad.State import qualified Data.HashMap.Strict as H import qualified Data.Map as M import qualified Array as A import Data.Foldable import Err import Hash import Object import Object.Graph import String import Builtin.Utils import Context (self, re...
antarestrader/sapphire
Builtin/Hash.hs
gpl-3.0
4,031
0
21
919
1,765
919
846
103
4
module Utils ( newRandFile , logMsg ) where import Network.CGI import System.IO (Handle, hPutStrLn, stderr) import qualified Data.ByteString.Lazy as BS import Data.Digest.Pure.MD5 (md5) import System.Random (randomIO) import Control.Exception (catch,throw) import System.Posix.IO (openFd, fdToHandle, OpenM...
Victorian-Bioinformatics-Consortium/degust
app/backend/Utils.hs
gpl-3.0
1,030
0
15
201
382
210
172
25
3
module Infix (eliminateInfix) where import qualified Data.Map as Map import Common import Infix.Types import Pretty import Syntax import Syntax.Traverse type M = ReaderT (Env Fixity) FM defFixity = Fixity InfixLeft User 100 cmp :: Fixity -> Fixity -> Maybe Ordering cmp (Fixity a1 r1 n1) (Fixity a2 r2 n2) = case c...
ktvoelker/FLang
src/Infix.hs
gpl-3.0
4,391
0
15
1,153
1,717
880
837
-1
-1
-- grid is a game written in Haskell -- Copyright (C) 2018 karamellpelle@hotmail.com -- -- This file is part of grid. -- -- grid 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 Lice...
karamellpelle/grid
designer/source/LevelTools/Do.hs
gpl-3.0
8,559
0
14
3,035
315
181
134
28
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-apps-calendar/gen/Network/Google/Resource/Calendar/Events/Update.hs
mpl-2.0
7,163
0
21
1,648
998
581
417
143
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-run/gen/Network/Google/Resource/Run/Namespaces/Configurations/Get.hs
mpl-2.0
4,849
0
17
1,095
704
411
293
102
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 #-} -- ...
olorin/amazonka
amazonka-iam/gen/Network/AWS/IAM/ListPolicies.hs
mpl-2.0
8,663
0
15
1,854
1,190
712
478
126
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-iam/gen/Network/AWS/IAM/ListUsers.hs
mpl-2.0
6,432
0
14
1,457
994
588
406
110
1
skips :: [a] -> [[a]] skips xs = helper (length xs) xs helper :: Int -> [a] -> [[a]] helper 0 _ = [] helper n xs = fst (splitAt n xs):helper (n-1) xs
spanners/cis194
03-rec-poly/ex1.hs
unlicense
151
0
8
35
109
57
52
5
1
module RandomExample where import System.Random data Die = DieOne | DieTwo | DieThree | DieFour | DieFive | DieSix deriving (Eq, Show) intToDie :: Int -> Die intToDie n = case n of 1 -> DieOne 2 -> DieTwo 3 -> DieThree 4 -> DieFour 5 -> D...
dmvianna/haskellbook
src/Ch23-RandomExample.hs
unlicense
806
0
11
257
241
133
108
26
7
module Main where import Test.Hspec -- import Test.Hspec.QuickCheck (prop) -- import Test.QuickCheck main :: IO () main = hspec $ do it "hello world" $ do True `shouldBe` True
damncabbage/NICTA-Haskell-TTT-Challenge
tests/Tests.hs
apache-2.0
218
0
11
71
49
27
22
6
1
{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE BangPatterns, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-} module Network.Riak.Protocol.GetBucketRequest (GetBucketRequest(..)) where import Prelude ((+), (/)) import qualified Prelude as Prelude' import qualified Data.Typeable as Prelude' im...
bumptech/riak-haskell-client
protobuf/src/Network/Riak/Protocol/GetBucketRequest.hs
apache-2.0
3,157
0
16
588
591
309
282
50
0
{-# LANGUAGE BangPatterns, PatternGuards, DeriveDataTypeable #-} -- | A compact bytestring trie implemented above VCache. module Data.VCache.Trie ( Trie , trie_space , empty, singleton , null, size , lookup, lookup' , prefixKeys , lookupPrefix, lookupPrefix' , lookupPrefixNode, lookupPre...
dmbarbour/vcache-trie
hsrc_lib/Data/VCache/Trie.hs
bsd-2-clause
25,291
286
38
7,653
8,250
4,352
3,898
474
16
module Shader where import Graphics.GL import Control.Monad import Control.Monad.Trans import Foreign import Foreign.C.String import qualified Data.ByteString as BS import qualified Data.Text.Encoding as Text import qualified Data.Text.IO as Text import Linear import Data.Foldable newtype GLProgram = GLPr...
nfjinjing/halive
demo/Shader.hs
bsd-2-clause
4,735
0
24
1,614
1,097
535
562
94
9
module Gfx ( GfxEngine , renderGfx , createGfx , resizeGfx ) where import Lens.Simple ( (^.) ) import Graphics.Rendering.OpenGL import Gfx.Engine ( GfxEngine , createGfxEngine ...
rumblesan/proviz
src/Gfx.hs
bsd-3-clause
3,878
0
14
1,721
702
372
330
-1
-1
{-# LANGUAGE RecordWildCards, ExplicitForAll #-} {-# OPTIONS_GHC -fspec-constr-count=16 #-} module Math.Statistics.WCC(wcc,WCCParams(..),wccMapper) where import Math.Statistics(pearson) import Math.Statistics.WCC.Types -- import Test.QuickCheck(quickCheck) -- import Test.QuickCheck.Property((==>)) wcc,wcc' :: WCCParam...
runebak/wcc
Source/Math/Statistics/WCC.hs
bsd-3-clause
1,665
1
11
334
660
359
301
31
2
{-# LANGUAGE TemplateHaskell, DeriveGeneric, RankNTypes, FlexibleContexts, ScopedTypeVariables #-} module Main where import Control.Distributed.Process.SimpleMap import System.Environment (getArgs) -- complex function to distribute over the network isPrime :: Integer ->Bool isPrime n = and [n `mod` r /= 0 | r <-[2..n...
josejuan/distributed-function
examples/SlowPrimes.hs
bsd-3-clause
836
0
11
133
213
116
97
16
1
module Main where import Data.Monoid import Game.GoreAndAsh import Game.GoreAndAsh.Time import Game.GoreAndAsh.Logging import Game.GoreAndAsh.Network import Game.GoreAndAsh.Network.Backend.TCP import System.Environment -- | Application monad that is used for implementation of game API type AppMonad = NetworkT Spider ...
Teaspot-Studio/gore-and-ash-network
examples/Example01.hs
bsd-3-clause
3,343
0
16
753
1,031
504
527
-1
-1
{-# LANGUAGE UnicodeSyntax #-} import Prelude.Unicode data Tree a = Node a [Tree a] deriving (Eq, Show) tree1 = Node 'a' [] tree2 = Node 'a' [Node 'b' []] tree3 = Node 'a' [Node 'b' [Node 'c' []]] tree4 = Node 'b' [Node 'd' [], Node 'e' []] tree5 = Node 'a' [ Node 'f' [Node 'g' []], ...
m00nlight/99-problems
haskell/p-72.hs
bsd-3-clause
562
0
10
185
266
137
129
16
1
{- Problem 18 Maximum sum in a triangle of numbers Solution idea Reduce the triangle row by row, starting from the bottom. For example, the bottom right corner is the triangle [[31],[04,23]]. If one reaches the 31, the maximizing step is taking 23, 04 is not ...
quchen/HaskellEuler
src/Problem18.hs
bsd-3-clause
2,121
0
9
632
510
331
179
24
1
-- Haskell98! -- | Implementation of the calculus lambda-sr-let -- -- > Polymorphic delimited continuations -- > Asai and Kameyama, APLAS 2007 -- > http://logic.cs.tsukuba.ac.jp/~kam/paper/aplas07.pdf -- > hereafter, AK07 -- -- This embedding of the AK07 calculus into Haskell is another -- proof that AK07 admit type i...
suhailshergill/liboleg
Control/ShiftResetGenuine.hs
bsd-3-clause
3,975
4
15
877
1,010
549
461
46
1
----------------------------------------------------------------------------- -- | -- Module : GHC.LanguageExtensions.Type -- Copyright : (c) The GHC Team -- -- Maintainer : ghc-devs@haskell.org -- Portability : portable -- -- A data type defining the language extensions supported by GHC. -- {-# LANGUAGE De...
sdiehl/ghc
libraries/ghc-boot-th/GHC/LanguageExtensions/Type.hs
bsd-3-clause
4,058
0
6
945
440
300
140
125
0
{-# LANGUAGE BangPatterns #-} {-| Convenience 'Pipe's, analogous to those in "Control.Pipe.List", for 'Pipe's containing text data. -} module Control.Pipe.Text ( -- * Producers produce -- ** Infinite streams , iterate , iterateM , repeat , repeatM -- ** Bounded streams , ...
duairc/pipes
src/Control/Pipe/Text.hs
bsd-3-clause
10,944
0
17
2,288
2,544
1,346
1,198
169
2
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} module Network.HTCondor.Submit.LogParser ( submitLogPipe ) where import Control.Applicative import Control.Monad import Control.Monad.Trans.Resource import Data.ByteString (ByteString) import Data.Conduit import qualified...
alphaHeavy/htcondor
src/Network/HTCondor/Submit/LogParser.hs
bsd-3-clause
2,966
0
21
653
1,044
515
529
77
3
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell main = undefined -- Chris: had to add main to make it typecheck foo :: [Int] -> [Int] foo zs = zipWith (+) zs zs
spinda/liquidhaskell
tests/gsoc15/working/pos/zipW2.hs
bsd-3-clause
168
0
6
36
43
25
18
5
1
module Text.ICalendar.Parser.Validator ( optCompN , reqCompN , optProp1 , reqProp1 , optPropN , reqPropN , reqCoProp1 ) where -- haskell platform libraries import Control.Monad.Identity import Data.Char import Text.Parsec.String import Text.Parsec.Char -- foreign libraries import Text.Parsec.Permutation -- native li...
Jonplussed/iCalendar
src/Text/ICalendar/Parser/Validator.hs
bsd-3-clause
1,127
0
11
195
390
215
175
31
1
{-# LANGUAGE TemplateHaskell, QuasiQuotes #-} module TestA where import Language.C.Simple.CType.Build.TH import Language.C.Simple.CType.Build data TestA = TestA { f0 :: Double, f1 :: Int }
jfischoff/simple-c-type-th
tests/TestA.hs
bsd-3-clause
215
0
8
50
43
30
13
7
0
-- Enter your code here. Read input from STDIN. Print output to STDOUT import Control.Monad (replicateM) import Text.Printf -- type Point = (Double, Double) type Point = (Int, Int) convexHull :: [Point] -> [Point] convexHull ps = fst $ head $ sortSnd [(ps', points2perim ps') | ps' <- subsets ps, length ps' > 2, all (...
capn-freako/Haskell_Misc
HackerRank/convex_hull.hs
bsd-3-clause
3,561
0
14
1,348
1,192
615
577
62
1