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 Test.RSCoin.Local.MessagePackSpec ( spec ) where import Data.MessagePack (MessagePack (..), pack, unpack) import Data.Proxy (Proxy (Proxy)) import Test.Hspec (Spec, describe) import ...
input-output-hk/rscoin-haskell
test/Test/RSCoin/Local/MessagePackSpec.hs
gpl-3.0
1,347
0
13
418
340
190
150
28
1
-- | > ghc -threaded windows.hs && windows.exe -- Plain red screen will appear. module Main where import System.Win32.DLL (getModuleHandle) import Graphics.Win32 import Graphics.Win32.Message import Graphics.Win32.Window import Data.Int import Data.Maybe import Control.Monad import Foreign.C.String import Graphics.EG...
capsjac/opengles
examples/windows.hs
lgpl-3.0
2,889
1
16
740
777
382
395
87
1
-- | ECDSA Signatures module Network.Haskoin.Crypto.ECDSA ( SecretT , Signature(..) , withSource , getEntropy , signMsg , verifySig , genPrvKey , isCanonicalHalfOrder , decodeDerSig , decodeStrictSig ) where import Numeric (showHex) import Control.DeepSeq (NFData, rnf) import Control.Monad (when, unless, guard) impor...
tphyahoo/haskoin
haskoin-core/Network/Haskoin/Crypto/ECDSA.hs
unlicense
4,491
0
17
1,068
1,139
600
539
96
3
module Main where import Test.Framework (defaultMain) -- Util tests import qualified Network.Haskoin.Util.Tests (tests) -- Crypto tests import qualified Network.Haskoin.Crypto.ECDSA.Tests (tests) import qualified Network.Haskoin.Crypto.Base58.Tests (tests) import qualified Network.Haskoin.Crypto.Base58.Units (tests)...
tphyahoo/haskoin
haskoin-core/tests/Main.hs
unlicense
2,408
0
27
264
521
361
160
46
1
{-# LANGUAGE OverloadedStrings #-} module FormEngine.FormContext where import FormEngine.FormElement.FormElement (FormElement) data FormContext = FormContext { allElems :: [FormElement] , validImg :: String , invalidImg :: String , addImg :: String , removeImg :: S...
DataStewardshipPortal/ds-form-engine
FormContext.hs
apache-2.0
337
0
9
99
60
39
21
10
0
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ViewPatterns #-} -- | Expressions in K3. module Language.K3.Core.Expression ( Expression(..), ImperativeExpression(..), Constant(..), Operator(..), Binder(..), An...
yliu120/K3
src/Language/K3/Core/Expression.hs
apache-2.0
14,424
0
18
3,611
4,169
2,210
1,959
338
15
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-} module DecisionProcedure.Opra4 ( module DecisionProcedure.Opra ) where -- standard modules -- local modules import Basics import Calculus.Opra4 import DecisionProcedure import DecisionProcedure.AlgebraicClosure --import DecisionProcedure.AlgebraicGeome...
spatial-reasoning/zeno
src/DecisionProcedure/Opra4.hs
bsd-2-clause
1,035
0
11
211
163
90
73
21
0
{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeOperators #-} module Bug825 where data a :~: b data (:~~:) a b
haskell/haddock
hoogle-test/src/Bug825/Bug825.hs
bsd-2-clause
149
0
4
24
20
16
4
-1
-1
----------------------------------------------------------------------------- -- | -- Module : Application.HXournal.Util.Verbatim -- Copyright : (c) 2011, 2012 Ian-Woo Kim -- -- License : BSD3 -- Maintainer : Ian-Woo Kim <ianwookim@gmail.com> -- Stability : experimental -- Portability : GHC -- module Ap...
wavewave/hxournal
lib/Application/HXournal/Util/Verbatim.hs
bsd-2-clause
724
0
7
209
74
53
21
8
1
{-# LANGUAGE GADTs, TemplateHaskell #-} module Database.Drasil.SystemInformation(SystemInformation(..), Block(..), citeDB, ReferenceDB, citationsFromBibMap, citationDB, rdb, RefMap, simpleMap, conceptDB ) where import Language.Drasil import Theory.Drasil (DataDefinition) import Database.Drasil.ChunkDB (ChunkDB) ...
JacquesCarette/literate-scientific-software
code/drasil-database/Database/Drasil/SystemInformation.hs
bsd-2-clause
4,769
0
11
994
1,395
778
617
-1
-1
module PureFunctionComposition where pureFunctionComponent1 :: Int -> Int pureFunctionComponent1 x = x * x pureFunctionComponent2 :: Int -> Int pureFunctionComponent2 x = x `mod` 5 pureFunctionCompositionPointStyle :: Int -> Int pureFunctionCompositionPointStyle = pureFunctionComponent2 . pureFunctionComponent1 pur...
benkio/ThesisExamples
src/PureFunctionComposition.hs
bsd-3-clause
432
0
7
49
92
50
42
9
1
---------------------------------------------------------------------------- -- -- Module : AssocList.hs -- Copyright : (C) 2000-2002 Joe English. Freely redistributable. -- License : "MIT-style" -- -- Author : Joe English <jenglish@flightlab.com> -- Stability : provisional -- Portability : portable -- -- CVS : $Id:...
pepeiborra/xml-bench
hxml-0.2/AssocList.hs
bsd-3-clause
1,614
4
10
322
443
243
200
20
1
-------------------------------------------------------------------------------- -- | Implementation of Hakyll commands: build, preview... {-# LANGUAGE CPP #-} module Hakyll.Commands ( build , check , clean , preview , rebuild , server , deploy , watch ) where -------------------...
freizl/freizl.github.com-old
src/Hakyll/Commands.hs
bsd-3-clause
4,829
0
11
1,019
774
418
356
59
1
{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts, ConstraintKinds, FlexibleInstances #-} module System.Hermite.Keys ( Keybinding(..) , Runnable(..) , HermiteState(..) , NoState , swap , runKeys , setKey , bindkeys , keyPressed ) where import Control.Monad.IO.Class import Co...
dagle/hermite
src/System/Hermite/Keys.hs
bsd-3-clause
2,305
0
13
597
804
424
380
56
2
-- !!! local aliases module M where import qualified Maybe as M import qualified List as M x = M.length b = M.isJust
FranklinChen/Hugs
tests/static/mod106.hs
bsd-3-clause
119
0
5
25
31
22
9
5
1
module Data.RDF.Graph.MapSP_Test (triplesOf',uniqTriplesOf',empty',mkRdf') where import Data.RDF.Types import Data.RDF.Graph.MapSP (MapSP) import Data.RDF.GraphTestUtils import qualified Data.Map as Map import Control.Monad import Test.QuickCheck instance Arbitrary MapSP where arbitrary = liftM3 mkRdf arbitraryTs ...
jutaro/rdf4h
testsuite/tests/Data/RDF/Graph/MapSP_Test.hs
bsd-3-clause
633
0
10
84
168
99
69
17
1
module LAuREL.Parser (parseLAuREL) where import LAuREL.Types import System.IO import Control.Monad import Control.Applicative ((<$>), (<*), (*>)) import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Expr import Text.ParserCombinators.Parsec.Language import qualified Text.ParserComb...
davbaumgartner/LAuREL
LAuREL/Parser.hs
bsd-3-clause
5,661
1
19
2,203
1,516
788
728
179
2
{-# LANGUAGE GADTs, OverloadedStrings #-} module WebLog where import Control.Monad.Reader import Data.Aeson.Types import Data.Aeson.Encode as E import Data.Aeson.Parser import qualified Data.Attoparsec as A import qualified Data.ByteString.Lazy.Char8 as C import qualified Dat...
wavewave/cmdmanager
src/WebLog.hs
bsd-3-clause
2,210
4
21
629
650
346
304
53
2
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell import Language.Haskell.Liquid.Prelude goo x = let z = [x] in z z0 _ = True z1 _ = False poo (x:_) = True poo ([]) = liquidAssertB False xs = goo (choose 0) prop0 = liquidAssertB True prop1 = liquidAssertB (poo xs)
spinda/liquidhaskell
tests/gsoc15/unknown/pos/meas0a.hs
bsd-3-clause
281
0
9
64
117
61
56
11
1
module Music.Time.Reactive ( -- * Reactive type Reactive, -- * Query initial, final, intermediate, discrete, updates, occs, atTime, -- * Construction -- * Combine switchR, trimR, -- * Split ...
FranklinChen/music-score
src/Music/Time/Reactive.hs
bsd-3-clause
7,512
0
15
2,092
2,020
1,130
890
-1
-1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ViewPatterns #-} module Stack.Setup.Installed ( getCompilerVersion , markInstalled , unmarkInstalled , listInstalled , Tool (..) , toolString , toolNameString , parseToolTex...
rrnewton/stack
src/Stack/Setup/Installed.hs
bsd-3-clause
6,255
0
19
1,840
1,768
919
849
145
5
{-# LANGUAGE KindSignatures, RankNTypes #-} module Data.Sequence.Strategies where import Control.Monad import Control.Parallel.Strategies import qualified Data.Sequence as S import qualified Data.Foldable as F {-# INLINE parSequence #-} parSequence :: forall (t :: * -> *) a. (F.Foldable t, NFData a) => ...
Smurf/Tempoist
src/Data/Sequence/Strategies.hs
bsd-3-clause
457
0
12
113
124
71
53
13
1
module Sexy.Instances.Show.Char () where import Sexy.Classes (Show(..)) import Sexy.Data (Char) import qualified Prelude as P instance Show Char where show = P.show
DanBurton/sexy
src/Sexy/Instances/Show/Char.hs
bsd-3-clause
169
0
6
26
56
36
20
6
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeOperators #-} module UseHaskellAPIClient where import Data.Proxy import Servant.API import ...
EEviston/distro_api
src/UseHaskellAPIClient.hs
bsd-3-clause
1,789
0
9
315
409
217
192
42
1
module Wikirick.Backends.Repository ( module Wikirick.Repository , initRepository , makeRepository ) where import qualified Control.Concurrent.ReadWriteLock as RWL import Control.Monad.CatchIO import qualified Data.Attoparsec as A import qualified Data.ByteString as BS import qualified Data.Char as C import qu...
keitax/wikirick
src/Wikirick/Backends/Repository.hs
bsd-3-clause
4,356
0
21
975
1,355
690
665
-1
-1
----------------------------------------------------------------------------- -- | -- Module : TestSuite.Puzzles.NQueens -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Test suite for Data.SBV.Examples.Puzzles.NQueens --------------...
josefs/sbv
SBVTestSuite/TestSuite/Puzzles/NQueens.hs
bsd-3-clause
1,384
0
12
228
355
204
151
16
1
{-| Module : Parsing Description : Parsing the arguments Copyright : (c) Thomas Lang, 2014 License : BSD-3 Stability : stable Portability : Imports module "CalcStats" and Text.ParserCombinators.Parsec This module parses the command line arguments. As implemented here, if only the filename is passed (no ot...
langthom/stats
Parsing.hs
bsd-3-clause
5,862
10
24
2,046
828
425
403
54
6
module Problem11 where import Data.List (transpose) -- -- Problem 11: Largest product in a grid -- -- In the 20×20 grid below, four numbers along a diagonal line have been marked -- in red. The product of these numbers is 26 × 63 × 78 × 14 = 1788696. -- -- What is the greatest product of four adjacent numbe...
c0deaddict/project-euler
src/Part1/Problem11.hs
bsd-3-clause
2,574
0
17
837
477
264
213
48
2
module Network.Punch.Peer.Types ( Peer (..) , RawPeer , mkRawPeer , fromPeer , toPeer ) where import Control.Monad (when) import Control.Monad.IO.Class (liftIO) import qualified Data.ByteString as B import Network.Socket (Socket, SockAddr, sClose) import qualified Network.Socket.ByteString as B import qual...
overminder/punch-forward
src/Network/Punch/Peer/Types.hs
bsd-3-clause
1,542
0
13
354
534
289
245
-1
-1
{-# LANGUAGE RebindableSyntax #-} -- Copyright : (C) 2009 Corey O'Connor -- License : BSD-style (see the file LICENSE) import Bind.Marshal.Prelude import Bind.Marshal.Verify import Bind.Marshal.SerAction.Base import Bind.Marshal.SerAction.Storable main = run_test $ do returnM () :: Test ()
coreyoconnor/bind-marshal
test/verify_seraction_storable.hs
bsd-3-clause
307
0
9
53
55
33
22
7
1
{-# LANGUAGE LambdaCase, NamedFieldPuns #-} module Game.Ur where import qualified Data.IntSet as IS import Control.Applicative import Control.Monad import Data.Maybe import System.Random ( getStdRandom, randomR ) data Board = Board { black :: Side , white :: Side , dice :: Int , turn :: Turn } deriving ...
taksuyu/game-of-ur
src/Game/Ur.hs
bsd-3-clause
6,048
0
24
2,042
2,167
1,200
967
123
22
-- | -- Module : Data.Ini.Config.Raw -- Copyright : (c) Getty Ritter, 2017 -- License : BSD -- Maintainer : Getty Ritter <config-ini@infinitenegativeutility.com> -- Stability : experimental -- -- __Warning!__ This module is subject to change in the future, and therefore should -- not be relied upon to have a c...
aisamanra/config-ini
src/Data/Ini/Config/Raw.hs
bsd-3-clause
9,591
0
15
2,197
1,811
1,000
811
164
3
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE CPP #-} -------------------------------------------------------------------- -- | -- Copyright : (c) Andreas Reuleaux 2015 -- License : BSD2 -- Maintainer: Andreas Reule...
reuleaux/pire
src/Pire/Syntax/Telescope.hs
bsd-3-clause
3,987
0
15
834
1,001
516
485
47
1
-- -- -- ---------------- -- Exercise 3.4. ---------------- -- -- -- module E'3''4 where import Prelude hiding ( (&&) , (||) ) (&&) :: Bool -> Bool -> Bool (&&) True True = True (&&) True False = False (&&) False True = False (&&) False False = False (||) :: Bool -> Bool -> Bool (||) True True = True (||) Tru...
pascal-knodel/haskell-craft
_/links/E'3''4.hs
mit
387
0
6
90
155
98
57
12
1
-- Compiler Toolkit: operations on file -- -- Author : Manuel M T Chakravarty -- Created: 6 November 1999 -- -- Version $Revision: 1.1.1.1 $ from $Date: 2004/11/13 16:42:49 $ -- -- Copyright (c) [1999..2003] Manuel M T Chakravarty -- -- This file is free software; you can redistribute it and/or modify -- it unde...
k0001/gtk2hs
tools/c2hs/base/general/FileOps.hs
gpl-3.0
4,272
0
16
1,173
794
448
346
48
3
{-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Main -- Copyright : (c) 2013-2015 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- module Main (main)...
olorin/amazonka
amazonka-swf/test/Main.hs
mpl-2.0
522
0
8
103
76
47
29
9
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-codedeploy/gen/Network/AWS/CodeDeploy/DeleteDeploymentConfig.hs
mpl-2.0
3,978
0
12
829
403
245
158
63
1
{-# LANGUAGE LambdaCase #-} module OpenCog.Lojban.Syntax.AtomUtil where import Prelude hiding (id,(.),(<*>),(<$>),pure,(*>),(<*),foldl) import Control.Category (id,(.)) import Control.Isomorphism.Partial import Control.Isomorphism.Partial.Derived import Control.Isomorphism.Partial.Unsafe import Text.Syntax import qu...
ruiting/opencog
opencog/nlp/lojban/HaskellLib/src/OpenCog/Lojban/Syntax/AtomUtil.hs
agpl-3.0
13,970
1
19
5,226
5,520
3,071
2,449
-1
-1
{-# LANGUAGE CPP, NoImplicitPrelude #-} module Data.Bool.Compat ( module Base , bool ) where import Data.Bool as Base #if !(MIN_VERSION_base(4,7,0)) -- | Case analysis for the 'Bool' type. -- @bool a b p@ evaluates to @a@ when @p@ is @False@, and evaluates to @b@ -- when @p@ is @True@. -- -- /Since: 4.7.0.0/ bool :...
beni55/base-compat
src/Data/Bool/Compat.hs
mit
387
0
7
80
72
45
27
8
1
module Expression.Instances where import Expression.Type import Expression.Class ---------------------------------------------------------------------------- instance Expressive Int where toExp i = Num (fromIntegral i) fromExp (Num e) = fromIntegral e instance Expressive Integer where toExp i = Num (fro...
florianpilz/autotool
src/Expression/Instances.hs
gpl-2.0
1,292
4
9
320
536
273
263
30
0
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.BuildPaths -- Copyright : Isaac Jones 2003-2004, -- Duncan Coutts 2008 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- A bunch of dirs, paths and file ...
jwiegley/ghc-release
libraries/Cabal/cabal/Distribution/Simple/BuildPaths.hs
gpl-3.0
5,438
0
10
985
626
364
262
65
3
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeFamilies #-} -- Module : Network.AWS.Signing.Internal.V4 -- Copyright : (c) 2013-2015 Brendan Hay <brendan.g.hay@gmail.com> -- License : This Sour...
dysinger/amazonka
core/src/Network/AWS/Signing/Internal/V4.hs
mpl-2.0
6,147
0
18
2,103
1,497
814
683
-1
-1
{-# LANGUAGE TemplateHaskell, ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Unittests for the SlotMap. -} {- Copyright (C) 2014 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions ...
apyrgio/ganeti
test/hs/Test/Ganeti/SlotMap.hs
bsd-2-clause
8,949
0
17
2,125
1,953
1,054
899
139
1
{-# LANGUAGE CPP, FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module QC.Common ( ASCII(..) , parseBS , parseT , toLazyBS , toStrictBS , Repack , repackBS , repackBS_ , repackT , repackT_ , liftOp ) where #if !MIN_VERSION_base(4,8,0) import Control.A...
beni55/attoparsec
tests/QC/Common.hs
bsd-3-clause
3,464
0
13
856
1,232
660
572
87
2
module Offset where -- Test getOffset in various indented cases bob a b = x where x = 3 bib a b = x where x = 3 bab a b = let bar = 3 in b + bar foo x y = do c <- getChar return c fud a b = let bar = 3 in b + bar
RefactoringTools/HaRe
test/testdata/Offset.hs
bsd-3-clause
258
0
8
107
112
56
56
13
1
{-# LANGUAGE ParallelListComp #-} module Main where import Text.PrettyPrint import System.Environment ( getArgs ) main = do [s] <- getArgs let n = read s mapM_ (putStrLn . render . generate) [2..n] generate :: Int -> Doc generate n = vcat [ text "#ifdef DEFINE_INSTANCES" , data_i...
moonKimura/vector-0.10.9.1
internal/GenUnboxTuple.hs
bsd-3-clause
9,078
5
22
4,042
3,030
1,469
1,561
190
1
{-# Language OverloadedStrings #-} -- from https://ocharles.org.uk/blog/posts/2014-12-17-overloaded-strings.html import Data.String n :: Num a => a n = 43 f :: Fractional a => a f = 03.1420 -- foo :: Text foo :: Data.String.IsString a => a foo = "hello\n there"
ezyang/ghc
testsuite/tests/printer/Ppr026.hs
bsd-3-clause
267
0
8
46
81
38
43
8
1
{-- This is a script to generate the necessary tables to support Windows code page encoding/decoding. License: see libraries/base/LICENSE The code page tables are available from : http://www.unicode.org/Public/MAPPINGS/ To run this script, use e.g. runghc MakeTable.hs <module-name> <output-file> <codepage-dir>/*.TXT...
ezyang/ghc
libraries/base/codepages/MakeTable.hs
bsd-3-clause
9,306
0
22
2,585
2,068
1,102
966
152
5
module RayAndQ where import qualified Matrix4f as M4x4 import qualified Vector4f as V4 -- | Calculate @(ray, q)@ for the given inverse projection matrix and frustum corners ray_and_q :: M4x4.T -> (V4.T, V4.T) -> (V4.T, V4.T) ray_and_q inverse_m (near, far) = let -- Unproject the NDC coordinates to eye-space ...
io7m/r2
com.io7m.r2.documentation/src/main/resources/com/io7m/r2/documentation/haskell/RayAndQ.hs
isc
793
0
14
187
209
115
94
14
1
module Test.Helpers where import Prelude hiding (fail) import Test.HUnit import Data.SyntaxIR assertTrue description expression = assertEqual description True expression assertFalse description expression = assertEqual description False expression fail description = assertEqual description False True assertIs...
AKST/lisp.hs
test/Test/Helpers.hs
mit
409
0
8
66
115
59
56
9
1
{-# LANGUAGE NamedFieldPuns, FlexibleInstances, FlexibleContexts, GeneralizedNewtypeDeriving #-} {- Copyright (C) 2012-2017 Jimmy Liang, Kacper Bak, Michal Antkiewicz <http://gsd.uwaterloo.ca> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation ...
gsdlab/clafer
src/Language/Clafer/Intermediate/ResolverType.hs
mit
22,039
0
30
5,422
6,366
3,195
3,171
-1
-1
module Labyrinth.Reachability where import Control.Lens import Control.Monad.Reader import Data.Function import Data.List import qualified Data.Map as M import Data.Maybe import Data.Monoid import Labyrinth.Map type PositionMap a = M.Map Position a type Connectivity = PositionMap [Position] type Distribution = Po...
koterpillar/labyrinth
src/Labyrinth/Reachability.hs
mit
4,154
0
17
1,037
1,716
862
854
94
3
module Handler.ContentProxy where import Import import Network.Wai.Conduit (responseSource) import qualified Network.Wai as Wai import Blaze.ByteString.Builder (fromByteString) import Data.CaseInsensitive (CI) import qualified Data.ByteString as S import FP.EnvSettings (learningSiteApproot) -- | Creates a proxy for u...
fpco/schoolofhaskell.com
src/Handler/ContentProxy.hs
mit
1,805
0
20
491
399
212
187
-1
-1
module Optimize where import ObjInfo import IntermedSyntax type FlowGraph = [(Label, Node)] data Node = Node { icode :: [ICode], next :: Label } deriving(Eq, Show) makeFlowGraph :: IProgram -> IProgram analyzeBody :: [ICode] -> FlowGraph
yu-i9/HaSC
src/HaSC/Prim/Optimize.hs
mit
265
0
9
63
81
50
31
8
0
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.HTMLTextAreaElement (js_checkValidity, checkValidity, js_setCustomValidity, setCustomValidity, js_select, select, js_setRangeText, setRangeText, js_setRangeText4, setRangeText4, js_s...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/HTMLTextAreaElement.hs
mit
25,205
348
11
4,015
4,811
2,533
2,278
372
1
{-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE...
MattWis/smallEmail
smallEmail/Main.hs
mit
1,651
0
17
410
364
192
172
36
1
module Grammar.IO.RandomSample where import Data.Array import Data.Random.RVar import Data.Random.Distribution.Uniform import Data.Random.Source.DevRandom import Data.List import Data.Maybe import qualified Data.Sequence as Seq import Data.Sequence ((><), ViewL((:<))) randomSample :: Int -> [a] -> IO [a] randomSample...
ancientlanguage/haskell-analysis
grammar/src/Grammar/IO/RandomSample.hs
mit
1,317
1
13
290
617
330
287
34
2
----------------------------------------------------------------------------- -- -- Module : Language.PureScript.Optimizer.Unused -- Copyright : (c) Phil Freeman 2013-14 -- License : MIT -- -- Maintainer : Phil Freeman <paf31@cantab.net> -- Stability : experimental -- Portability : -- -- | -- Removes...
bergmark/purescript
src/Language/PureScript/Optimizer/Unused.hs
mit
1,291
0
14
225
347
189
158
20
3
-- https://www.reddit.com/r/dailyprogrammer/comments/pwox3/2192012_challenge_11_intermediate/ module Main where rotate :: [Int] -> [Maybe Int] rotate = reverse . fmap (flip lookup helper) where helper :: [(Int,Int)] helper = [ (0, 0), (1, 1), (2, 2), (5, 5) , (6, 9), (8, 8), (9, 6)] isUpsideUp :: [Int...
gallais/dailyprogrammer
intermediate/011/Main.hs
mit
642
0
14
153
293
161
132
19
1
module Javascript where import Text.Blaze.Html5 hiding (head,map) import Text.Blaze.Html5.Attributes import Text.Blaze.Html5 as H hiding (head,map) import Text.Blaze.Html5.Attributes as A import Text.Blaze.Html.Renderer.Pretty import Data.Monoid import Models import Utils ...
lnunno/blaze-bootstrap3
Bootstrap3/Javascript.hs
mit
2,042
0
17
549
657
337
320
30
3
{-# LANGUAGE OverloadedStrings, NoImplicitPrelude #-} module Network.Images.Search ( Gapi(..) , config , linksOfQuery , luckyLinkOfQuery ) where import BasePrelude hiding ((&)) import Control.Lens import Data.Aeson.Lens import Data.Text (Text) import qualified Network.Wreq as W...
dpatti/jpg-to
src/Network/Images/Search.hs
mit
1,523
0
14
357
496
266
230
39
1
import Data.Char (intToDigit) import Test.Hspec (Spec, it) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import Test.QuickCheck (Positive(Positive), (==>), property) import qualified Numeric as Num (showIntAtBase) import Trinary (readTri, showTri) main :: IO () main = hspecWith...
exercism/xhaskell
exercises/practice/trinary/test/Tests.hs
mit
1,003
0
13
230
378
204
174
21
1
{- - Extract a slice from a list. - Given two indices, i and k, the slice is the list containing the elements - between the i'th and the k'th element of the original list (both limits - included). Start counting the elements with 1. - - Example: - > slice ['a','b','c','d','e','f','g','h','i','k'] 3 7 - "cdefg" -} slic...
LucianU/99problems
P18.hs
mit
1,010
0
14
280
300
156
144
15
2
locationsWithin :: Int -> (Int, Int) -> Int -> [(Int, Int)] locationsWithin num loc steps = snd (until done update ([[loc]], [])) where done = (null . fst) update ((p:ps), seen) = (insertAll ps (map (\loc -> loc : p) (nextLocs num p)) seen, (head p) : seen) insertAll ps [] _ = ps inser...
ajm188/advent_of_code
2016/13/Main.hs
mit
2,188
0
13
713
1,211
641
570
49
3
-- | Tests some properties against Language.TaPL.Boolean. module Language.TaPL.Boolean.Tests where import Test.QuickCheck (quickCheck) import Text.Printf (printf) import Language.TaPL.ShowPretty (showp) import Language.TaPL.Boolean (Term, parseString, eval, eval') -- | A test runner. main = mapM_ (\(s,a) -> printf...
zeckalpha/TaPL
src/Language/TaPL/Boolean/Tests.hs
mit
1,361
0
10
215
287
160
127
18
1
#!/usr/bin/runhugs module Main where import Data.List main = putStrLn(unlines p++" ["++s p++"]") where s = concat . intersperse ",\n " . map show p = ["#!/usr/bin/runhugs", "module Main where", "import Data.List", "", "main = putStrLn(unlines p++\" [\"++s p++\"]\") where", " s = concat . intersperse \...
google-code/bkil-open
volatile/edu/quine1.hs
gpl-2.0
353
0
10
74
86
48
38
12
1
module Cryptography.KeyEncapsulation where import Notes import Functions.Basics.Macro import Probability.ProbabilityMeasure.Macro import Probability.ProbabilityMeasure.Terms import Probability.RandomVariable.Terms import Cryptography.PublicKeyEncryption.Mac...
NorfairKing/the-notes
src/Cryptography/KeyEncapsulation.hs
gpl-2.0
3,527
0
21
889
1,066
582
484
54
1
{- | Module : ./Driver/WriteLibDefn.hs Description : Writing out a DOL library Copyright : (c) Klaus Luettich, C.Maeder, Uni Bremen 2002-2006 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : non-portable(DevGraph) Writing out D...
spechub/Hets
Driver/WriteLibDefn.hs
gpl-2.0
4,678
0
20
1,095
1,204
613
591
93
5
{- | Module : $Header$ Description : datastructures for annotations of (Het)CASL. Copyright : (c) Klaus Luettich, Christian Maeder, and Uni Bremen 2002-2006 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : portable Datastructur...
nevrenato/HetsAlloy
Common/AS_Annotation.der.hs
gpl-2.0
9,853
4
17
2,382
2,298
1,257
1,041
158
3
-- | Library with auxiliary functions needed in multiple other modules. module Bio.ViennaRNAParserLibrary ( parseNucleotideSequence, parseNucleotideAlignmentEntry, parseProteinSequence, parseProteinAlignmentEntry, ...
eggzilla/ViennaRNAParser
src/Bio/ViennaRNAParserLibrary.hs
gpl-3.0
1,647
0
10
361
225
118
107
28
1
-- | Implementation of diff, match, and patch. -- -- Based on Neil Fraser's work, as found at -- https://code.google.com/archive/p/google-diff-match-patch/ {-# LANGUAGE ViewPatterns #-} module Data.DiffMatchPatch ( DiffChange(..) , calculateDiff ) where import BasicPrelude hiding (insert, delete) import ...
jml/diff-match-patch
src/Data/DiffMatchPatch.hs
gpl-3.0
3,563
0
15
986
871
472
399
57
4
-- (c) The University of Glasgow 2006 {-# LANGUAGE CPP #-} -- | Highly random utility functions -- module Language.Haskell.Utility.Util (abstractConstr, snocView, thenCmp, isSingleton, partitionWith, dropWhileEndLE, debugIsOn, ...
shayan-najd/HsParser
Language/Haskell/Utility/Util.hs
gpl-3.0
14,989
0
17
4,393
3,432
1,864
1,568
-1
-1
{- By Denis Krjuchkov http://stackoverflow.com/questions/2354707/in-haskell-is-there-num-a-infinity-a -} module Infinitable where data Infinitable a = NegativeInfinity | Regular a | PositiveInfinity deriving (Eq, Show) instance Ord a => Ord (Infinitable a) where compare NegativeInfinity NegativeInfin...
graninas/Haskell-Algorithms
Data/Infinitable.hs
gpl-3.0
834
2
11
199
230
121
109
17
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-sqladmin/gen/Network/Google/Resource/SQL/Instances/Delete.hs
mpl-2.0
4,863
0
18
1,201
780
454
326
114
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/CreativeFields/Get.hs
mpl-2.0
5,032
0
19
1,227
821
474
347
116
1
{-| Module : Async Description : hnfs-tester - Nfs (client library) test tool Copyright : (c) 2014 Arne Redlich <arne.redlich@googlemail.com> License : LGPL v2.1 Maintainer : Arne Redlich <arne.redlich@googlemail.com> Stability : experimental Portability : POSIX hnfs-tester tests using hnfs' async interf...
aredlich/hnfs
hnfs-tester/Async.hs
lgpl-2.1
4,543
0
18
1,408
1,245
632
613
89
2
module Data.GI.CodeGen.Code ( Code(..) , ModuleInfo(..) , ModuleFlag(..) , BaseCodeGen , CodeGen , ExcCodeGen , CGError(..) , genCode , evalCodeGen , writeModuleTree , listModuleTree , codeToText , transitiveModuleDeps , minBaseVersion , BaseVersion(..) ,...
hamishmack/haskell-gi
lib/Data/GI/CodeGen/Code.hs
lgpl-2.1
31,231
0
16
8,020
7,290
3,877
3,413
-1
-1
-- | Example of NlpSolver {-# OPTIONS_GHC -Wall #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveGeneric #-} module Main where import GHC.Generics ( Generic1 ) import Text.Printf ( printf ) import Casadi.MX ( MX ) import Dyno.Vectorize ( Vectorize, Id(..), None(..), vpure, vapply ) import Dyno.View.View impo...
ghorn/dynobud
dynobud/examples/NlpSolverEx.hs
lgpl-3.0
2,792
0
14
909
889
480
409
67
2
module Polymorphism where import Data.List (sort) data Person = Person Bool deriving Show printPerson :: Person -> IO () printPerson person = putStrLn (show person) data Mood = Blah | Woot deriving (Show, Eq) -- settleDown :: Mood -> Mood settleDown x = if x == Woot then Blah ...
m3mitsuppe/haskell
exercises/Programming Haskell Book Exercises.hsproj/Polymorphism.hs
unlicense
1,247
1
10
323
449
244
205
-1
-1
module Main where import System.IO import Control.Monad.State import Control.Monad (forever) import System.Environment ( getArgs ) import PGF import PGF.Binary hiding (version) import PGF.Printer import Data.Binary import Text.Show.Pretty import Language.Porter import qualified Data.Map as Map import Transform impor...
creswick/pgftransform
app/haskell/Main.hs
apache-2.0
2,858
0
21
926
604
326
278
59
3
{- Copyrights (c) 2016. Samsung Electronics Ltd. All right 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 l...
ryzhyk/cocoon
cocoon/Setup.hs
apache-2.0
644
0
4
102
12
7
5
2
1
{- Copyright 2015 Raghu Kaippully 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 to in...
rkaippully/laydown
src/test/Codec/Laydown/Specs.hs
apache-2.0
2,745
0
18
694
586
294
292
49
1
module Main where import ECC import Codes.ICFP_Paper import Haskell.ArraySig (fromListMatrix) import Manifold.Repa (ecc_repa) -- ecc_repa currently cannot handle the 4K/7K code -- -- it takes about 3ms per decode for the 7/20 code main :: IO () main = do putStrLn "Start" let h = fromListMatrix Codes.ICFP_Paper.h_...
ku-fpg/ldpc
mains/Haskell_Repa.hs
bsd-2-clause
488
0
12
87
155
82
73
12
1
module Drasil.Projectile.Assumptions (accelYGravity, accelXZero, cartSyst, assumptions, constAccel, gravAccelValue, launchOrigin, pointMass, posXDirection, targetXAxis, timeStartZero, twoDMotion, yAxisGravity) where import Language.Drasil import Utils.Drasil import qualified Drasil.DocLang.SRS as SRS (valsOfAuxC...
JacquesCarette/literate-scientific-software
code/drasil-example/Drasil/Projectile/Assumptions.hs
bsd-2-clause
4,905
0
12
904
1,247
680
567
72
1
module Exercises.ChapterTwelve ( ) where data Tree a = Leaf | Node (Tree a) a (Tree a) deriving (Show) instance Functor Tree -- fmap g Tree :: (a -> b) -> Tree a -> Tree b where fmap _ Leaf = Leaf fmap g (Node l a r) = Node (fmap g l) ...
philipcraig/hutton
src/Exercises/ChapterTwelve.hs
bsd-3-clause
2,014
0
13
872
508
271
237
42
1
{-# LANGUAGE OverloadedStrings #-} module Types.Torrent ( fromJson, QueryResult(..), Torrent(..) ) where import Data.Aeson((.:), (.:?)) import qualified Data.Aeson as Json import qualified Data.ByteString.Lazy.Char8 as C import qualified Data.DateTime as Date import qualified Data.Map.Strict as Map import Control.Mon...
ibizaman/t411-hs
src/Types/Torrent.hs
bsd-3-clause
3,961
0
35
1,613
948
534
414
111
2
{-# OPTIONS_GHC -Wall #-} module SourceSyntax.Pattern where import qualified SourceSyntax.Helpers as Help import SourceSyntax.PrettyPrint import Text.PrettyPrint as PP import qualified Data.Set as Set import SourceSyntax.Literal as Literal data Pattern = PData String [Pattern] | PRecord [String] ...
JoeyEremondi/haskelm-old
src/SourceSyntax/Pattern.hs
bsd-3-clause
1,917
0
16
568
669
337
332
54
6
{-# LANGUAGE OverloadedStrings #-} module Spec.IO (tests) where import Data.Default (def) import Hakyll.Convert.Common (DistilledPost (..)) import Hakyll.Convert.IO (savePost) import Spec.SpecHelpers import System.Directory (doesFileExist) import System.FilePath ((</>)) import System.IO.Temp (withSystemTempDirectory)...
kowey/hakyll-convert
test/spec/Spec/IO.hs
bsd-3-clause
1,393
0
16
318
262
144
118
32
1
{-# LANGUAGE Arrows, NoMonomorphismRestriction #-} module Web.HRSS.Data.Atom where import Text.XML.HXT.Core import Data.Tree.NTree.TypeDefs(NTree) data Atom = Atom { atomTitle :: String , atomEntries :: [Entry] , atomLinks :: [Link] } deriving (Show, Read, Eq) data Link = Link { linkRel :: String , li...
kdridi/hrss
src/lib/Web/HRSS/Data/Atom.hs
bsd-3-clause
1,883
3
16
560
693
356
337
49
1
{-# LANGUAGE ScopedTypeVariables #-} module Cataskell.GameData.PlayerSpec (main, spec) where import Test.Hspec import Test.QuickCheck import Data.Monoid import Cataskell.GameData.Basics import Cataskell.GameData.Player import Cataskell.GameData.Resources import Control.Arrow ((&&&)) import Data.Maybe (isNothing) impo...
corajr/cataskell
test/Cataskell/GameData/PlayerSpec.hs
bsd-3-clause
3,108
0
19
851
980
515
465
74
1
{-| Module : Idris.CmdOptions Description : A parser for the CmdOptions for the Idris executable. License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE Arrows #-} module Idris.CmdOptions ( module Idris.CmdOptions , opt , getClient, getPkg, getPkgCheck, getPkgClean, getPkgMkDoc , getPkgR...
enolan/Idris-dev
src/Idris/CmdOptions.hs
bsd-3-clause
14,346
1
76
4,390
3,439
1,696
1,743
205
2
{-# LANGUAGE CPP, ForeignFunctionInterface #-} {-# LANGUAGE DeriveGeneric #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.InstallDirs -- Copyright : Isaac Jones 2003-2004 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org ...
plumlife/cabal
Cabal/Distribution/Simple/InstallDirs.hs
bsd-3-clause
23,529
2
16
6,547
4,551
2,551
2,000
390
10
{-| Description: Advancement of SDL state. -} module Graphics.UI.SDL.State.Advance ( nextState ) where import Control.Monad (liftM, foldM) import Control.Applicative ((<$>)) import qualified Data.Set as S import qualified Data.BitSet.Word as BW import qualified Data.Map.Strict as M import Control.Lens im...
abbradar/MySDL
src/Graphics/UI/SDL/State/Advance.hs
bsd-3-clause
3,447
0
19
1,278
899
483
416
-1
-1
-- 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. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. {-# LANGUAGE GADT...
rfranek/duckling
Duckling/Ordinal/ID/Rules.hs
bsd-3-clause
1,708
0
17
397
406
224
182
43
12
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} module HSGen.Recompiler.Class where import Control.Monad (ap, liftM2) import Control.Spoon.Prim import...
michaeljklein/CPlug
src/HSGen/Recompiler/Class.hs
bsd-3-clause
4,108
66
9
946
1,530
841
689
69
1
{- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[RnSource]{Main pass of renamer} -} {-# LANGUAGE CPP, ScopedTypeVariables #-} module RnSource ( rnSrcDecls, addTcgDUs, findSplice ) where #include "HsVersions.h" import {-# SOURCE #-} RnExpr( rnLExpr ) import {-# SOURCE #-} RnSplice (...
mettekou/ghc
compiler/rename/RnSource.hs
bsd-3-clause
97,908
1
25
30,410
17,774
9,391
8,383
1,123
8
{-# LANGUAGE PolyKinds #-} module Data.IxFunctor.Copointed where import Data.IxFunctor class IxFunctor w => IxCopointed w where iextract :: w i i a -> a
kylcarte/ixfunctors
src/Data/IxFunctor/Copointed.hs
bsd-3-clause
159
0
8
30
45
24
21
5
0
module Data.Model ( -- |Check the <https://github.com/tittoassini/model tutorial and github repo>. module Data.Model.Class ,module Data.Model.Types ,module Data.Model.Pretty ,module Data.Model.Util ) where import Data.Model.Class import Data.Model.Instances () import Data.Mode...
Quid2/model
src/Data/Model.hs
bsd-3-clause
396
0
5
95
70
48
22
10
0
module Main where import Codec.Picture as Juicy import Control.Lens import Control.Monad.Catch import Control.Monad.Except import Data.Int import Data.Proxy import Matrix import qualified Data.Map.Strict as M import qualified Data.Vector as V import LambdaCube.GL as LC import LambdaCube.GL.Mesh as LC import Game.Go...
Teaspot-Studio/gore-and-ash-lambdacube
examples/04/Example04.hs
bsd-3-clause
8,721
0
17
1,983
2,917
1,499
1,418
-1
-1
------------------------------------------------------------------------------- -- | -- Module : System.Hardware.Arduino.SamplePrograms.Pulse -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Demonstrates 'pulseIn_hostTiming' and 'pul...
LeventErkok/hArduino
System/Hardware/Arduino/SamplePrograms/Pulse.hs
bsd-3-clause
2,911
0
16
612
323
175
148
26
2