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 Feature.RangeSpec where import Test.Hspec import Test.Hspec.Wai import Network.HTTP.Types import Network.Wai.Test (SResponse(simpleHeaders,simpleStatus)) import SpecHelper spec :: Spec spec = beforeAll (clearTable "items" >> createItems 15) . afterAll_ (clearTable "items") . around withApp $ describe "GET...
nayosx/postgrest
test/Feature/RangeSpec.hs
mit
3,060
0
21
1,057
652
326
326
67
1
{-# LANGUAGE OverloadedStrings #-} module Y2018.M06.D19.Exercise where {-- Same, but different. Today we are going to look at the non-duplicate articles of the Virginian-Pilot: those articles that have the same UUID but are materially different. This time, however, these articles have their full text and are formatt...
geophf/1HaskellADay
exercises/HAD/Y2018/M06/D19/Exercise.hs
mit
1,674
0
9
282
220
128
92
21
1
{-# LANGUAGE TupleSections #-} import Data.List import Control.Monad.State.Lazy factors n = map length . group . sort $ concatMap (reduce [2..]) [2..n] reduce _ 1 = [] reduce y@(x:xs) n = case mod n p of 0 -> p : reduce y (div n x) _ -> reduce xs n -------------------------------------- -- qsort [] = [] -...
nickspinale/euler
incomplete/495.hs
mit
4,562
0
11
1,333
253
189
64
8
2
module AST where data Module = Module { modName :: Name , modImports :: () --XXX , modTDecls :: [TDecl] , modDecls :: [FunBind] } deriving Show blankModule :: Name -> Module blankModule n = Module { modName = n ...
yav/lang
src/AST.hs
mit
3,402
0
10
1,657
753
439
314
84
1
module HW03 where data Expression = Var String -- Variable | Val Int -- Integer literal | Op Expression Bop Expression -- Operation deriving (Show, Eq) -- Binary (2-input) operators data Bop = Plus | Minus | Times | Divide | Gt | Ge ...
maggy96/haskell
cis194/03-ADTs/interpreter.hs
mit
4,470
12
19
1,733
1,364
702
662
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} module Rx.Observable.Concat where import Prelude.Compat hiding (concat) import Control.Concurrent.STM (atomically) import Control.Concurrent.STM.TQueue (isEmptyTQueue, newTQueueIO, re...
roman/Haskell-Reactive-Extensions
rx-core/src/Rx/Observable/Concat.hs
mit
4,007
0
19
1,424
783
385
398
92
6
module Main where import Pong import Spear.Math.AABB import Spear.Math.Spatial2 import Spear.Math.Vector import Spear.Game import Spear.Window import Data.Maybe (mapMaybe) import qualified Graphics.Rendering.OpenGL.GL as GL import Graphics.Rendering.OpenGL.GL (($=)) data GameState = GameState { wnd :: Wind...
jeannekamikaze/Spear
demos/pong/Main.hs
mit
2,414
0
16
676
893
444
449
65
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Construction (Name, Term (..), appP, lamP, termP, varP) import Data.Text import Test.Hspec import Text.Parsec import Text.Parsec.Text main :: IO () main = hspec $ describe "Parser test" parserTest ...
mortum5/programming
haskell/BM-courses/construct-yourself/test/ParseSpec.hs
mit
1,535
0
15
449
490
236
254
43
1
module Network.Skype.Parser.Types where import Control.Applicative import Control.Arrow import Data.Attoparsec.ByteString.Char8 (decimal) import Data.Attoparsec.ByteString.Lazy import Data.Char (chr) import Data.Time.Calendar (fromGregorian) import Data.Word8 import Network.Skype.Protocol.Types import qualified Data....
emonkak/skype4hs
src/Network/Skype/Parser/Types.hs
mit
2,964
0
12
437
802
442
360
76
1
module Region where import Data.Map as Map type RegionId = Int type NationId = Int type StepCount = Int data Region = Region { regionId :: RegionId , ownerId :: NationId , allegiance :: NationId , ownershipDuration :: StepCount , adjacentRegions :: [RegionId] , population :: Int ...
rsachtl/world_simulator
src/Region.hs
mit
1,863
0
11
441
544
309
235
63
3
{-# LANGUAGE PackageImports #-} {-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-} -- | Reexports "Data.Version.Compat" -- from a globally unique namespace. module Data.Version.Compat.Repl.Batteries ( module Data.Version.Compat ) where import "this" Data.Version.Compat
haskell-compat/base-compat
base-compat-batteries/src/Data/Version/Compat/Repl/Batteries.hs
mit
290
0
5
31
29
22
7
5
0
{-# LANGUAGE CPP #-} module GHCJS.DOM.EXTBlendMinMax ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.EXTBlendMinMax #else #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) import GHCJS.DOM.JSFFI.Gen...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/EXTBlendMinMax.hs
mit
355
0
5
33
33
26
7
4
0
module Antiqua.Graphics.Utils where import Codec.Picture import GHC.Word pngLoad :: String -> IO (Image Word8) pngLoad file = do image <- readPng file case image of Right (ImageRGBA8 (Image width height dat)) -> return (Image width height dat) Right _ -> do error "unsup...
olive/antiqua-prime
src/Antiqua/Graphics/Utils.hs
mit
411
0
14
136
134
63
71
14
3
{-# LANGUAGE CPP #-} module GHCJS.DOM.VTTRegionList ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.VTTRegionList #else #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) import GHCJS.DOM.JSFFI.Gener...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/VTTRegionList.hs
mit
352
0
5
33
33
26
7
4
0
{-# LANGUAGE DoAndIfThenElse, BangPatterns, FlexibleInstances, ExistentialQuantification, ImpredicativeTypes #-} module StarStats.Renderer where import Control.Arrow import Control.Applicative import Data.List import Data.Maybe import qualified Data.Map as M import Text.Printf import System.Random import Sys...
deweyvm/starstats
src/StarStats/Renderer.hs
mit
9,353
0
23
2,762
3,619
1,905
1,714
214
2
-- | Connections module describes all elements of network connectivity module Simulation.HSimSNN.Connections where import Simulation.HSimSNN.Population import Simulation.HSimSNN.Neuron -- | Connections encapsulates information about source and destination neurons -- and corresponding synaptic information -- -- * Th...
drwebb/HSimSNN
src/Simulation/HSimSNN/Connections.hs
gpl-2.0
929
0
11
147
92
60
32
6
0
bruteCollatz :: Integer -> [Integer] bruteCollatz 1 = [] bruteCollatz n | odd n = 3*n+1:bruteCollatz(3*n+1) | even n = div n 2:bruteCollatz(div n 2) chains = [bruteCollatz x | x <- [1..]] longest' (max_i, max_l) = let l = head $ dropWhile (\(i,l) -> l <= max_l) $ zip [max_i..] $ map length $ chains' max_i ...
softwaremechanic/Miscellaneous
Haskell/collatz.hs
gpl-2.0
717
3
16
176
289
147
142
15
2
{-# OPTIONS_GHC -Wall -fwarn-tabs -Werror #-} ------------------------------------------------------------------------------- -- | -- Module : Time.Types -- Copyright : Copyright (c) 2014 Michael R. Shannon -- License : GPLv2 or Later -- Maintainer : mrshannon.aerospace@gmail.com -- Stability : unst...
mrshannon/trees
src/Time/Types.hs
gpl-2.0
600
0
8
110
59
41
18
7
0
{-| Module : Util.Happstack Description : Contains a single method for creating a JSON response. -} module Util.Happstack (createJSONResponse) where import Data.Aeson (ToJSON, encode) import qualified Data.ByteString.Char8 as BS import qualified Data.ByteString.Lazy.Char8 as BSL import Happstack.Serve...
Courseography/courseography
app/Util/Happstack.hs
gpl-3.0
596
0
9
113
131
76
55
10
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TemplateHaskell #-} -- | -- Copyright : (c) 2010, 2011 Benedikt Schmidt & Simon Meier -- License : GPL v3 (see LICENSE) -- -- Maintainer : Simon Meier <iridcode@gmail.com> -- Portability : GHC only -- -- Theory loading infrastructure. module Main.TheoryLoader ( ...
kmilner/tamarin-prover
src/Main/TheoryLoader.hs
gpl-3.0
19,132
0
20
4,750
3,682
1,855
1,827
292
11
{-#LANGUAGE ImpredicativeTypes, FlexibleContexts, RankNTypes,TypeOperators, ScopedTypeVariables, GADTs, MultiParamTypeClasses #-} module Carnap.Core.Data.Util (scopeHeight, equalizeTypes, incArity, withArity, checkChildren, saferSubst, mapover, maphead, withHead, hasVar, (:~:)(Refl), Buds(..), Blossoms(..), bloom, sbl...
opentower/carnap
Carnap/src/Carnap/Core/Data/Util.hs
gpl-3.0
9,241
0
16
2,435
2,881
1,472
1,409
114
6
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-debugger/gen/Network/Google/Resource/CloudDebugger/Controller/Debuggees/Register.hs
mpl-2.0
6,075
0
18
1,307
729
431
298
107
1
-- Implicit CAD. Copyright (C) 2011, Christopher Olah (chris@colah.ca) -- Copyright 2014-2019, Julia Longtin (julial@turinglace.com) -- Released under the GNU AGPLV3+, see LICENSE module Graphics.Implicit.FastIntUtil (Fastℕ(Fastℕ), toFastℕ, fromFastℕ) where import Prelude (Integral(toInteger, quot, rem, quotRem, div,...
krakrjak/ImplicitCAD
Graphics/Implicit/FastIntUtil.hs
agpl-3.0
2,884
64
10
630
1,022
583
439
43
1
{- tempgres, REST service for creating temporary PostgreSQL databases. Copyright (C) 2014-2020 Bardur Arantsson This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either versi...
ClockworkConsulting/tempgres-server
server/src/Tempgres/DatabaseId.hs
agpl-3.0
2,790
0
11
667
453
242
211
-1
-1
{-# LANGUAGE DeriveDataTypeable, DeriveGeneric, BangPatterns, ScopedTypeVariables, RankNTypes, StandaloneDeriving #-} module DNA.Channel.File ( FileChan , createFileChanImp , deleteFileChan , withFileChan , readFileChan , mmapFileChan ) where impo...
SKA-ScienceDataProcessor/RC
MS3/lib/DNA/Channel/File.hs
apache-2.0
3,710
0
14
925
979
509
470
75
3
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE ExistentialQuantification #-} -- |Contains error-handling mechanisms built atop 'Control.Monad.Except'. module Crawling.Hephaestos.Fetch.ErrorHandling where import Control.Monad import Control.Monad.Catch i...
jtapolczai/Hephaestos
Crawling/Hephaestos/Fetch/ErrorHandling.hs
apache-2.0
1,766
0
12
508
489
267
222
26
3
----------------------------------------------------------------------------- -- -- Module : TestDecoder -- Description : -- Copyright : (c) Tobias Reinhardt, 2015 <tobioso92_@hotmail.com -- License : Apache License, Version 2.0 -- -- Maintainer : Tobias Reinhardt <tobioso92_@hotmail.com> -- Portability...
tobiasreinhardt/show
IniConfiguration/tests/TestDecoder.hs
apache-2.0
4,748
0
14
1,327
1,115
530
585
66
1
{-# LANGUAGE BangPatterns, RecordWildCards #-} -- | -- Module : Criterion -- Copyright : (c) 2009-2014 Bryan O'Sullivan -- -- License : BSD-style -- Maintainer : bos@serpentine.com -- Stability : experimental -- Portability : GHC -- -- Core benchmarking code. module Criterion.Internal ( runAndA...
rrnewton/criterion
Criterion/Internal.hs
bsd-2-clause
8,095
0
20
2,299
2,306
1,163
1,143
173
7
{-# LANGUAGE RankNTypes, RecordWildCards #-} -- | -- Module : Network.Wreq.Session -- Copyright : (c) 2014 Bryan O'Sullivan -- -- License : BSD-style -- Maintainer : bos@serpentine.com -- Stability : experimental -- Portability : GHC -- -- The functions in this module use a 'Session' to handle the -- fol...
Feeniks/wreq
Network/Wreq/Session.hs
bsd-3-clause
6,828
0
16
1,340
1,501
820
681
93
2
module Stack where data Symbol a = Symbol a | Bottom deriving (Eq, Ord, Show) type Stack a = [Symbol a] pop :: Stack a -> Stack a pop [Bottom] = [Bottom] pop (_:ss) = ss push :: Symbol a -> Stack a -> Stack a push s ss = (s:ss) peek :: Stack a -> Symbol a peek = head
katydid/nwe
src/Stack.hs
bsd-3-clause
280
0
7
73
148
79
69
12
1
{-# LANGUAGE Rank2Types, FlexibleContexts #-} module Numeric.MaxEnt.Deconvolution.Internal where import Numeric.MaxEnt import Data.List.Split import Data.List import Debug.Trace import Numeric.Integration.TanhSinh import Numeric.AD import Control.Applicative import Numeric.MaxEnt.Deconvolution.Convolution2D import Math...
jfischoff/Sharpen
src/Numeric/MaxEnt/Deconvolution/Internal.hs
bsd-3-clause
6,767
0
16
1,719
1,907
1,062
845
127
2
module Paths_hsql_mysql ( version, getBinDir, getLibDir, getDataDir, getLibexecDir, getDataFileName, getSysconfDir ) where import qualified Control.Exception as Exception import Data.Version (Version(..)) import System.Environment (getEnv) import Prelude catchIO :: IO a -> (Exception.IOException -> IO a...
xpika/hsql-mysql
dist/build/autogen/Paths_hsql_mysql.hs
bsd-3-clause
1,388
0
10
182
368
211
157
28
1
{-# LANGUAGE OverloadedStrings #-} module Words (tests) where import qualified Sanskell.Words as W (wordCount) import qualified Data.Map as M import Test.HUnit testSpaces = TestCase $ do let wordsCount = W.wordCount [ " \t" ] assertEqual "empty list," [] (M.elems wordsCount) testSpacesWithWords = TestCase $ do ...
ashishnegi/sanskell
test/Words.hs
bsd-3-clause
1,327
0
12
262
284
149
135
21
1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.ARB.DrawBuffersBlend -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portabl...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/DrawBuffersBlend.hs
bsd-3-clause
750
0
4
87
46
37
9
6
0
module Tronkell.Network.TcpSockets where import qualified Tronkell.Server.Types as ST import qualified Control.Concurrent as Con import qualified Tronkell.Network.Utils as NU (nextUserID) import Network (PortID(..), accept, listenOn, withSocketsDo, Socket) import System.IO import qualified Control.Concurrent as C (fo...
nilenso/tronkell
src/Tronkell/Network/TcpSockets.hs
bsd-3-clause
2,438
0
15
424
805
402
403
51
5
{-# LANGUAGE FlexibleContexts #-} {-| Module : Numeric.AERN.DoubleBasis.RealIntervalApprox Description : Double intervals for approximating real intervals Copyright : (c) Michal Konecny, Jan Duracz License : BSD3 Maintainer : mikkonecny@gmail.com Stability : experimental ...
michalkonecny/aern
aern-double/src/Numeric/AERN/DoubleBasis/RealIntervalApprox.hs
bsd-3-clause
9,858
0
9
2,273
1,249
843
406
119
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Main where import Args import Control.Lens import Control.Monad import Control.Monad.IO.Class import Control.Monad.Trans.AWS import Data.Conduit import qualified Data.Conduit.Binar...
andreyk0/kms-s3
Main.hs
bsd-3-clause
3,735
0
24
1,280
957
474
483
85
8
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} module GHC ( -- * GHC packages array, base, binary, bytestring, cabal, compareSizes, compiler, containers, deepseq, deriveConstants, directory, filepath, genapply, genprimopcode, ghc, ghcBoot, ghcBootTh, ghcCabal, ghcCompact, ghci, ghcPkg, ghcPrim, ghcTag...
ezyang/ghc
hadrian/src/GHC.hs
bsd-3-clause
11,380
0
13
3,311
2,293
1,258
1,035
-1
-1
{-# LANGUAGE RankNTypes #-} -- | A data type for monetary values, with associated operations and -- only sensible instances. module Data.Money ( Money(Money) -- * Optics , money -- * Operators , ($+$) , ($-$) , (*$) , ($*) , ($/) , ($/$) , ($^) , ($^^) , ($**) ) where import Data.Fun...
gwils/money
src/Data/Money.hs
bsd-3-clause
2,691
0
10
622
1,066
592
474
69
1
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables, ViewPatterns #-} module Main (main) where import System.Environment (getArgs) import Debug.Trace import Control.Monad import Control.Monad.Trans (MonadIO, liftIO) import Control.Monad.Loops (whileM_) import Control.Applicative (Applicative(..), (<$>), (<*>)) impo...
jsgf/SigFromNoise
src/slurp.hs
bsd-3-clause
14,607
5
32
4,216
4,046
2,134
1,912
210
3
-- Sums primes up to nth (yay lazy evaluation!) sumPrimesTo :: Integer -> Integer sumPrimesTo n = sieve [2..] 0 where sieve (p:ms) sumacc | p >= n = sumacc | p < n = sieve (filter (\m -> m `mod` p /= 0) ms) (p+sumacc) main :: IO () main = print $ sumPrimesTo 2000000
akerber47/haskalah
test/files/euler/10.hs
bsd-3-clause
304
0
14
92
129
66
63
6
1
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.NV.ExplicitMultisample -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Porta...
haskell-opengl/OpenGLRaw
src/Graphics/GL/NV/ExplicitMultisample.hs
bsd-3-clause
1,165
0
5
143
108
74
34
20
0
{-# LANGUAGE PolyKinds #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE...
ericnething/mailgun
src/Mailgun.hs
bsd-3-clause
6,392
0
13
2,110
1,495
854
641
-1
-1
module Monad( ServerEnv(..) , ServerM , newServerEnv , runServerM , runServerMIO , serverMtoHandler , AuthM(..) , runAuth ) where import Control.Monad.Base import Control.Monad.Catch (MonadCatch, MonadThrow) import Control.Monad.Except import Control.Monad.Logger import Control.Monad.Reader import ...
VyacheslavHashov/servant-auth-token
example/persistent/src/Monad.hs
bsd-3-clause
3,158
0
13
592
814
438
376
-1
-1
module Llvm.Pass.PassTester where import Llvm.Hir.Data import Llvm.Query.HirCxt import Llvm.Query.Hir import qualified Compiler.Hoopl as H import qualified Data.Set as Ds type Optimization m a g u x = IrCxt g -> a -> H.Label -> H.Graph (Node g u) H.C H.C -> m (H.Graph (Node g u) H.C H.C, x) opt :: (H.CheckpointMo...
mlite/hLLVM
src/Llvm/Pass/PassTester.hs
bsd-3-clause
1,071
0
14
277
526
277
249
20
1
{-# LANGUAGE TupleSections #-} {-# LANGUAGE NoMonomorphismRestriction #-} module Language.Nano.SSA.SSA (ssaTransform) where import Control.Applicative ((<$>), (<*>)) import Control.Monad import qualified Data.HashMap.Strict as M import Langua...
UCSD-PL/nano-js
Language/Nano/SSA/SSA.hs
bsd-3-clause
9,512
0
14
2,472
2,718
1,387
1,331
154
3
module Main where import Ivory.Tower.Config import Ivory.OS.FreeRTOS.Tower.STM32 import BSP.Tests.Platforms import BSP.Tests.UART.TestApp (app) main :: IO () main = compileTowerSTM32FreeRTOS testplatform_stm32 p $ app testplatform_leds (stm32config_clock . testplatform_stm32) testpla...
GaloisInc/ivory-tower-stm32
ivory-bsp-tests/tests/UARTTest.hs
bsd-3-clause
386
0
8
75
89
51
38
11
1
{-# LANGUAGE CPP #-} ---------------------------------------------------------------------------- -- | -- Module : XMonad.Util.Font -- Description : A module for abstracting a font facility over Core fonts and Xft. -- Copyright : (c) 2007 Andrea Rossato and Spencer Janssen -- License : BSD-style (see xmo...
xmonad/xmonad-contrib
XMonad/Util/Font.hs
bsd-3-clause
7,770
0
19
1,938
2,088
1,073
1,015
102
4
module Prednote.Expressions.Infix ( InfixToken (..) , Paren(..) , createRPN ) where import qualified Prednote.Expressions.RPN as R import qualified Data.Foldable as Fdbl data InfixToken f a = TokRPN (R.RPNToken f a) | TokParen Paren data Paren = Open | Close -- | Values on the operator stack. data OpSta...
massysett/prednote
lib/Prednote/Expressions/Infix.hs
bsd-3-clause
4,262
0
17
913
1,059
583
476
69
4
{-# LINE 1 "GHC.IO.BufferedIO.hs" #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_GHC -funbox-strict-fields #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.IO.BufferedIO -- Copyright : (c) The University of Glasgow 2008 -- ...
phischu/fragnix
builtins/base/GHC.IO.BufferedIO.hs
bsd-3-clause
5,018
0
15
1,073
848
461
387
50
2
module Language.Pankti.Parser ( parsePktFile ) where import Text.Parsec import Text.Parsec.String import Text.Parsec.Token import Control.Applicative hiding (many, (<|>)) import Language.Pankti.AST -- | Parse .pkt Pankti file parsePktFile :: FilePath -> IO (Either ParseError Pankti) parsePktFile = parseFromFile...
srujun/Pankti
src/Language/Pankti/Parser.hs
mit
4,051
0
15
1,588
868
428
440
82
7
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeApplications #-} import Control.Applicative (empty) import Control.Exception.Safe (throwString) import Control.Lens (at, (^.)) import Control.Monad.Trans (liftIO) import Control.Monad....
input-output-hk/pos-haskell-prototype
networking/bench/LogReader/Main.hs
mit
4,815
0
20
1,392
1,511
823
688
100
4
module Test.Auxx.Lang.LexerSpec ( spec ) where import Universum import Test.Hspec (Expectation, Spec, describe, it, shouldBe) import Test.Hspec.QuickCheck (prop) import Test.QuickCheck (Property, property) import Pos.Chain.Update (ApplicationName (..), ...
input-output-hk/pos-haskell-prototype
auxx/test/Test/Auxx/Lang/LexerSpec.hs
mit
3,225
0
11
769
546
308
238
-1
-1
module Projections ( wrap , alt , sliding_wave , bounded_sin , scale , shift , affine ) where import Data.Fixed -- Wraps wrap :: (Fractional a, Real a) => a -> a wrap x = x `mod'` 1.0 alt :: Num a => a -> a alt x = 1 - abs(1-2*x) -- Wave sliding_wave :: (Fractional a, Floating a) => a -> a -> a -> a -> a sliding_wa...
Ni-Br/luminifu
brain/Projections.hs
mit
676
0
11
169
367
198
169
24
1
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Arbitrary where import Control.Applicative hiding (empty) import Data.Text (Text) import qualified Data.Text as Text import qualified Data.Text.IO as Text import Data.String import Test.QuickCheck ...
sol/config-ng
test/Arbitrary.hs
mit
3,832
0
15
811
1,350
720
630
100
3
{-- snippet all --} import Data.Bits import Network.Socket import Network.BSD import Data.List import Control.Concurrent import Control.Concurrent.MVar import System.IO type HandlerFunc = SockAddr -> String -> IO () serveLog :: String -- ^ Port number or name; 514 is default -> HandlerFunc ...
binesiyu/ifl
examples/ch27/syslogtcpserver.hs
mit
2,706
0
15
886
495
245
250
45
1
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="de-DE"> <title>Sequence Scanner | ZAP Extension</title> <maps> <homeID>top</homeID> <m...
veggiespam/zap-extensions
addOns/sequence/src/main/javahelp/org/zaproxy/zap/extension/sequence/resources/help_de_DE/helpset_de_DE.hs
apache-2.0
978
80
66
160
415
210
205
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-iam/gen/Network/AWS/IAM/GetAccountSummary.hs
mpl-2.0
6,930
0
10
1,270
505
364
141
46
1
{-# LANGUAGE DeriveFunctor #-} module Distribution.Solver.Modular.Flag ( FInfo(..) , Flag , FlagInfo , FN(..) , QFN , QSN , SN(..) , mkFlag , showFBool , showQFN , showQFNBool , showQSN , showQSNBool ) where import Data.Map as M import Prelude hiding (pi) import...
bennofs/cabal
cabal-install/Distribution/Solver/Modular/Flag.hs
bsd-3-clause
2,069
0
8
449
642
353
289
51
1
data Lens s a = Lens { set :: s -> a -> s, view :: s -> a } view :: Lens s a -> s -> a set :: Lens s a -> s -> a -> s
junnf/Functional-Programming
codes/lens.hs
unlicense
169
0
10
91
76
41
35
4
0
module MoveDefSpec (main, spec) where import Test.Hspec import Language.Haskell.Refact.Refactoring.MoveDef import System.Directory import TestUtils -- --------------------------------------------------------------------- main :: IO () main = do hspec spec spec :: Spec spec = do -- -----------------...
RefactoringTools/HaRe
test/MoveDefSpec.hs
bsd-3-clause
41,062
0
18
7,806
5,424
2,680
2,744
414
1
-- -- Adapted from the program "infer", believed to have been originally -- authored by Philip Wadler, and used in the nofib benchmark suite -- since at least the late 90s. -- module Main where import Parse import Lex import Term import Type import Environment import InferMonad import Infer import Control.Monad.Par....
seahug/parconc-examples
parinfer/parinfer.hs
bsd-3-clause
1,254
0
15
240
474
256
218
34
2
{-# LANGUAGE PatternGuards #-} {-# LANGUAGE OverloadedStrings #-} module IRTS.CodegenJavaScript (codegenJavaScript, codegenNode, JSTarget(..)) where import IRTS.JavaScript.AST import Idris.AbsSyntax hiding (TypeCase) import IRTS.Bytecode import IRTS.Lang import IRTS.Simplified import IRTS.Defunctionalise import IRTS....
stevejb71/Idris-dev
src/IRTS/CodegenJavaScript.hs
bsd-3-clause
46,309
0
25
16,675
17,488
8,732
8,756
-1
-1
module Range () where import Language.Haskell.Liquid.Prelude goo x = let z = [x] in z z0 _ = True z1 _ = False poo (x:_) = 0 == 0 poo ([]) = liquidAssertB False xs = goo (choose 0) prop1 = liquidAssertB (poo xs)
mightymoose/liquidhaskell
tests/pos/meas0.hs
bsd-3-clause
222
0
9
54
115
61
54
9
1
module Data.ByteString.Utils ( lazifyBS, strictifyBS, randomBS, xorBS, ljust ) where import Control.Monad (replicateM) import Data.Bits (xor) import Data.Function (on) import Data.Random.Instances() import Data.Word (Word8) import System.Random (randomIO) import qualified Data.ByteString as SBS import qualifie...
jgrimes/lamdu
bottlelib/Data/ByteString/Utils.hs
gpl-3.0
901
0
10
144
323
180
143
22
1
module CodeGen.Metadata.DirectImage where import Data.Maybe import Data.List import Data.Serialize import GHC.Generics import Utils.Utils import CodeGen.HaskellCode import Server.NutleyInstance import CodeGen.Metadata.Metadata import Data.Name import Data.Schema import Data.Types import CodeGen.TupleUtils import Cod...
jvictor0/JoSQL
CodeGen/Metadata/DirectImage.hs
mit
1,736
2
18
425
518
278
240
36
1
import Game.Cosanostra.Glue.Instances.JSON () import Game.Cosanostra.Glue.Plan import Game.Cosanostra.Lenses import Control.Lens import qualified Data.ByteString.Char8 as BS import Data.Yaml import System.Environment main :: IO () main = do [gamePath, planPath] <- getArgs game <- either error id <$> decodeEi...
rfw/cosanostra
glue/view-plan.hs
mit
679
0
12
226
181
98
83
17
1
-- | Core options, i.e. the options used by tasty itself {-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} -- for (^) module Test.Tasty.Options.Core ( NumThreads(..) , Timeout(..) , mkTimeout , coreOptions ) where import Data.Typeable import Data.Pr...
SAdams601/ParRegexSearch
test/tasty-0.9.0.1/Test/Tasty/Options/Core.hs
mit
3,294
0
15
777
713
391
322
77
7
{-# LANGUAGE OverloadedStrings #-} import Prelude hiding (putStrLn, readFile) import qualified Prelude as P import Control.Monad import System.Directory import System.Environment import System.FilePath import System.Posix.Files import Data.Char import Data.ByteString.Char8 import qualified Data.ByteString.Char8 as ...
bhamrick/puzzlib
analyze_corpus/GetWords.hs
mit
1,886
0
18
473
509
270
239
43
3
{-# LANGUAGE LambdaCase #-} module Oden.Core.Package where import Oden.Identifier import Oden.Metadata import Oden.SourceInfo import Oden.QualifiedName (PackageName) data PackageDeclaration = PackageDeclaration { packageDeclarationSourceInfo :: Metadata SourceInfo ...
oden-lang/oden
src/Oden/Core/Package.hs
mit
1,056
0
11
258
252
134
118
28
0
{-# htermination genericDrop :: Int -> [a] -> [a] #-} import List
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/List_genericDrop_1.hs
mit
66
0
3
12
5
3
2
1
0
{-# LANGUAGE GeneralizedNewtypeDeriving, PatternSynonyms #-} {-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} {-# OPTIONS_HADDOCK not-home #-} module Data.Urn.Internal ( -- * Types -- ** Parameters of the trees Weight, Index(..), Size(..), -- ** Tree types (and constructors) BTree(..), WTree(..), pattern WL...
antalsz/urn-random
src/Data/Urn/Internal.hs
mit
6,912
0
16
2,190
2,693
1,441
1,252
139
3
-- | Athena.Utils.Show module. -- Adapted from https://github.com/asr/apia. {-# LANGUAGE CPP #-} {-# LANGUAGE UnicodeSyntax #-} module Athena.Utils.Show ( showListLn , showLn ) where ------------------------------------------------------------------------------ -- | Version of 'show' adding a newlin...
jonaprieto/athena
src/Athena/Utils/Show.hs
mit
584
0
7
103
94
55
39
10
1
-- TP 2 - Dragon -- Ferlicot-Delbecque Cyril. module Main where import Graphics.Gloss main::IO() main = animate(InWindow "Dragon" (500, 500) (200, 200)) white (dragonAnime' (50,250) (450,250)) dragonAnime :: RealFrac a => Point -> Point -> a -> Picture dragonAnime a b t = Line (dragon a b !! (round t `mod` 18)) -- ...
jecisc/TP_PF_L3
PF-TP2/src/Main.hs
mit
1,954
8
16
451
1,001
534
467
39
3
{-# LANGUAGE GADTs #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UnicodeSyntax #-} module Graphics.PlotDSL where import Control.Applicative import Control.Monad import Control.Monad.Trans.RWS import Data.Char import Data.List (intercalate) import System.Process...
damianfral/PlotDSL
src/Graphics/PlotDSL.hs
mit
5,688
0
12
1,308
2,023
1,038
985
-1
-1
{-#OPTIONS_GHC -fno-warn-unused-do-bind #-} module GraphQL.Language.Parser where import Control.Applicative hiding (many, (<|>)) import Data.Monoid import Text.Parsec import Text.Parsec.String -- | Alias for NamedType newtype TypeCondition = TypeCondition Name data Token = ...
5outh/graphql-hs
src/GraphQL/Language/Parser.hs
mit
5,417
0
14
1,324
1,660
891
769
155
2
module PPL2.VM.Memory.Segment (Segment, get, put, new, newInit, toDataRef, dump) where import PPL2.Prelude () import PPL2.VM.Types import qualified Data.IntMap as M import qualified Data.List as L -- ---------------------------------------- -- A segment has a size and an IntMap for storing values data Se...
UweSchmidt/ppl2
src/PPL2/VM/Memory/Segment.hs
mit
1,472
0
13
345
531
278
253
32
1
/*Owner & Copyrights: Vance King Saxbe. A.*//* Copyright (c) <2014> Author Vance King Saxbe. A, and contributors Power Dominion Enterprise, Precieux Consulting and other contributors. Modelled, Architected and designed by Vance King Saxbe. A. with the geeks from GoldSax Consulting and GoldSax Technologies email @vsaxbe...
VanceKingSaxbeA/GoldSaxMachineStore
GoldSaxMachineModule13/src/Chapter13/GADTs.hs
mit
3,794
23
16
1,150
860
438
422
-1
-1
module Craft3e where import E'10''1 import E'10''2 import E'10''3 import E'10''4 import E'10''5 import E'10''6 import E'10''7 import E'10''8 import E'10''9 import E'10'10 import E'10'11 import E'10'12 import E'10'13 import E'10'14 import E'10'15 import E'10'16 import E'10'17 import E'10'18 import E'10'19 import E'10'2...
pascal-knodel/haskell-craft
_/links/Craft3e.hs
mit
5,096
0
3
712
1,066
711
355
355
0
{-# LANGUAGE ExistentialQuantification, TemplateHaskell, StandaloneDeriving #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Implementation of the opcodes. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Google Inc. This program is free software; you can redistribute it and/or modify it under the terms of the ...
ribag/ganeti-experiments
src/Ganeti/OpCodes.hs
gpl-2.0
28,651
0
12
7,404
5,779
3,534
2,245
926
2
-------------------------------------------------------------------------------- -- | The Pandoc AST is not extensible, so we need to use another way to model -- different parts of slides that we want to appear bit by bit. -- -- We do this by modelling a slide as a list of instructions, that manipulate -- the contents ...
jaspervdj/patat
lib/Patat/Presentation/Instruction.hs
gpl-2.0
3,514
0
11
819
1,073
564
509
67
7
{- | Module : $EmptyHeader$ Description : <optional short description entry> Copyright : (c) <Authors or Affiliations> License : GPLv2 or higher, see LICENSE.txt Maintainer : <email> Stability : unstable | experimental | provisional | stable | frozen Portability : portable | non-portable (<reason>...
nevrenato/Hets_Fork
mini/Grothendieck.hs
gpl-2.0
1,956
0
9
556
569
321
248
-1
-1
-- data Bool = False | True data Day = Day | Mon | Tue | Wed | Thu | Fri | Sat | Sun deriving (Show, Eq, Ord, Enum, Read) tomorrow :: Day -> Day tomorrow Sun = Mon tomorrow d = succ d yesterday :: Day -> Day yesterday Mon = Sun yesterday d = pred d type Name = String type Author = String type ISBN = String type P...
dalonng/hellos
haskell.hello/dataType.hs
gpl-2.0
1,672
24
8
456
599
325
274
42
2
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE StandaloneDeriving #-} module Blaaargh.Internal.Post ( getTimeStamp , parsePersons , collectPosts , recentPosts , chronologicalPosts , reverseChronologicalPosts , alphabeticalPosts ,...
gregorycollins/blaaargh
src/Blaaargh/Internal/Post.hs
gpl-2.0
10,240
37
17
2,928
2,712
1,480
1,232
211
5
-- Compiler Toolkit: test routines for state modules -- -- Author : Manuel M. T. Chakravarty -- Created: 2 November 95 -- -- Copyright (c) [1995..1998] Manuel M. T. Chakravarty -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as publis...
jrockway/c2hs
tests/state.hs
gpl-2.0
3,307
75
16
972
542
301
241
53
1
{- | Module : $Header$ Description : General connection to the database Copyright : (c) Immanuel Normann, Uni Bremen 2007 License : GPLv2 or higher, see LICENSE.txt Maintainer : inormann@jacobs-university.de Stability : provisional Portability : portable -} module Search.DB.Connection where impor...
nevrenato/Hets_Fork
Search/DB/Connection.hs
gpl-2.0
7,425
111
20
2,062
1,490
823
667
104
1
module Operate.Param where import qualified Control.Passwort import Control.Types ( Wert ) import Inter.Types ( Variant, Make ) import Operate.Click import Control.Types -- import qualified Text.XHtml import qualified Gateway.Html as H -- | CGI - Zustands-Daten data Type = Param { -- | configured ...
marcellussiegburg/autotool
db/src/Operate/Param.hs
gpl-2.0
2,383
2
10
866
549
316
233
62
2
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeSynonymInstances #-} --FIXME only needed for debug code {-# LANGUAGE FlexibleInstances #-} --dito {- Concurrent Hashmap - Copyright (C) 2014 Mathias Bartl This program is free software: you can redistribute it a...
MathiasBartl/Concurrent_Datastructures
Data/HashTable/Concurrent.hs
gpl-2.0
50,050
539
26
12,581
10,726
5,600
5,126
637
15
import Hledger (tests_Hledger) import Test.Framework.Providers.HUnit (hUnitTestToTests) import Test.Framework.Runners.Console (defaultMain) main :: IO () main = defaultMain $ hUnitTestToTests tests_Hledger
kmels/hledger
hledger-lib/tests/suite.hs
gpl-3.0
207
0
6
20
55
32
23
5
1
{-# LANGUAGE MagicHash, FlexibleContexts, DataKinds, TypeFamilies #-} module Http(get,post) where import Java foreign import java unsafe "@static HttpsRequest.get" get :: String -> Maybe String foreign import java unsafe "@static HttpsRequest.post" post :: String -> String -> Maybe String
koerriva/paygate
src/Http.hs
gpl-3.0
296
7
4
44
62
35
27
-1
-1
-- | Decentralized MDP -- Based on an email exchange with Ashutosh Nayyar module Data.Teams.Examples.DecMdp where import Data.Teams.Structure x = mkNonReward "x" u1 = mkNonReward "u1" u2 = mkNonReward "u2" r = mkReward "r" f = mkStochastic "f" g1 = mkControl "g1" g2 = mkControl "g2" d = mkStochastic "d...
adityam/teams
Data/Teams/Examples/DecMdp.hs
gpl-3.0
636
0
18
145
344
181
163
16
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dlp/gen/Network/Google/Resource/DLP/Projects/Locations/StoredInfoTypes/Create.hs
mpl-2.0
7,060
0
17
1,397
797
472
325
122
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-cloudkms/gen/Network/Google/Resource/CloudKMS/Projects/Locations/KeyRings/CryptoKeys/CryptoKeyVersions/Restore.hs
mpl-2.0
7,185
0
16
1,393
787
462
325
127
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-analytics/gen/Network/Google/Resource/Analytics/Management/Goals/Update.hs
mpl-2.0
4,526
0
20
1,115
624
368
256
100
1
{-# LANGUAGE ScopedTypeVariables, LambdaCase, GeneralizedNewtypeDeriving #-} module Chess where { import Data.List; import Control.Monad; import Data.Maybe; import Data.Array.IArray; import Debug.Trace; import Retrograde; import Data.Map.Strict(Map); import qualified Data.Map.Strict as Map; import qualified Data.Set as...
kenta2/retrograde
Chess.hs
agpl-3.0
23,150
0
21
4,068
9,366
5,108
4,258
-1
-1
import Data.List isAnagram x y = sort x == sort y
nstarke/icc13-introduction-to-haskell
anagram.hs
lgpl-3.0
50
0
6
11
26
12
14
2
1
module Probability.BreakTest (breakTest) where import Test.HUnit import Data.Ratio ((%)) import Data.Set (fromList, size) import Probability.Event import Probability.Break assertBreak :: Ord a => Rational -> [a] -> [Integer] -> Assertion assertBreak expected set break = expected @=? probability (Break (fromList set) ...
Sventimir/bridge-tools
Probability/BreakTest.hs
apache-2.0
2,850
0
16
679
1,184
662
522
58
1
module StronglyLiveVariables ( runAnalysis ) where import Data.Graph.Inductive.Graph (labNodes, edges) import Data.Graph.Inductive.PatriciaTree (Gr) import Data.Set (Set) import qualified Data.Set as Set import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map import Data.Maybe (fromMaybe) import Data....
aochagavia/CompilerConstruction
mf/src/StronglyLiveVariables.hs
apache-2.0
3,019
0
11
496
1,393
712
681
63
1
module Interface.Clp where -- standard modules import Data.List import Data.Maybe import System.IO import System.IO.Unsafe import System.Process -- local modules import Helpful.Directory --import Data.Time.Clock (diffUTCTime, getCurrentTime) --import Debug.Trace zeroObjective :: String -> Maybe Bool zeroObjective p...
spatial-reasoning/zeno
src/Interface/Clp.hs
bsd-2-clause
1,232
0
22
306
278
144
134
28
5
module Calculus.Opra16 ( module Calculus.Opra , Opra16(..) ) where -- standard modules -- local modules import Basics import Calculus.Opra data Opra16 = Opra16_0_0 | Opra16_0_1 | Opra16_0_2 | Opra16_0_3 | Opra16_0_4 | Opra16_0_5 | Opra16_0_6 | Opra16_0_7 | Opra16_0_8 ...
spatial-reasoning/zeno
src/Calculus/Opra16.hs
bsd-2-clause
75,343
0
6
22,142
12,634
8,405
4,229
1,059
0