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
-- #hide -------------------------------------------------------------------------------- -- | -- Module : Graphics.UI.GLUT.Callbacks.Registration -- Copyright : (c) Sven Panne 2003 -- License : BSD-style (see the file libraries/GLUT/LICENSE) -- -- Maintainer : sven_panne@yahoo.com -- Stability : pr...
OS2World/DEV-UTIL-HUGS
libraries/Graphics/UI/GLUT/Callbacks/Registration.hs
bsd-3-clause
6,263
0
14
1,063
1,149
612
537
92
3
-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} module NumberSix.Handlers.AlfaPapaTango ( handler ) where -------------------------------------------------------------------------------- import Data.Char (toLower) import qualif...
itkovian/number-six
src/NumberSix/Handlers/AlfaPapaTango.hs
bsd-3-clause
1,954
0
12
517
331
194
137
52
1
----------------------------------------------------------------------------- -- | -- Module : Data.SBV.Examples.Crypto.AES -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- An implementation of AES (Advanced Encryption Standard), usi...
josefs/sbv
Data/SBV/Examples/Crypto/AES.hs
bsd-3-clause
27,000
2
16
5,932
4,786
2,769
2,017
234
2
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1993-1998 A ``lint'' pass to check for Core correctness -} {-# LANGUAGE CPP #-} module CoreLint ( lintCoreBindings, lintUnfolding, lintPassResult, lintInteractiveExpr, lintExpr, lintAnnots, -- ** Debug output ...
oldmanmike/ghc
compiler/coreSyn/CoreLint.hs
bsd-3-clause
79,549
85
22
23,306
17,243
8,970
8,273
1,242
20
{- CIS 194 HW 11 due Monday, 8 April -} module HW11.SExpr where import HW11.AParser import Control.Applicative import Data.Char (isSpace, isAlpha, isAlphaNum) ------------------------------------------------------------ -- 1. Parsing repetitions ------------------------------------------------------------ zero...
cgag/cis-194-solutions
src/HW11/SExpr.hs
bsd-3-clause
1,729
0
10
336
374
208
166
28
1
{-# LANGUAGE PatternGuards #-} ----------------------------------------------------------------------------- -- | -- Module : XMonad.Util.Stack -- Description : Utility functions for manipulating @Maybe Stack@s. -- Copyright : Quentin Moser <moserq@gmail.com> -- License : BSD-style (see LICENSE) -- -- M...
xmonad/xmonad-contrib
XMonad/Util/Stack.hs
bsd-3-clause
13,392
0
14
4,663
4,316
2,241
2,075
207
6
module Y21.D14 where import qualified Data.Map.Strict as M import Imports import Util type Elem = Char type Poly = [Elem] data Pair = Pair Elem Elem deriving (Eq, Ord, Show) data Replacement = Replacement Pair Elem deriving (Show) -- NNCB -- -- CH -> B -- HH -> ...
oshyshko/adventofcode
src/Y21/D14.hs
bsd-3-clause
1,567
0
15
469
680
375
305
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Text.AccentuateUs ( -- $doc Lang , Locale , AUSResponse(..) , LangsStatus(..) , langs , accentuate , feedback ) where import Control.Monad ( liftM ) import Data.Maybe ( fromMaybe ) import Data.Text.Encoding ( decodeUtf8...
michaelschade/hs-accentuateus
src/Text/AccentuateUs.hs
bsd-3-clause
8,420
0
16
2,575
1,805
996
809
131
6
{-# LANGUAGE ExistentialQuantification #-} -------------------------------------------------------------------------------- -- | -- Module : -- Copyright : (c) Galois, Inc, 2009 -- License : AllRightsReserved -- -- Maintainer : Trevor Elliott <trevor@galois.com> -- Stability : -- Portability : -- modu...
glguy/cereal
tests/RoundTrip.hs
bsd-3-clause
2,616
0
11
480
565
295
270
42
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. {-# LANGUAGE OverloadedStrings #-} module Duckling.Numeral.BN.Corpus ( corpus ) where import Data.String im...
facebookincubator/duckling
Duckling/Numeral/BN/Corpus.hs
bsd-3-clause
2,394
0
9
906
508
280
228
63
1
{-# LINE 1 "Foreign.hs" #-} {-# LANGUAGE Safe #-} {-# LANGUAGE NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Foreign -- Copyright : (c) The FFI task force 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Mainta...
phischu/fragnix
builtins/base/Foreign.hs
bsd-3-clause
1,042
0
5
210
111
77
34
19
0
{-# LANGUAGE TypeFamilies #-} module Main where import qualified EFA.Example.Topology.LinearTwo as LinearTwo import EFA.Example.Topology.LinearTwo (Node, node0, node1, node2) import qualified EFA.Application.NestedDelta as NestedDelta import qualified EFA.Application.AssignMap as AssignMap import qualified EFA.Applic...
energyflowanalysis/efa-2.1
demo/additiveTermsStatic/Main.hs
bsd-3-clause
5,966
0
17
1,160
1,580
874
706
150
2
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE StandaloneDeriving #-} #if __GLASGOW_HASKELL__ >= 800 -- a) THQ works on cross-compilers and unregisterised GHCs...
dmjio/aeson
src/Data/Aeson/Types/Internal.hs
bsd-3-clause
27,802
0
14
7,427
5,036
2,846
2,190
450
6
module Machine.ALU (halfAdder ,fullAdder ,addN ,incN ,alu) where import qualified Data.Tuple as Tuple import qualified Machine.Gates as Gates halfAdder :: Bool -> Bool -> (Bool, Bool) halfAdder a b = let carry = Gates.and a b sum ...
btipling/machine-vm
src/Machine/ALU.hs
bsd-3-clause
1,958
0
16
606
676
363
313
41
1
{-# LANGUAGE RecordWildCards #-} -- | Read an __openerp__.py file into a data structure meant to represent it. module OpenERP.Dist.Descriptor where import Control.Monad (filterM) import Data.Char import Data.List (nub) import Data.Monoid import Language.Python.Common.AST import Language.Python.Version2.Parser (parseMo...
noteed/openerpdist
OpenERP/Dist/Descriptor.hs
bsd-3-clause
14,848
0
21
3,132
3,795
2,045
1,750
274
27
module LOGL.FRP ( registerKeyboard, KeyEvent, filterKeyPressE, filterKeyReleaseE, registerWindowSize, WindowSizeEvent, currentTimeB, registerCursorPos, CursorPosEvent, registerScroll, ScrollEvent ) where import Graphics.UI.GLFW as GLFW import Reactive.Banana.Frameworks import Reactive.Banana import...
atwupack/LearnOpenGL
src/LOGL/FRP.hs
bsd-3-clause
2,013
0
11
405
675
356
319
49
1
-- Copyright © 2014 Bart Massey -- [This program is licensed under the "3-clause ('new') BSD License"] -- Please see the file COPYING in the source -- distribution of this software for license terms. import Data.List -- Return a histogram of characters of `text` in count/char -- form. mkHist :: String -> [(Int, Char)...
BartMassey/hcrypta
subst.hs
bsd-3-clause
1,404
0
12
374
354
199
155
22
2
-- | A human-readable version of untyped lambda calculus. module Language.BLC.Parse ( -- * Types Name , Decl(..) , Expr(..) -- * Parsing , parseExpr , parseDecls ) where import Control.Applicative hiding (optional) import Control.Monad.Identity import ...
knrafto/blc
src/Language/BLC/Parse.hs
bsd-3-clause
2,438
0
11
630
725
396
329
63
1
module Logic.ProofStructure --( ProofStructure, ---- constructProofStructure, ---- fromFormulas, --addFormula, -- formulas, -- links, -- hypotheses --) where import Logic.Node import qualified Logic.Link as Link import qualified Data.Map as Map import qualified Data.Set as Set import Data.Maybe -- A map that identifie...
digitalheir/net-prove
src/Logic/ProofStructure.hs
bsd-3-clause
8,215
0
16
1,869
1,335
734
601
76
4
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module VK.API.AuthSpec (main, spec) where import Control.Monad.Trans.State.Lazy (gets) import Network.API.Builder import Test.Hspec import VK.API import TestSettings main :: IO () main = hspec spe...
eryx67/vk-api
test/VK/API/AuthSpec.hs
bsd-3-clause
1,011
0
18
234
283
151
132
26
1
module Main where import qualified Graphics.Gnuplot.Advanced as GP import qualified Graphics.Gnuplot.MultiPlot as MultiPlot import qualified Graphics.Gnuplot.Frame as Frame import qualified Graphics.Gnuplot.Frame.OptionSet as Opts import qualified Graphics.Gnuplot.Frame.OptionSet.Style as OptsStyle import qualified ...
wavewave/gnuplot
src/Demo.hs
bsd-3-clause
6,199
2
23
1,472
2,150
1,169
981
171
1
module Completion (complete, completeFile) where import Data.Maybe import Data.Foldable import Data.List import System.Directory import Filesystem.Path.CurrentOS complete :: String -> [String] -> String complete start alternatives = case filter (isPrefixOf start) alternatives of [x] -> x _ -> start...
kqr/ren
src/Completion.hs
bsd-3-clause
1,228
0
13
343
324
159
165
32
2
{-# LANGUAGE StandaloneDeriving, QuasiQuotes, TypeFamilies, GeneralizedNewtypeDeriving, FlexibleContexts #-} {-# LANGUAGE TemplateHaskell, OverloadedStrings, GADTs, MultiParamTypeClasses #-} {-# LANGUAGE TypeSynonymInstances, FlexibleInstances, DeriveGeneric, ScopedTypeVariables #-} {-# LANGUAGE EmptyDataDecls #-} mod...
Tener/hermitage
src/Hermitage/DbTypes.hs
bsd-3-clause
995
0
7
125
134
76
58
23
0
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ScopedTypeVariables #-} ----------------------------------------------------------------------------- ---- | ---- Module : Crawler ---- Copyright : (c) Rudyard Richter 2015 ---- License : MIT ---- ---- Maintainer : rudyardrichter@uchicago.edu ---- Stabil...
dQuixote/hearch
src/lib/Crawler.hs
mit
9,990
0
16
2,400
1,796
957
839
-1
-1
{-- Copyright (c) 2009 Maciej Pacula Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distr...
petabricks/petabricks
scripts/oldtuner2/src/GP/SymbolTable.hs
mit
5,245
0
13
1,445
927
504
423
56
2
{- | Module : ./Common/SExpr.hs Description : S-Expressions as intermediate output format Copyright : (c) E. Schulz, D. Dietrich, C. Maeder, DFKI 2008 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : portable S-Expressions for ...
spechub/Hets
Common/SExpr.hs
gpl-2.0
1,681
0
11
348
484
254
230
38
2
-- A library for working with the package cache. {- Copyright 2012, 2013, 2014 Colin Woodbury <colingw@gmail.com> This file is part of Aura. Aura 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 ...
joehillen/aura
src/Aura/Cache.hs
gpl-3.0
2,595
0
9
542
567
316
251
52
1
{-# LANGUAGE GADTs, TypeFamilies, ScopedTypeVariables, FlexibleContexts #-} {-# OPTIONS -Wall #-} module Language.Hakaru.Symbolic where import Prelude hiding (Real) data Real data Prob data Measure a data Dist a data Exact class IntComp repr where int :: Integer -> repr Integer class BoolComp re...
bitemyapp/hakaru
Historical/Symbolic.hs
bsd-3-clause
6,242
0
21
1,932
2,454
1,270
1,184
-1
-1
----------------------------------------------------------------------------- -- -- Old-style Cmm data types -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- {-# OPTIONS -fno-warn-tabs #-} -- The above warning supression flag is a temporary ...
mcmaniac/ghc
compiler/cmm/OldCmm.hs
bsd-3-clause
10,235
8
10
2,177
1,560
895
665
-1
-1
-- -- Copyright (c) 2012 Citrix Systems, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This progra...
jean-edouard/manager
storehouse/Tools/Uuid.hs
gpl-2.0
3,777
0
22
858
1,060
577
483
-1
-1
import Numeric.LinearAlgebra.Data import TeraReg.DataGen import TeraReg.LinReg ns :: Int ns = 5000000 vs :: Int vs = 100 w :: Int w = 1000 main :: IO () main = do let (p, r) = generateData $ defaultConfig ns vs -- train let trainp = dropRows w p let trainr = subVector w (ns - w) r -- withheld...
pb-pravin/terareg
validate/Validate.hs
agpl-3.0
657
0
21
182
269
138
131
19
1
module FileUtil where import BasicPrelude ( Eq , FilePath , Hashable , IO , IsString ...
dogweather/nevada-revised-statutes-parser
src/FileUtil.hs
bsd-3-clause
3,483
0
12
1,550
555
315
240
-1
-1
solve [] = [] solve (a:b:rest) = abs(a - b):(solve rest) readInput = (map read) . words writeOutput = unlines . (map show) main = interact (writeOutput . solve . readInput)
Kattis/problemtools
examples/different/submissions/accepted/different.hs
mit
175
0
8
33
101
52
49
5
1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- (c) The University of Glasgow 2006 -- -- The purpose of this module is to transform an HsExpr into a CoreExpr which -- when evaluated, returns a (Meta.Q Meta.Exp) computation analogous to the -- input HsExpr. We do...
spinda/liquidhaskell
src/Language/Haskell/Liquid/Desugar710/DsMeta.hs
bsd-3-clause
120,609
2,209
26
32,600
25,866
15,128
10,738
2,019
16
----------------------------------------------------------------------------- -- | -- Module : RefacSlicTuple -- Copyright : (c) Christopher Brown 2006 -- -- Maintainer : cmb21@kent.ac.uk -- Stability : provisional -- Portability : portable -- -- This module contains a transformation for HaRe. -- Symobli...
kmate/HaRe
old/refactorer/RefacSlicTuple.hs
bsd-3-clause
73,884
98
32
33,519
22,128
11,319
10,809
-1
-1
{-# LANGUAGE CPP, GeneralizedNewtypeDeriving, OverloadedStrings #-} module Haste.Binary.Types ( Blob (..), BlobData (..), blobSize, blobDataSize, toByteString, toBlob, strToBlob ) where import Haste.Prim import Haste.Foreign import qualified Data.ByteString.Lazy as BS #ifndef __HASTE__ import qualified Data.B...
beni55/haste-compiler
libraries/haste-lib/src/Haste/Binary/Types.hs
bsd-3-clause
3,327
0
12
592
412
230
182
26
1
module Test1 where -- folding against a simple function definition, the instance of g should be replaced with a function call -- to f x (or f 1) f x = x + 1 g = 1 + 1
kmate/HaRe
old/testing/refacFunDef/Test1.hs
bsd-3-clause
170
0
5
42
27
16
11
3
1
{- (c) The University of Glasgow 2006 (c) The AQUA Project, Glasgow University, 1993-1998 This is useful, general stuff for the Native Code Generator. Provide trees (of instructions), so that lists of instructions can be appended in linear time. -} {-# LANGUAGE CPP #-} module OrdList ( OrdList, nilO...
olsner/ghc
compiler/utils/OrdList.hs
bsd-3-clause
3,325
0
9
956
1,497
763
734
87
6
{-# LANGUAGE CPP #-} -- | A normalized API to many buffer operations. -- The idea is that most operations should be parametric in both -- * the textual units they work on -- * the direction towards which they operate (if applicable) module Yi.Buffer.Normal ( TextUnit(Character, Line, VLine, Document, GenUnit) ...
siddhanathan/yi
yi-core/src/Yi/Buffer/Normal.hs
gpl-2.0
4,235
0
11
1,800
639
369
270
87
4
module Array ( module Ix, -- export all of Ix Array, array, listArray, (!), bounds, indices, elems, assocs, accumArray, (//), accum, ixmap ) where import Prelude import Ix import List( (\\) ) infixl 9 !, // data (Ix a) => Array a b = MkArray (a,a) (a -> b) --array :: (Ix a) => (a,a) -> [(a,b...
forste/haReFork
tools/base/tests/HaskellLibraries/Array.hs
bsd-3-clause
3,087
0
15
1,417
1,154
619
535
-1
-1
import System.IO import Foreign import Foreign.C -- !!! this test failed to write anything in GHC 5.00.2 main = do h <- openBinaryFile "hPutBuf002.out" ReadWriteMode withCStringLen "hello world\n" $ \(ptr,len) -> hPutBuf h ptr len hFileSize h >>= print
seereason/ghcjs
test/pkg/base/hPutBuf002.hs
mit
260
0
9
46
70
35
35
7
1
{-# LANGUAGE KindSignatures,MultiParamTypeClasses,FunctionalDependencies,FlexibleInstances, FlexibleContexts, UndecidableInstances, OverlappingInstances #-} {- (C) 2004, Oleg Kiselyov, Ralf Laemmel, Keean Schupke This module gathers experiments that do not work with Hugs. -} module Data.HList.GhcExperiments wh...
bjornbm/HList-classic
Data/HList/GhcExperiments.hs
mit
1,580
0
10
361
421
220
201
-1
-1
{-# LANGUAGE TemplateHaskell #-} import Testing import System.Random import Control.Arrow (first) import Data.Char import Test.QuickCheck hiding ((.&.)) import Data.Word (Word16) import Control.Monad -- | To access these functions in the REPL via stack use: -- -- > stack ghci fsh-exercises:fsh-exercises-test -- -- To ...
capitanbatata/functional-systems-in-haskell
fsh-exercises/test/Spec.hs
mit
2,569
0
13
577
659
365
294
39
1
module MathTests ( toRadiansConversion , toDegreesConversion , heightInFlatTriangle , heightInZSkewedTriangle , heightInXSkewedTriangle , frontFacingNormals , differentFacingNormals ) where import Test.HUnit import Test.HUnit.Approx import BigE.Math ...
psandahl/big-engine
test/MathTests.hs
mit
3,745
0
12
1,017
1,080
578
502
83
1
----------------------------------------------------------------------------- -- -- Copyright (c) 2008 Martin 'Trin' Kudlvasr -- All rights reserved. -- -- Redistribution and use in sourse and binary forms are permitted -- provided that the above copyright notice and this paragraph are -- duplicated in all such forms ...
trin-cz/glxgears-haskell
gears/Main.hs
mit
5,656
0
15
1,223
1,326
689
637
83
1
import System.IO import Data.List import Data.List.Split main = do handle <- openFile "day7input.txt" ReadMode contents <- hGetContents handle let splitContent = words contents result = compute splitContent print result hClose handle compute :: [String] ->...
aBhallo/AoC2016
Day 7/day7part2.hs
mit
1,403
0
10
370
679
351
328
39
1
module Main where import Criterion.Main import HBF.Interpreter import HBF.Parser import HBF.PrgmIO.Pure import HBF.Tape.CrumbList main :: IO () main = defaultMain [ bgroup "fast" [bench "square_100" $ whnf (runBF squareBF) [100]] , bgroup "slow" [bench "square_500" $ whnf (runBF squareBF) [500]] ...
atlaua/hbf
test/bench.hs
mit
581
0
12
124
190
101
89
14
1
-- Copyright 2015 Mitchell Kember. Subject to the MIT License. -- | Uses "Text.Parsec" to parse lambda expressions. module Lam.Parse (parse, whiteChars) where import Data.List (delete) import Text.Parsec.Error (errorMessages, showErrorMessages) import Text.Parsec.Prim ((<|>), (<?>)) import Text.Parsec.String (Parser)...
mk12/lam
src/Lam/Parse.hs
mit
3,402
0
13
689
840
449
391
58
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE RecordWildCards #-} module Data.Message ( readMessage , dumpMessage , Message(..) , messageId , messageContent , messageGroupId , messageMentioned...
braidchat/greeterbot
src/Data/Message.hs
epl-1.0
2,898
0
17
631
751
411
340
-1
-1
{-# LANGUAGE PatternGuards #-} module LatexDouble where latexDouble :: Double -> String latexDouble 0 = "0" latexDouble x | x < 0 = "-" ++ latexDouble (-x) latexDouble x | Just (n,d,p) <- double2powfrac x 1 = latexPowRat (n,"",d,"",p) | Just (n,d,p) <- double2powfrac x (1/sqrt 2) = latexPowRat (n,"",d,"\\sqrt{2}"...
droundy/deft
src/haskell/LatexDouble.hs
gpl-2.0
2,398
0
13
563
1,270
683
587
48
3
{-# LANGUAGE TemplateHaskell #-} module Rewriting.TRS.Apply where import qualified Rewriting.Apply as A import Rewriting.TRS import Type.Tree import Rewriting.Derive.Instance import Rewriting.TRS.Step import Rewriting.TRS.Steps {- import Rewriting.Derive.Quiz import Rewriting.Derive.Config -} import Autolib.Repor...
florianpilz/autotool
src/Rewriting/TRS/Apply.hs
gpl-2.0
1,115
0
9
254
237
134
103
-1
-1
main :: IO () main = do q <- readLn p <- readLn print $ solve p q solve :: Integer -> Integer -> Int solve p q = length $ filter (> p) [ c n r | n <- [1..q], r <- [1..n]] -- Calculate the amount of possible combinations. c :: Integer -> Integer -> Integer c n r = product [2..n] `quot` ((product [2..r]) * (produ...
NorfairKing/project-euler
053/haskell/solution.hs
gpl-2.0
336
0
12
79
186
97
89
9
1
module InfoBox (newInfobox, newInfoboxBrowser) where import Graphics.UI.Gtk newInfobox :: String -> IO (VBox, Label, Label) newInfobox what = do lst <- mapM (labelNew . Just) ["Showing", "0", " out of", "0", ' ' : what] let (_:a:_:b:_) = lst mapM_ (\x -> set x [ labelWidthChars := 4 ] >> miscSetAlignment x 1 0)...
Cadynum/Apelsin
src/InfoBox.hs
gpl-3.0
1,021
4
16
205
498
254
244
28
1
{-# LANGUAGE DeriveDataTypeable #-} -- | -- Copyright : (c) 2010, 2011 Benedikt Schmidt & Simon Meier -- License : GPL v3 (see LICENSE) -- -- Maintainer : Simon Meier <iridcode@gmail.com> -- Portability : GHC only -- -- Helpers for inspecting the environment of the Tamarin prover. module Main.Environment where ...
samscott89/tamarin-prover
src/Main/Environment.hs
gpl-3.0
7,339
0
18
2,136
1,477
748
729
128
4
module PolicyEffects.Run ( runPolicyEffectsWithRendering, runPolicyEffectsStepsAndWriteToFile, runPolicyEffectsReplicationsAndWriteToFile ) where import FRP.Yampa import PolicyEffects.Init import PolicyEffects.Model import PolicyEffects.Renderer import FRP.FrABS import Text.Printf import System.IO w...
thalerjonathan/phd
coding/libraries/chimera/examples/ABS/PolicyEffects/Run.hs
gpl-3.0
7,171
0
16
2,089
1,774
907
867
148
3
{- Copyright (C) 2015 Leon Medvinsky This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope t...
raymoo/NEET
src/Neet/Parameters.hs
gpl-3.0
6,435
0
9
2,296
630
410
220
83
1
-- -- An example, simple ~/.xmonad/xmonad.hs file. -- It overrides a few basic settings, reusing all the other defaults. -- import XMonad import XMonad.Actions.SpawnOn import XMonad.Config.Gnome import XMonad.Layout.Dishes import XMonad.Layout.Gaps import XMonad.Layout.Grid ...
birkses/setup-files
.xmonad/xmonad.hs
gpl-3.0
2,307
14
14
697
477
272
205
47
1
{-# LANGUAGE TypeFamilies, DeriveDataTypeable, GeneralizedNewtypeDeriving #-} module Main where import Prelude (Eq,Ord,Show,iterate,(!!),fmap,Bool(..),undefined,Int,return) -- import AutoPrelude import Hip.HipSpec import Data.Typeable import Test.QuickCheck hiding (Prop) type Prop a = a proveBool = proveBool otherw...
danr/hipspec
examples/old-examples/quickspec/ProductiveUseOfFailure2.hs
gpl-3.0
14,979
0
10
5,012
2,299
1,303
996
136
2
{-# LANGUAGE OverloadedStrings #-} module Database.Hedsql.Tests.PrettyPrint ( tests ) where -------------------------------------------------------------------------------- -- IMPORTS -------------------------------------------------------------------------------- import Database.Hedsql.Statements....
momomimachli/Hedsql
tests/Database/Hedsql/Tests/PrettyPrint.hs
gpl-3.0
11,510
0
10
3,798
1,118
619
499
209
1
module HFlint.Primes.Base where import System.IO.Unsafe ( unsafePerformIO ) import HFlint.NMod.FFI ( FlintLimb ) import HFlint.Primes.FFI -- largest prime that fits into Word64 is 2^64-59 = 0XFFFFFFFFFFFFFFC5 primesAfter :: FlintLimb -> [FlintLimb ] primesAfter n = let p = nextPrime n in if p == 0XFFFFFFFFFFFF...
martinra/hflint
src/HFlint/Primes/Base.hs
gpl-3.0
451
0
9
84
118
66
52
12
2
module Parse where import Text.ParserCombinators.Parsec hiding (spaces) import Control.Monad.Error import Control.Monad import Control.Applicative ((<*), (*>), (<*>)) import Data.Char (digitToInt) import Data.Complex import Data.Array import Numeric import Debug.Trace import LispData symbol :: Parser Char symbol = ...
adamschoenemann/wysas
src/Parse.hs
gpl-3.0
4,164
0
14
1,103
1,466
716
750
124
4
module SneakyBeaky.List where import ClassyPrelude import qualified Data.List.NonEmpty as NE import Prelude() replace :: Eq a => [a] -> a -> a ->[a] replace [] _ _ = [] replace (x:xs) old new | x == old = new : replace xs old new | otherwise = x : replace xs old new replaceBy :: [a] -> (a -> B...
pmiddend/sneakybeaky
src/SneakyBeaky/List.hs
gpl-3.0
711
0
14
192
390
204
186
17
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-play-moviespartner/gen/Network/Google/Resource/PlayMoviesPartner/Accounts/Orders/List.hs
mpl-2.0
8,955
0
27
2,369
1,581
907
674
214
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE RankNTypes #-} module Gonimo.Server.Auth where import Control.Exception (SomeException) import Control.Lens import Control.Monad (unless) import Control.Monad.Freer (Eff, Member) import ...
charringer/gonimo-back
src/Gonimo/Server/Auth.hs
agpl-3.0
2,127
0
9
615
582
319
263
-1
-1
module Main where import Core import System.Environment main :: IO () main = do cfg <- parseConfig "blog.cfg" runBlog cfg
julienchurch/julienchurch.com
app/Main.hs
apache-2.0
134
0
8
32
43
22
21
7
1
module Miscellaneous.A306216Spec (main, spec) where import Test.Hspec import Miscellaneous.A306216 (a306216) main :: IO () main = hspec spec spec :: Spec spec = describe "A306216" $ it "correctly computes the first 20 elements" $ map a306216 [1..20] `shouldBe` expectedValue where expectedValue = [1,1,0,0,...
peterokagey/haskellOEIS
test/Miscellaneous/A306216Spec.hs
apache-2.0
361
0
8
57
170
100
70
10
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QVariant.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:31 Warning : this file is machine generated - do not ...
uduki/hsQt
Qtc/Core/QVariant.hs
bsd-2-clause
37,757
0
15
5,982
11,098
5,519
5,579
-1
-1
module Application.DocManager.Config where import Text.Parsec import Control.Monad.Identity import Control.Applicative import HEP.Parser.Config data DocManagerConfig = DocManagerConfig { dmc_working :: FilePath, dmc_texbase :: FilePath, dmc_xojbase :: FilePath, dmc_webbase :: FilePath } deriving (Show) ...
wavewave/docmanager
lib/Application/DocManager/Config.hs
bsd-2-clause
660
0
10
146
137
78
59
18
1
----------------------------------------------------------------------------- -- | -- Module : Data.SBV.Examples.BitPrecise.BitTricks -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Checks the correctness of a few tricks from the la...
josefs/sbv
Data/SBV/Examples/BitPrecise/BitTricks.hs
bsd-3-clause
2,480
0
15
530
651
359
292
34
1
{-# LANGUAGE BangPatterns #-} -- | WVar is waitable 'IORef'. -- It is similar to 'MVar' but different at some points. -- -- * The latest (cached) value can be read -- while someone is updating the value. -- * Put operation can overwrite the value if the value is fresh -- and cannot be blocked for waiting em...
asakamirai/kazura-queue
src/Control/Concurrent/WVar.hs
bsd-3-clause
8,934
0
16
2,394
2,063
1,087
976
178
5
module Metrics.EventCounter where import ConfigBase import Metrics.Common import qualified Data.ByteString.Char8 as SB import qualified Data.ByteString.Lazy.Char8 as B import Parsers (getCategoryAndEvent) makeEventCounter :: Config -> Either String (Metric MetricState) makeEventCounter EventCounter {na...
zsol/hlogster
Metrics/EventCounter.hs
bsd-3-clause
802
0
12
146
221
122
99
15
3
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} -- |Primitives to calculate the encoding size of a value module Flat.Encoder.Size where import Data.Bits import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as L import qualified Data.ByteString.Shor...
tittoassini/flat
src/Flat/Encoder/Size.hs
bsd-3-clause
4,236
0
10
969
1,067
596
471
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} -- | Some tools to use database with media module MediaSub.DatabaseTools where import Control.Arrow (second) import qualified Data.ByteString.Char8 as BC import Data.Ord (comparing) import Data.Conduit import qualified Data.Conduit.List as CL impor...
SimSaladin/rnfssp
rnfssp-media/MediaSub/DatabaseTools.hs
bsd-3-clause
1,637
0
10
423
390
216
174
31
1
{-# LANGUAGE TemplateHaskell #-} module Render.MVertexT where import Control.Lens (makeLenses) import qualified Data.ByteString.Lazy as BL import Data.Functor ((<$>)) import Linear (V3(..)) import qualified Constants import Types import U...
ksaveljev/hake-2
src/Render/MVertexT.hs
bsd-3-clause
615
0
6
150
138
82
56
18
1
module Main where import System.Environment import Control.Arrow(first) import Text.RegexPR import Data.Tree import Data.List import Data.Char import HsModTree import System.FilePath main :: IO () main = do [ dir ] <- getArgs files <- fmap filterSource $ getDirectoryContentsRec dir dependList <- mapM ( depend dir ...
YoshikuniJujo/hssourceinfo
src/hscodelines.hs
bsd-3-clause
1,549
5
14
276
571
278
293
42
1
module Foundation where import Data.Functor ((<$>)) import Control.Applicative ((<*>), (<*), (*>)) import Data.IntMap (IntMap) import qualified Data.IntMap as IntMap import Control.Concurrent.STM import Data.Text (Text) import qualified Data.Text as Text import Data.ByteString.Lazy (ByteString) import Data.Defa...
Kwarrtz/flash
Foundation.hs
bsd-3-clause
1,523
0
12
281
499
255
244
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE ScopedTypeVariables #-} {-# OPTIO...
AlexeyRaga/eta
utils/eta-pkg/Main.hs
bsd-3-clause
90,390
44
102
25,804
19,147
9,740
9,407
1,493
32
module Main where import Happstack.Data.IxSet.Tests (allTests) import Test.HUnit (errors, failures, putTextToShowS,runTestText, runTestTT) import System.Exit (exitFailure) import System.IO (hIsTerminalDevice, stdout) -- |A simple driver for running the local test suite. main :: IO () main = do c <- do istty <- hI...
ekmett/ixset
tests/Test.hs
bsd-3-clause
650
0
15
208
184
97
87
16
3
{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-} module Examples.Self.Main(main) where import Development.Shake import Development.Shake.Classes import Development.Shake.FilePath import Examples.Util import Control.Monad import Data.Char import Data.List import System.Info newtype GhcPkg = GhcPkg ()...
nh2/shake
Examples/Self/Main.hs
bsd-3-clause
3,012
0
21
762
968
480
488
60
4
{-| Module : PP.Grammars.LexicalHelper Description : Add lexical support to other grammars Copyright : (c) 2017 Patrick Champion License : see LICENSE file Maintainer : chlablak@gmail.com Stability : provisional Portability : portable -} module PP.Grammars.LexicalHelper ( -- *AST helper for other gram...
chlablak/platinum-parsing
src/PP/Grammars/LexicalHelper.hs
bsd-3-clause
3,944
0
12
837
870
480
390
73
1
{-# LANGUAGE CPP #-} module Pkg.Package where import System.Process import System.Directory import System.Exit import System.IO import System.FilePath ((</>), addTrailingPathSeparator, takeFileName, takeDirectory, normalise) import System.Directory (createDirectoryIfMissing, copyFile) import Util.System import Contr...
BartAdv/Idris-dev
src/Pkg/Package.hs
bsd-3-clause
11,299
0
21
4,150
3,024
1,445
1,579
226
4
{-# LANGUAGE CPP #-} -- | -- Module : Crypto.Hash.Algorithms -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : unknown -- -- Definitions of known hash algorithms -- module Crypto.Hash.Algorithms ( HashAlgorithm -- * Hash algorithm...
tekul/cryptonite
Crypto/Hash/Algorithms.hs
bsd-3-clause
2,120
0
5
608
478
338
140
62
0
module GraderTest where import Test.QuickCheck import TestGrid as TGrid import Grader tests :: [(String, IO ())] tests = [("Grader" ++ (show (TGrid.testGrid >>= Grader.grade)), quickCheck GraderTest.test)] test = case (TGrid.testGrid >>= Grader.grade) of Nothing -> False Just g -> elem g (enumFrom Gr...
Stulv/sudoku
test/GraderTest.hs
bsd-3-clause
335
0
12
62
124
69
55
12
2
{-# LANGUAGE TypeFamilies #-} module DataFamilies where data family Vector a class ListLike a where type I a h :: a -> I a
phischu/fragnix
tests/quick/QualifiedAssociates/DataFamilies.hs
bsd-3-clause
129
0
8
30
35
21
14
6
0
{-# LANGUAGE OverloadedStrings #-} module Domain.Tenant where import Control.Lens import Data.Time import Database.Persist import Control.Monad.IO.Class import Data.Text (Text) import Data.ByteString (ByteString) import Models import Types import Updater import DBTypes import Operation dbCreateTenant :: TenantInp...
meditans/haskell-webapps
ServantPersistent/src/Domain/Tenant.hs
mit
1,609
0
17
451
437
227
210
41
2
-- -- Chapter 6. -- module C'6 where import Prelude hiding ( snd , id , concat , lookup ) import Test.QuickCheck import Test.HUnit import Pictures hiding ( superimpose , printPicture , prop_AboveFlipH , propAboveBeside3Correct , black , white ) import B'C'6 import E'6'63 import E'6'62 impor...
pascal-knodel/haskell-craft
_/links/C'6.hs
mit
1,168
0
5
196
251
168
83
79
0
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Lens hiding (view, (.=)) import Control.Monad (void) import Data.Aeson (Value (String)) import Data.Default (...
qmuli/qmuli
examples/cognito-apigw-lambda/src/Main.hs
mit
2,156
0
20
947
424
238
186
-1
-1
module End.Sprite.Player where import End.Header.Animation import Graphics.UI.SDL import End.Util.Animation pSprite :: IO Sprite pSprite = do s <- loadImage "images/60x110.png" $ Just (0xee,0xff,0xde) return $ Sprite (pAnimation s) pAnimation :: Surface -> Animation pAnimation s = Animation s [playerStand, p...
kwrooijen/sdl-game
End/Sprite/Player.hs
gpl-3.0
596
0
10
132
204
112
92
16
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-elb/gen/Network/AWS/ELB/DeleteLoadBalancerListeners.hs
mpl-2.0
4,639
0
13
889
545
328
217
75
1
{-# LANGUAGE FlexibleContexts, TypeOperators #-} module Development.Shake.C( cppIncludes ) where import Development.Shake import Development.Shake.System import Control.Monad import Data.Char import Data.List import Data.Maybe import System.FilePath cppIncludes :: (CanonicalFilePath :< n, Namespace n) ...
beni55/openshake
Development/Shake/C.hs
bsd-3-clause
871
0
14
166
267
139
128
17
2
{-# LANGUAGE CPP #-} -- Module : Network.AWS.Data.Compat.Internal.Locale -- Copyright : (c) 2013-2015 Brendan Hay <brendan.g.hay@gmail.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in th...
romanb/amazonka
core/src/Network/AWS/Compat/Internal/Locale.hs
mpl-2.0
828
0
5
187
44
34
10
5
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-s3/gen/Network/AWS/S3/GetBucketLifecycle.hs
mpl-2.0
3,454
0
10
746
455
273
182
57
1
{-# LANGUAGE OverloadedStrings, BangPatterns #-} module Network.Wai.Handler.Warp.PackInt where import Data.ByteString.Internal (unsafeCreate) import Foreign.Ptr (Ptr, plusPtr) import Foreign.Storable (poke) import qualified Network.HTTP.Types as H import Network.Wai.Handler.Warp.Imports -- $setup -- >>> import Data...
sordina/wai
warp/Network/Wai/Handler/Warp/PackInt.hs
bsd-2-clause
1,599
0
14
366
493
267
226
32
1
module Test7 where f x y = x + (let y = 56; p = 45 in y + p)
SAdams601/HaRe
old/testing/refacSlicing/Test7.hs
bsd-3-clause
79
0
10
38
42
23
19
3
1
module CheckIfPullMerged where import qualified Github.PullRequests as Github import Github.Auth main :: IO () main = do mergeResult <- Github.isPullRequestMerged (GithubOAuth "authtoken") "thoughtbot" "paperclip" 575 case mergeResult of (Left err) -> putStrLn $ "Error: " ++ (show err) (Right stat)...
bitemyapp/github
samples/Pulls/IsMergedPull.hs
bsd-3-clause
347
0
12
66
111
58
53
9
2
import GetURL import TimeIt import Control.Monad import Control.Concurrent import Control.Exception import Text.Printf import qualified Data.ByteString as B ----------------------------------------------------------------------------- -- Our Async API: data Async a = Async (MVar (Either SomeException a)) async :: I...
prt2121/haskell-practice
parconc/geturls6.hs
apache-2.0
1,633
0
16
368
614
297
317
48
2
{-# LANGUAGE TemplateHaskell #-} module T7241 where import Language.Haskell.TH $(newName "Foo" >>= \o -> return [DataD [] o [] [RecC o []] []])
ghc-android/ghc
testsuite/tests/th/T7241.hs
bsd-3-clause
147
0
14
26
63
33
30
4
0
{-# LANGUAGE PatternSynonyms #-} module Foo( R(P,x)) where data Q = Q Int data R = R pattern P{x} = Q x
ezyang/ghc
testsuite/tests/patsyn/should_fail/export-ps-rec-sel.hs
bsd-3-clause
107
0
7
25
49
29
20
8
0
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeFamilies #-} -- | The IR tracks aliases, mostly to ensure the soundness of in-place -- updates, but it can also be used for other things (such as memory -- optimisations). This module contains the raw building blocks for -- determin...
HIPERFIT/futhark
src/Futhark/IR/Prop/Aliases.hs
isc
7,897
0
13
1,523
2,305
1,220
1,085
-1
-1
module PrimeTest (propPrime) where import PropImports import Math.NumberTheory.Primes.Testing (isPrime) propPrime :: Int -> Spec propPrime ub = describe "QuickCheck testing prime Generator" $ modifyMaxSuccess (const maxS) $ prop propMsg $ forAll (choose (10,ub)) verifyPr...
mlitchard/primenator
src-test/PrimeTest.hs
isc
511
0
10
132
153
83
70
13
1