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
import Test.HUnit (Assertion, (@=?), runTestTT, Test(..), Counts(..)) import System.Exit (ExitCode(..), exitWith) import DNA (toRNA) exitProperly :: IO Counts -> IO () exitProperly m = do counts <- m exitWith $ if failures counts /= 0 || errors counts /= 0 then ExitFailure 1 else ExitSuccess testCase :: String ->...
basbossink/exercism
haskell/rna-transcription/rna-transcription_test.hs
gpl-3.0
892
0
12
172
288
150
138
23
2
{-# LANGUAGE QuasiQuotes #-} module Nirum.Docs.HtmlSpec where import Test.Hspec.Meta import Text.InterpolatedString.Perl6 (q) import Nirum.Docs (Html) import Nirum.Docs.Html (render) import Nirum.DocsSpec (sampleDocument) expectedHtml :: Html expectedHtml = [q|<h1>Hello</h1> <p>Tight list:</p> <ul> <li>List test</li...
spoqa/nirum
test/Nirum/Docs/HtmlSpec.hs
gpl-3.0
623
0
8
89
103
63
40
14
1
{-| A simple 'Amount' is some quantity of money, shares, or anything else. It has a (possibly null) 'CommoditySymbol' and a numeric quantity: @ $1 £-50 EUR 3.44 GOOG 500 1.5h 90 apples 0 @ It may also have an assigned 'Price', representing this amount's per-unit or total cost in a different commodity. I...
adept/hledger
hledger-lib/Hledger/Data/Amount.hs
gpl-3.0
46,894
0
20
9,211
9,917
5,329
4,588
604
7
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-ecs/gen/Network/AWS/ECS/DeleteCluster.hs
mpl-2.0
3,636
0
9
787
452
276
176
56
1
module Data.Conf (Conf, readConf, getConf, parseConf) where import Control.Monad import Text.Read import Data.Conf.Parser getConf :: Read a => String -> Conf -> Maybe a getConf key conf = lookup key conf >>= readMaybe readConf :: String -> IO [(String, String)] readConf = liftM parseConf . readFile
carymrobbins/intellij-haskforce
tests/gold/cabal/completion/Module00001/src/Data/Conf.hs
apache-2.0
303
0
8
49
111
61
50
8
1
module Main (main) where import RIO -- import Criterion.Main import qualified Test001 -- import qualified Test002 -- import qualified Test003 -- import qualified Test004 -- import qualified Test005 -- import qualified Test006 -- import qualified Test007 -- import qualified Test008 -- import qualified Test00...
kongra/kask-base
app/Main.hs
bsd-3-clause
973
0
6
235
63
50
13
6
1
{-# LANGUAGE CPP, UnboxedTuples, MagicHash #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} -- -- (c) The University of Glasgow 2002-2006 -- -- --------------------------------------------------------------------------- -- The dynamic linker for object code (.o .so .dll files) -- --------------------------------...
olsner/ghc
libraries/ghci/GHCi/ObjLink.hs
bsd-3-clause
6,297
0
17
1,410
1,235
641
594
104
2
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- | Parsing the top of a Haskell source file to get its module name, -- imports and options. -- -- (c) Simon Marlow 2005 -- (c) Lemmih 2006 -- -------------------------------------------------------------------------...
nushio3/ghc
compiler/main/HeaderInfo.hs
bsd-3-clause
14,338
0
26
4,519
2,968
1,524
1,444
233
19
{-# LANGUAGE TypeFamilies #-} module T9840 where import Data.Kind (Type) import T9840a type family X :: Type -> Type where type family F (a :: Type -> Type) where foo :: G (F X) -> G (F X) foo x = x
sdiehl/ghc
testsuite/tests/indexed-types/should_compile/T9840.hs
bsd-3-clause
204
0
8
47
83
48
35
-1
-1
{- (c) Bartosz Nitka, Facebook, 2015 UniqDFM: Specialised deterministic finite maps, for things with @Uniques@. Basically, the things need to be in class @Uniquable@, and we use the @getUnique@ method to grab their @Uniques@. This is very similar to @UniqFM@, the major difference being that the order of folding is n...
ezyang/ghc
compiler/utils/UniqDFM.hs
bsd-3-clause
15,285
0
13
3,410
3,703
1,947
1,756
206
3
{-# LANGUAGE CPP #-} module RegAlloc.Graph.TrivColorable ( trivColorable, ) where #include "HsVersions.h" import RegClass import Reg import GraphBase import UniqFM import Platform import Panic -- trivColorable --------------------------------------------------------------- -- trivColorable function for ...
snoyberg/ghc
compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs
bsd-3-clause
12,313
0
15
4,752
1,061
527
534
116
49
----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Haddock -- Copyright : Isaac Jones 2003-2005 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This module deals with the @haddock@ and @hscolour...
enolan/cabal
Cabal/Distribution/Simple/Haddock.hs
bsd-3-clause
33,763
0
26
10,385
7,568
3,973
3,595
624
7
module Meas () where import Language.Haskell.Liquid.Prelude prop1 = map choo [[True]] -- replace [[1]] with [[]] for UNSAT choo (x:xs) = liquidAssertB False -- choo [] = liquidAssertB False -- import qualified Data.Map as M -- import Data.List (foldl') --keyvals :: [(Int, Int)] --keyvals = [(1, 1), (...
mightymoose/liquidhaskell
tests/neg/mapreduce-tiny.hs
bsd-3-clause
665
0
7
138
66
46
20
4
1
module Cmp () where import Language.Haskell.Liquid.Prelude foo x y = case compare x y of EQ -> liquidAssertB (x == y) LT -> liquidAssertB (x < y) GT -> liquidAssertB (x > y) prop = foo n m where n = choose 0 m = choose 1
mightymoose/liquidhaskell
tests/pos/compare.hs
bsd-3-clause
249
0
10
75
109
57
52
10
3
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DataKinds, PolyKinds #-} module T11407 where import Data.Kind type Const a b = a data family UhOh (f :: k1) (a :: k2) (b :: k3) data instance UhOh (f :: * -> * -> *) (a :: x a) (b :: Const * a) = UhOh
sdiehl/ghc
testsuite/tests/dependent/should_fail/T11407.hs
bsd-3-clause
247
0
9
56
94
59
35
7
0
{-# LANGUAGE PackageImports #-} import qualified Network.CGI import qualified Network.Wai.Handler.SimpleServer import qualified Network.Wai.Frontend.MonadCGI import "mtl" Control.Monad.Reader main :: IO () main = Network.Wai.Handler.SimpleServer.run 3000 $ Network.Wai.Frontend.MonadCGI.cgiToAppGeneric mona...
jberryman/wai
wai-frontend-monadcgi/samples/wai_cgi_generic.hs
mit
565
0
8
92
149
83
66
16
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-} module API where import Control.DeepSeq import Data.Aeson import Data.Aeson.Casing import Data.Text (Text) import Data.T...
AndrewRademacher/whimsy
src/API.hs
mit
1,365
0
14
397
332
182
150
41
0
module Main ( main ) where import Prelude import Test.DocTest main :: IO () main = doctest ["-isrc", "src/"]
pbrisbin/yesod-paginator
doctest/Main.hs
mit
120
0
6
30
41
24
17
6
1
module Level ( readLevel , isWall , isGoal , isBlock , pushBlock , isComplete ) where -------------------------------------------------- import qualified Data.Set as S import Coord import Types --------------------------...
stuhacking/Sokoban
src/Level.hs
mit
2,485
0
13
736
676
353
323
50
5
module Oodle.ParseTree where import Oodle.Token (Token, fakeToken) data Start = Start [Class] deriving (Show, Eq) data Class -- [first] Id = Class Name -- [second] Id = Parent Name = Class Token Id Id [Var] [Method] deriving (Show, Eq) data Var = Var Token Id Type Expression deri...
lseelenbinder/oodle-compiler
Oodle/ParseTree.hs
mit
4,344
5
10
1,375
1,262
679
583
114
24
{- Wojciech Pratkowiecki nr indeksu: 281417 -} import Slownie import qualified System.Environment as SE aud = Waluta "dolar australijski" "dolary australijskie" "dolarów australijskich" Meski bgn = Waluta "lew bułgarski" "lewy bułgarskie" "lewów bułgarskich" Meski brl = Waluta "real" "reale" "realów" Meski byr = Walut...
wiatrak2/Metody_programowania
waluty_slownie/Main.hs
mit
3,168
2
10
535
767
386
381
76
34
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module Language.BrainHask.Interpreter ( MachineMemory, MachineIO(..), Machine(..), MachineM, interpretBF) where import Control.Applicative import Control....
damianfral/BrainHask
src/Language/BrainHask/Interpreter.hs
mit
1,891
0
12
495
636
322
314
45
1
module Parametricity where -- Try to create a fully polymorphic function that changes it's parameter -- Impossible but try anyway polyForDays a = a ++ " impossible" -- Two versions of a -> a -> a versionOne a = a + a versionTwo a = a ++ a -- a -> b -> b, as many implementations as you can aAndBOne a b = a + b aAndBT...
rasheedja/HaskellFromFirstPrinciples
Chapter5/parametricity.hs
mit
431
0
5
103
117
61
56
9
1
{-# LANGUAGE TypeFamilies #-} module SoOSiM.Components.MemoryManager.Interface where import SoOSiM import {-# SOURCE #-} SoOSiM.Components.MemoryManager.Behaviour (memMgr) import SoOSiM.Components.MemoryManager.Types data MemoryManager = MemoryManager instance ComponentInterface MemoryManager where type State Memo...
christiaanb/SoOSiM-components
src/SoOSiM/Components/MemoryManager/Interface.hs
mit
2,010
0
15
441
649
323
326
38
2
module Main (main) where import qualified Graphics.UI.SDL as SDL import qualified Graphics.UI.SDL.Image as Image import Shared.Input import Shared.Lifecycle import Shared.Polling import Shared.Utilities title :: String title = "lesson07" size :: ScreenSize size = (640, 480) inWindow :: (SDL.Window -> IO ()) -> IO ...
oldmanmike/haskellSDL2Examples
src/lesson07.hs
gpl-2.0
1,110
0
14
185
351
178
173
27
1
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances #-} {- Instance of class Logic for EVTs -} module EVT.Logic where import Common.DocUtils import Common.Id import Data.Monoid import Logic.Logic import EVT.AS import EVT.Sign import EVT.ParseEVT import EVT.ATC_EVT () --import EVT.StaticAnalysis import CASL...
mariefarrell/Hets
EVT/Logic.hs
gpl-2.0
3,492
5
8
1,163
597
324
273
66
0
-- -- Copyright (c) 2014 Citrix Systems, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This progra...
OpenXT/network
nws/NetworkUtils.hs
gpl-2.0
11,151
0
20
3,201
2,635
1,338
1,297
213
4
module CornerPoints.FaceExtractAndConvert(getFrontFaceAsBackFace, getFrontLeftLineAsBackFace, getLeftFaceAsBackFace, getFrontRightLineAsBackFace, getRightFaceAsBackFace, getBackRightLineAsBackFace) where import CornerPoints.FaceConversions import CornerPoints.FaceExtraction {- ...
heathweiss/Tricad
src/CornerPoints/FaceExtractAndConvert.hs
gpl-2.0
1,016
0
6
127
127
66
61
10
1
-- BEE_Reinas.hs -- El problema de las n reinas mediante BEE. -- José A. Alonso Jiménez https://jaalonso.github.com -- ===================================================================== module Tema_23.BEE_Reinas where -- Hay que elegir una implementación import Tema_23.BusquedaEnEspaciosDeEstados -- import I1M.Bus...
jaalonso/I1M-Cod-Temas
src/Tema_23/BEE_Reinas.hs
gpl-2.0
2,584
0
15
490
408
247
161
22
1
{-# LANGUAGE LambdaCase #-} module Utils.Yukari.Crawler (crawlFromURL, crawlFromFile , getSinglePage, torrentFilter) where import Control.Lens hiding ((<.>)) import Control.Applicative import Control.Arrow ((&&&)) import Control.Monad import qualified Data.Byte...
Fuuzetsu/yukari
src/Utils/Yukari/Crawler.hs
gpl-3.0
8,033
0
21
2,561
1,965
998
967
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-deploymentmanager/gen/Network/Google/Resource/DeploymentManager/Deployments/Insert.hs
mpl-2.0
4,202
0
16
945
482
290
192
73
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/List.hs
mpl-2.0
8,273
0
25
2,025
1,293
743
550
180
1
#! /usr/bin/env runhaskell import Debug.Trace import Control.DeepSeq loadProblem :: IO [[Int]] loadProblem = do fileStr <- readFile "euler-011.txt" let fileLined = lines fileStr fileWords = fmap words fileLined fileInt = fmap (fmap read) fileWords return fileInt getItem :: Int -> Int -> [[a]] -> ...
yuvallanger/project-euler
euler-011.hs
agpl-3.0
1,651
0
12
453
864
474
390
37
1
module Utils.STM where import Control.Concurrent.STM import Control.Exception import Gonimo.Server.Error (ServerError (TransactionTimeout), makeServantErr) import Utils.Constants gTimeoutSTM :: Exception e => Int -> STM (Maybe a) -> e...
gonimo/gonimo-back
src/Utils/STM.hs
agpl-3.0
832
0
13
273
196
99
97
16
2
-- http://adventofcode.com/2015/day/2 import Data.List.Split import Data.List main :: IO() main = do stdin <- getContents let squareFeet = inputToSquareFeet stdin putStrLn $ "The elves require " ++ show squareFeet ++ " feet of ribbon" -- use Int insead of Word for simplicity/performance's sake -- I used a...
bennett000/advent-of-code
src/2015/2/b/hs/solution.hs
lgpl-3.0
1,628
0
12
303
395
201
194
33
1
module DistinctMidpoints.A285492Spec (main, spec) where import Test.Hspec import DistinctMidpoints.A285492 (a285492) main :: IO () main = hspec spec spec :: Spec spec = describe "A285492" $ it "correctly computes the first 20 elements" $ take 20 (map a285492 [1..]) `shouldBe` expectedValue where expectedV...
peterokagey/haskellOEIS
test/DistinctMidpoints/A285492Spec.hs
apache-2.0
380
0
10
59
160
95
65
10
1
module Database.Neo4j.Util.BinaryValue( BinaryValue, toBinaryValue, fromBinaryValue ) where import Control.Applicative (liftA) import Data.Binary (Binary, get, put) import Database.Neo4j.Internal.Packstream.Atom (Atom) import ...
boggle/neo4j-haskell-driver
src/Database/Neo4j/Util/BinaryValue.hs
apache-2.0
895
0
7
221
224
127
97
19
1
module Database.CDB.Read ( CDB(), cdbInit, cdbGet, cdbGetAll, cdbHasKey, cdbCount ) where import Control.Monad import Data.Bits import qualified Data.ByteString as ByteString import Data.ByteString (ByteString) import Data.Word import Database.CDB.Packable import Database.CDB.Util import System.IO.Posix.MM...
adamsmasher/hs-cdb
Database/CDB/Read.hs
bsd-2-clause
3,388
0
21
857
1,116
597
519
75
4
module Llvm.Pass.PassManager where import Llvm.Hir.Data import Llvm.Pass.Mem2Reg import Llvm.Pass.Liveness import qualified Data.Set as Ds import Llvm.Pass.Optimizer import Compiler.Hoopl data Step = Mem2Reg | Dce | PrepareRw deriving (Show,Eq) toPass :: (CheckpointMonad m, FuelMonad m) => Step ...
sanjoy/hLLVM
src/Llvm/Pass/PassManager.hs
bsd-3-clause
794
0
11
163
307
165
142
18
1
import TestName
YoshikuniJujo/papillon
test/testName.hs
bsd-3-clause
16
0
3
2
4
2
2
1
0
import Text.Regex.PDeriv.Debug.Refine10 import System.Environment import qualified Data.ByteString.Char8 as S g = [(1::Int, Pair 0 (Any 90) (Star 0 (Any 90)))] main :: IO () main = do (filename:args) <- getArgs file <- S.readFile filename print $ test2 g ".*<h1 class=\"header-gray\">[\n\r]*([a-zA-Z;&, \\\n\t\...
luzhuomi/pddebug
test/File.hs
bsd-3-clause
391
0
11
62
123
67
56
9
1
module HGraph.Edge where import Control.Monad.State import qualified Data.Map as M import qualified Data.Maybe as MB import qualified Data.Text as T import HGraph.Graph import HGraph.Label import HGraph.Node import HGraph.Types edgeKeyBla...
gpahal/hgraph
src/HGraph/Edge.hs
bsd-3-clause
7,307
0
12
2,236
2,505
1,240
1,265
137
2
module Util where -- use tick -- use lastBlock import Import import Data.Int (Int64) import Control.Monad (mzero) import Data.Aeson import Data.Time.Clock import Data.Text (unpack) import Network.HTTP.Types.URI (urlEncode) import Numeric (showEFloat, fromRat) import qualified Data.HashMap.Strict as HM import Data.Sc...
pirapira/hashprice
Util.hs
bsd-3-clause
7,797
0
17
1,780
2,672
1,327
1,345
253
3
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedLists #-} {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -Wno-missing-signatures #-} module Main ( main ) where import AutoApply import qualified Codec.Picture as JP import ...
expipiplus1/vulkan
examples/compute/Main.hs
bsd-3-clause
19,088
0
20
6,004
3,212
1,756
1,456
-1
-1
module Database.Algebra.SQL.Query where import Data.Scientific import qualified Data.Text as T import qualified Data.Time.Calendar as C -- TODO Do we have to check for validity of types? -- TODO is window clause standard? -- | Mixed datatype for sequences of both types of queries. data Query = QVa...
ulricha/algebra-sql
src/Database/Algebra/SQL/Query.hs
bsd-3-clause
13,687
0
12
5,533
1,373
896
477
223
1
module Main where import Data.Vector as V import Data.Array.Repa import Data.Array.Repa.Repr.Vector import Data.Array.Repa.Algorithms.Matrix import Numeric.Algorithms.HSVO.SVM import Numeric.Algorithms.HSVO.Detail import Control.Monad.State import Control.Monad.Writer import Control.Monad.Reader bVec = V.fromList [0...
johnny555/HSVO
app/Main.hs
bsd-3-clause
1,490
0
10
479
374
214
160
39
1
{-# LANGUAGE ScopedTypeVariables #-} -- |This module defines core functions for tracking the consumption of a -- ByteString, as well as several helper functions for making tracking -- ByteStrings easier. module Data.ByteString.Lazy.Progress( trackProgress , trackProgressWithChunkSize -- , ...
acw/bytestring-progress
Data/ByteString/Lazy/Progress.hs
bsd-3-clause
7,473
0
17
2,011
1,761
926
835
120
15
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE UnicodeSyntax #-} {-| [@ISO639-1@] - [@ISO639-2@] - [@ISO639-3@] lld [@Native name@] Ladin [@English name@] Ladin -} module Text.Numeral.Language.LLD ( -- * Lan...
telser/numerals
src/Text/Numeral/Language/LLD.hs
bsd-3-clause
4,636
12
15
1,714
1,324
746
578
89
12
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Stack.Options (BuildCommand(..) ,GlobalOptsContext(..) ,benchOptsParser ,buildOptsParser ,cleanOptsParser ,configCmdSetParser ,configOptsParser ,dockerOptsParser ,dockerCleanupOptsParser ,dotOptsParser ...
harendra-kumar/stack
src/Stack/Options.hs
bsd-3-clause
35,432
0
32
13,778
6,190
3,087
3,103
764
9
{-# LANGUAGE OverloadedStrings #-} module PerformanceTextTest (doText) where import qualified Data.List as L import qualified Data.Vector as V import qualified Data.Text as T import qualified Data.Text.IO as TIO import Data.Monoid import Debug.Trace import Lib type Token = (TokenSpan, T.Text) ty...
clojj/haskell-view
test/PerformanceTextTest.hs
bsd-3-clause
1,252
0
13
344
517
294
223
28
2
----------------------------------------------------------------------------- -- | -- Module : Examples.Basics.QRem -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Testing the sQuotRem and sDivMod -----------------------------------...
Copilot-Language/sbv-for-copilot
SBVUnitTest/Examples/Basics/QRem.hs
bsd-3-clause
1,099
0
13
278
279
159
120
12
1
{-# LANGUAGE OverloadedStrings #-} module Network.HTTP.Dispatch where import Network.HTTP.Dispatch.Types import Network.HTTP.Dispatch.Request import Network.HTTP.Dispatch.Core
owainlewis/http-dispatch
src/Network/HTTP/Dispatch.hs
bsd-3-clause
177
0
4
14
29
21
8
5
0
-- | Download and import feeds from various sources. module HN.Model.Feeds where import HN.Data import HN.Monads import HN.Model.Items import HN.Types import HN.Curl import Control.Applicative import Network.URI import Snap.App import System.Locale import Text.Feed.Import import Text.Feed.Query import Text.Feed.Type...
erantapaa/haskellnews
src/HN/Model/Feeds.hs
bsd-3-clause
5,374
3
19
984
1,216
598
618
101
3
module Scene.World where -- friends import Vec3 import Scene.Light import Scene.Object -- frenemies import Data.Array.Accelerate as A import Graphics.Gloss.Accelerate.Data.Color.RGB makeLights :: Float -> Lights makeLights _time = A.fromList (Z :. 1) [ Light (XYZ 300 (-300) (-1...
tmcdonell/accelerate-ray
Scene/World.hs
bsd-3-clause
1,357
0
19
638
464
246
218
36
1
{-# LANGUAGE Strict #-} module D16Lib where import Util curve :: Int -> String -> String curve len = seq' $ take len . until ((>=len) . length) curveStep curveStep :: String -> String curveStep a = seq' $ a ++ "0" ++ b where b = (map swap . reverse) a swap c = case c of '0' -> '1' '1' -> '0...
wfleming/advent-of-code-2016
2016/src/D16Lib.hs
bsd-3-clause
778
0
10
232
305
154
151
22
3
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} module High.Category.Semigroupal where import High.Functor.Bifunctor (Bifunctor) import High.Isomorphism (Isomorphism) data Semigroupal :: ((* -> *) -> (* -> *) -> *) -> ((* -> *) -> (* -> *) ->...
Hexirp/untypeclass
src/High/Category/Semigroupal.hs
bsd-3-clause
534
0
14
116
187
108
79
12
0
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Zodiac.Cli.TSRP.Error( TSRPError(..) , ParamError(..) , renderTSRPError ) where import qualified Data.Text as T import P import qualified Zodiac.Raw as Z data TSRPError = TSRPNotImplementedError | TSRPParamError...
ambiata/zodiac
zodiac-cli/src/Zodiac/Cli/TSRP/Error.hs
bsd-3-clause
1,264
0
8
207
245
137
108
44
1
module Tc.TcInst where import qualified Data.Map as Map import Language.Haskell.Exts import Tc.Class import Tc.Assumption import Utils.Debug -- this module implements the type instantiation -- algorithm. type Var = Type -- INVARIANT: Always a type variable type InstMap = Map.Map Var Type -- a type class for the...
rodrigogribeiro/mptc
src/Tc/TcInst.hs
bsd-3-clause
1,789
0
9
632
741
375
366
45
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE RankNTypes #-} module Proof where import Language.Haskell.TH import Data.Data (Data) import Data.Typeable (Typeable) import Data.Maybe import Data.Function import Data.List import Control.Applicative import C...
kmyk/proof-haskell
Proof.hs
mit
3,841
0
15
1,166
841
468
373
73
2
{-# LANGUAGE OverloadedStrings, TypeFamilies #-} {- | Module : Routes.ContentTypes Copyright : (c) Anupam Jain 2013 License : MIT (see the file LICENSE) Maintainer : ajnsit@gmail.com Stability : experimental Portability : non-portable (uses ghc extensions) Defines the commonly used content types ...
ajnsit/snap-routes
src/Routes/ContentTypes.hs
mit
2,266
0
7
366
345
216
129
55
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {- Copyright (C) 2010 John MacFarlane <jgm@berkeley.edu> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your optio...
sol/pandoc
src/Text/Pandoc/Pretty.hs
gpl-2.0
15,859
0
16
5,172
4,872
2,507
2,365
363
10
module Hans.Buffer.Signal where import Control.Concurrent (MVar,newEmptyMVar,tryPutMVar,takeMVar,tryTakeMVar) type Signal = MVar () newSignal :: IO Signal newSignal = newEmptyMVar signal :: Signal -> IO () signal var = do _ <- tryPutMVar var () return () waitSignal :: Signal -> IO () waitSignal = takeMVar...
GaloisInc/HaNS
src/Hans/Buffer/Signal.hs
bsd-3-clause
481
0
11
106
176
89
87
17
2
{-# OPTIONS_GHC -Wall #-} module Reporting.Render.Code ( render ) where import Control.Applicative ((<|>)) import Text.PrettyPrint.ANSI.Leijen (Doc, (<>), hardline, dullred, empty, text) import qualified Reporting.Region as R (|>) :: a -> (a -> b) -> b (|>) a f = f a (<==>) :: Doc -> Doc -> Doc (<==...
mgold/Elm
src/Reporting/Render/Code.hs
bsd-3-clause
2,840
0
18
987
896
471
425
81
4
-- | The monad for writing to the game state and related operations. module Game.LambdaHack.Atomic.MonadStateWrite ( MonadStateWrite(..) , updateLevel, updateActor, updateFaction , insertItemContainer, insertItemActor, deleteItemContainer, deleteItemActor , updatePrio, updateFloor, updateTile, updateSmell ) w...
Concomitant/LambdaHack
Game/LambdaHack/Atomic/MonadStateWrite.hs
bsd-3-clause
7,801
0
17
1,836
2,689
1,365
1,324
157
5
module IO ( Handle, HandlePosn, IOMode(ReadMode,WriteMode,AppendMode,ReadWriteMode), BufferMode(NoBuffering,LineBuffering,BlockBuffering), SeekMode(AbsoluteSeek,RelativeSeek,SeekFromEnd), stdin, stdout, stderr, openFile, hClose, hFileSize, hIsEOF, isEOF, hSetBuffering, hGetBuffering, hFlush...
alekar/hugs
packages/haskell98/IO.hs
bsd-3-clause
2,162
0
10
505
474
278
196
44
2
module Numeric.Semiring.Class ( Semiring ) where import Numeric.Algebra.Class
athanclark/algebra
src/Numeric/Semiring/Class.hs
bsd-3-clause
85
0
4
15
18
12
6
3
0
{-# LANGUAGE DeriveGeneric, OverloadedStrings #-} module Network.AWS.S3SimpleTypes where import Control.Applicative import GHC.Generics import qualified Data.ByteString as B import qualified Data.Aeson as A import Data.Yaml (parseJSON, FromJSON, (.:)) data S3Region = US | EU | USWest | APSouthEast | UndefinedRegion de...
KevinCotrone/S3-Simple
src/Network/AWS/S3SimpleTypes.hs
bsd-3-clause
1,650
0
11
365
453
261
192
44
0
{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} module Crypto.Internal.Nat ( type IsDivisibleBy8 , type IsAtMost, type IsAtLeast , byteLen , integralNatVal , type Div8 ...
tekul/cryptonite
Crypto/Internal/Nat.hs
bsd-3-clause
5,108
0
14
1,742
1,942
1,003
939
-1
-1
-- | Infer the remote IP address using headers module Network.Wai.Middleware.RealIp ( realIp , realIpHeader , realIpTrusted , defaultTrusted , ipInRange ) where import qualified Data.ByteString.Char8 as B8 (unpack, split) import qualified Data.IP as IP import Data.Maybe (fromMaybe, mapMaybe, li...
kazu-yamamoto/wai
wai-extra/Network/Wai/Middleware/RealIp.hs
mit
3,324
0
14
742
662
379
283
45
2
module Main where import Happstack.Server import Control.Monad {- interesting urls: /?string=hello+world -} data MyStructure = MyStructure String instance FromData MyStructure where fromData = do str <- look "string" return $ MyStructure str main :: IO () main = do simpleHTTP nullConf $ m...
erantapaa/happstack-server
attic/Examples/set/FromData/Basics.hs
bsd-3-clause
540
0
14
193
127
63
64
14
1
module HTTP ( sendGET , sendGETwH , sendHEAD , sendHEADwH , responseBody , responseStatus , responseHeaders , getHeaderValue , HeaderName ) where import Network.HTTP.Client import Network.HTTP.Types import Data.ByteString import qualified Data.ByteString.Lazy as BL sendGET :: String -> IO (Respo...
creichert/wai
warp/test/HTTP.hs
mit
1,125
0
11
217
343
177
166
34
1
module System.Taffybar.Widget.Generic.DynamicMenu where import Control.Monad.IO.Class import qualified GI.Gtk as Gtk data DynamicMenuConfig = DynamicMenuConfig { dmClickWidget :: Gtk.Widget , dmPopulateMenu :: Gtk.Menu -> IO () } dynamicMenuNew :: MonadIO m => DynamicMenuConfig -> m Gtk.Widget dynami...
teleshoes/taffybar
src/System/Taffybar/Widget/Generic/DynamicMenu.hs
bsd-3-clause
899
0
11
195
256
129
127
22
1
{-# LANGUAGE GADTs #-} {-# OPTIONS_GHC -Wall #-} module Parse (parseCode) where import Control.Monad import Prelude hiding (id, last, succ) -- Note: We do not need to import Hoopl to build an AST. import Ast import Expr import Text.ParserCombinators.Parsec import Text.ParserCombinators.Parsec.Expr...
ezyang/hoopl
testing/Parse.hs
bsd-3-clause
5,156
0
14
1,723
1,762
914
848
150
1
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} ----------------------------------------------------------------------------- -- | -- Module : Aws.DynamoDb.Commands.Query -- Copyright : Soostone Inc -- License : BSD3 -- -- Maintainer : Ozgun Ataman <ozgun.ataman@soostone.com> -- Stabil...
Soostone/aws
Aws/DynamoDb/Commands/Query.hs
bsd-3-clause
5,233
1
19
1,205
891
504
387
-1
-1
{-# LANGUAGE OverloadedStrings #-} module WebParsing.TimeConverter (makeTimeSlots) where import qualified Data.Text as T import Database.Tables -- | Converts days into numbers, returns a tuple of the rest of the string (the times) -- and a list of number representations of days convertTime :: (T.Text, [Double]) ...
tamaralipowski/courseography
hs/WebParsing/TimeConverter.hs
gpl-3.0
2,200
0
14
538
791
412
379
43
2
{-# LANGUAGE CPP, ForeignFunctionInterface #-} module Test where import Control.Concurrent import Control.Monad import Foreign.C -- See also conc059_c.c -- -- This test fires off some threads that will return after the RTS has -- shut down. This should not crash or confuse the RTS. f :: Int -> IO () f x = do prin...
urbanslug/ghc
testsuite/tests/concurrent/should_run/conc059.hs
bsd-3-clause
642
0
12
125
160
84
76
12
1
{-# LANGUAGE OverloadedStrings #-} {- TODO - Support configuration of match rules - Configuration for iptables stuff - Rename (e.g. botblock) -} module Main where import Prelude hiding (lines) import Control.Monad (forM_) import Data.ByteString (ByteString, hGetContents) import Data.ByteStri...
humppa/auth-banner
app/Main.hs
isc
2,830
0
15
607
895
474
421
66
3
{-# LANGUAGE CPP, NoImplicitPrelude #-} module Data.Functor.Product.Compat ( #if MIN_VERSION_base(4,9,0) module Base #endif ) where #if MIN_VERSION_base(4,9,0) import Data.Functor.Product as Base #endif
haskell-compat/base-compat
base-compat/src/Data/Functor/Product/Compat.hs
mit
206
0
4
25
27
21
6
2
0
{-# LANGUAGE OverloadedStrings #-} module Pladen.Beets ( module Pladen.Beets.Types, module Pladen.Beets.DB, )where import Pladen.Beets.Types import Pladen.Beets.DB
geigerzaehler/pladen
Pladen/Beets.hs
mit
173
0
5
25
36
25
11
6
0
------------------------------------------------------------------------------- -- | -- Module : System.Hardware.Arduino.Data -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Underlying data structures -------------------------------...
aufheben/lambda-arduino
packages/hArduino-0.9/System/Hardware/Arduino/Data.hs
mit
26,896
0
22
8,793
5,075
2,701
2,374
360
6
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} -- | This is a cleaned up `HelHUG.Part1` module. -- -- The code is re-arranged into ...
phadej/helhug-types
src/HelHUG/Part1b.hs
mit
5,724
3
12
1,294
948
531
417
65
1
{-# LANGUAGE TemplateHaskell #-} module BasisBladeTests where import Test.Framework.TH import Test.Framework import Test.Framework.Providers.QuickCheck2 import Test.QuickCheck hiding ( (.&.) ) import Data.AEq import Data.Bits import Numeric.GeometricAlgebra.BasisBlade import Numeric.LinearCombination tests = $(test...
pnutus/geometric-algebra
tests/BasisBladeTests.hs
mit
735
0
9
162
263
143
120
22
1
module Data.SQP ( Problem (..) , optimize ) where import Numeric.LinearAlgebra.HMatrix import Numeric.Minimization.QuadProgPP import Debug.Trace data Problem = Problem { _cost :: Vector Double -> Double , _approxCost :: Vector Double -> ...
giogadi/hs-trajopt
lib-src/Data/SQP.hs
mit
11,798
0
20
3,944
2,493
1,323
1,170
226
4
module Hablog.Data ( Page, PageT , getConfig, runDatabase ) where import Hablog.Data.RequestState import Hablog.Data.Page type Page = PageT RequestState IO
garrettpauls/Hablog
src/Hablog/Data.hs
mit
159
0
5
23
43
27
16
6
0
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} module Lib where import Control.Monad.Trans import Crypto.Hash ( Digest ...
aviaviavi/legion
src/Lib.hs
mit
5,221
0
15
1,469
926
507
419
92
3
{-# 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 ...
juodaspaulius/clafer
src/Language/Clafer/Intermediate/ResolverType.hs
mit
21,961
0
30
5,398
6,352
3,190
3,162
-1
-1
module Dicom.StorageSOP.SCU where
danplubell/dicom-network
library/Dicom/StorageSOP/SCU.hs
mit
34
0
3
3
7
5
2
1
0
{-# htermination foldFM_GE :: (Char -> b -> c -> c) -> c -> Char -> FiniteMap Char b -> c #-} import FiniteMap
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/FiniteMap_foldFM_GE_3.hs
mit
111
0
3
24
5
3
2
1
0
{-# LANGUAGE DeriveDataTypeable #-} module SFML.SFException where import Control.Exception import Data.Typeable data SFException = SFException String deriving (Show, Typeable) instance Exception SFException
SFML-haskell/SFML
src/SFML/SFException.hs
mit
219
0
6
34
44
25
19
6
0
module SpaceAge (Planet(..), ageOn) where data Planet = Mercury | Venus | Earth | Mars | Jupiter | Saturn | Uranus | Neptune earthAge :: Float earthAge = 31557600.0 ageOn :: Planet -> Float -> Float ageOn planet seconds = case plan...
mukeshtiwari/Excercism
haskell/space-age/src/SpaceAge.hs
mit
691
0
10
221
210
117
93
22
8
module CommonSpec where import qualified Common as C import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = do describe "fib" $ it "0,1から始まるフィボナッチ数列" $ take 10 C.fib `shouldBe` [0, 1, 1, 2, 3, 5, 8, 13, 21, 34] describe "primes" $ it "素数列" $ take 10 C.primes `shouldBe` [2, 3, ...
yyotti/euler_haskell
test/CommonSpec.hs
mit
4,176
4
32
1,646
2,191
1,348
843
90
1
{-| Module : McCarthy Copyright : (c) Eric Bailey, 2016 License : MIT Maintainer : Eric Bailey Stability : experimental Portability : portable Chapter 8: McCarthy 91 -} module McCarthy ( mc91 ) where -- | The McCarthy 91 function yields @n - 10@ when @n > 100@ and @91@ otherwise. -- The ...
yurrriq/haskell-programming
src/McCarthy.hs
mit
497
0
8
133
80
43
37
5
1
module OrdTest where data Test = A | B deriving Eq instance Ord Test where A <= _ = True B <= B = True _ <= _ = False
antalsz/hs-to-coq
examples/base-tests/OrdTest.hs
mit
125
2
8
37
59
30
29
6
0
module Main where import Control.Monad (unless) import Data.IORef import Graphics.Rendering.OpenGL import Graphics.GLUtil import Graphics.UI.GLUT hiding (exit) import Foreign.Marshal.Array (withArray) import Foreign.Storable (sizeOf) import ...
triplepointfive/hogldev
tutorial13/Tutorial13.hs
mit
5,275
0
18
1,643
1,328
657
671
134
1
{-# Language BlockArguments #-} ----------------------------------------------------------------------------- -- | -- Module : System.OS -- Copyright : (c) ChaosGroup, 2020 -- License : MIT -- -- Maintainer : daniel.taskoff@gmail.com -- Stability : experimental -- -- Get the name of the current opera...
ChaosGroup/system-info
src/System/OS.hs
mit
1,118
0
12
211
182
108
74
-1
-1
module Y2016.M12.D01.Exercise where import Data.Time import Network.HTTP.Conduit -- below import available from 1HaskellADay git repository import Data.Monetary.BitCoin {-- Okay, 7 or 8 data points, one thing. How about a year's worth of data? And instead of monotonically increasing, let's take a data set that go...
geophf/1HaskellADay
exercises/HAD/Y2016/M12/D01/Exercise.hs
mit
1,389
0
8
221
77
45
32
8
1
import Criterion.Main import Control.Monad import Control.DeepSeq import Control.Exception import AuthBench import OneTimeAuthBench import BoxBench import SecretBoxBench import ConstantTimeBench import HashBench import RandomBench import ScalarMultBench import SignBench import StreamBench import PasswordBench import ...
tel/saltine
bench/Main.hs
mit
2,120
0
9
337
441
210
231
62
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotanalytics-dataset-triggeringdataset.html module Stratosphere.ResourceProperties.IoTAnalyticsDatasetTrigger...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/IoTAnalyticsDatasetTriggeringDataset.hs
mit
1,727
0
13
164
174
100
74
23
1
{-# LANGUAGE OverloadedStrings #-} module Y2021.M02.D05.Solution where {-- Okay, yesterday we found lots of duplicates of wine-labels and, digging further, we saw some wines had multiple reviews from the same reviewer, but also, some wines had multiple reviews from multiple reviewers. This begs the question, howeve...
geophf/1HaskellADay
exercises/HAD/Y2021/M02/D05/Solution.hs
mit
4,663
0
10
847
214
131
83
18
1
{-# language TemplateHaskell #-} {-# language DeriveDataTypeable #-} {-# language FlexibleInstances #-} {-# language MultiParamTypeClasses #-} {-# language DisambiguateRecordFields #-} module DPLL.Top where import DPLL.Data import DPLL.Trace -- import DPLL.Pattern import DPLL.Roll import Challenger.Partial import A...
marcellussiegburg/autotool
collection/src/DPLL/Top.hs
gpl-2.0
2,896
0
19
933
820
431
389
71
1