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
-- | A hook for XMonad window manager to send updates to the -- corresponding Tianbar widget. -- -- You must include tianbar:scripts/xmonad.js in Tianbar configuration to -- receive the updates. -- -- A "Renderer" can be used to fully customize the output. A renderer is a -- function receiving all the status informatio...
koterpillar/tianbar
src/System/Tianbar/XMonadLog.hs
mit
4,858
0
18
1,795
958
513
445
73
1
module Scheme.Types ( Expr(..) , Name , intern , Value(..) , Env , emptyEnv , extend , lookup ) where import Prelude hiding(lookup) import qualified Data.Map.Lazy as M import Data.Symbol -- We'll use Symbols for names in our language. Symbols aren't built in to -- Haskell, but they can be easil...
mjdwitt/a-scheme
src/Scheme/Types.hs
mit
1,916
0
8
463
327
189
138
33
1
module SodaFunctionTests ( tests ) where import Test.Tasty import Test.Tasty.HUnit import Data.Time.Clock.POSIX (posixSecondsToUTCTime) import Soda import Query import Datatypes import SodaFunctions tests :: TestTree tests = testGroup "Soda Function Tests" [ testCase "Basic SodaFumc test with Not()" $ ...
StevenWInfo/haskell-soda
tests/SodaFunctionTests.hs
mit
2,418
0
19
588
684
358
326
39
1
{-# LANGUAGE InstanceSigs #-} {-# LANGUAGE OverloadedStrings #-} module Models.Hours where import qualified Data.Map as M import Data.Text (Text, pack, unpack) import Data.Time (TimeOfDay(..), LocalTime(..), Day(..)) import Database.Persist.Sql import Data.Aeson import Control.Monad import Control.Applicative data W...
benweitzman/PhoBuddies
src/Models/Hours.hs
mit
2,726
7
11
925
744
388
356
66
0
module Exercise where -- see /2012/opg4e.hs
tcoenraad/functioneel-programmeren
2013/opg3e.hs
mit
43
0
2
5
5
4
1
1
0
-- World: data type to represent the world and its components {-# LANGUAGE OverloadedStrings #-} module World where import qualified Data.Word as Word import qualified SDL -- World: data type to represent the world and its components data World = World { getWindow :: SDL.Window , getSurface :: ...
soupi/haskell-sdl2gl
src/Examples/Example01/World.hs
mit
353
0
9
94
44
30
14
6
0
-- (3 балла) module Eval ( EvalT, runEvalT , Eval, runEval , Store , update, getVar ) where import qualified Data.Map as M import Data.List import Control.Monad import Control.Applicative import Control.Monad.Identity import Control.Monad.Trans import Expr type Store = M.Map String Value -- newt...
SergeyKrivohatskiy/fp_haskell
hw11/Interpreter/Eval.hs
mit
1,345
2
9
288
419
231
188
-1
-1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.CSS (js_supports2, supports2, js_supports, supports, CSS, castToCSS, gTypeCSS) where import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, ro...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/CSS.hs
mit
1,859
18
9
289
494
299
195
34
1
module Language.Jass.Program( makeEmptyNativeTable , JassProgram , JITModule , NativeTableMaker , constructProgram , constructProgramFromSource , executeProgram , module ReExport ) where import qualified Data.HashMap.Strict as HM import Language.Jass.JIT.Executing import Language.Jass.JIT.Module im...
NCrashed/hjass
src/library/Language/Jass/Program.hs
mit
3,254
0
17
560
750
398
352
70
3
-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} import Data.Monoid (mappend) import Hakyll import Text.Pandoc crunchWithCtx ctx = do route $ setExtension "html" compile $ pandocCompiler >>= loadAndApplyTemplate "templates/page.html" ...
gokhankici/131-web
site.hs
mit
3,097
0
14
928
334
171
163
42
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE BangPatterns #-} -- | -- Module : Statistics.Correlation.Pearson -- module Statistics.Correlation.Pearson ( pearson , pearsonMatrix ) where import qualified Data.Vector.Generic as G import qualified Data.Vector.Unboxed as U import qualified Data.Matrix....
kaizhang/statistics-correlation
Statistics/Correlation/Pearson.hs
mit
1,418
0
12
355
453
256
197
30
1
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} module Calc where import ExprT import Parser import qualified StackVM as VM import qualified Data.Map as M import Control.Applicative ((<*>), (<$>)) eval :: ExprT -> Integer eval (Lit n) = n eval (Add n m) = eval n + ev...
harrisi/on-being-better
list-expansion/Haskell/cis194/spring13/05/Calc.hs
cc0-1.0
2,417
0
10
664
1,082
564
518
86
2
{-# LANGUAGE NoMonomorphismRestriction #-} import Diagrams.Prelude import Diagrams.Backend.Cairo.CmdLine import Data.List driveR = "roomba.drive" driveT = "turret.drive" driveA = "audio.drive" sensorR = "roomba.sensor" sensorT = "turret.sensor" sensorA = "audio.sensor" joystick = "joystick" lcd = "lcd" turret = "tu...
acm-uiuc/DJ-Roomba
diagram.hs
gpl-2.0
2,397
0
18
803
771
397
374
51
2
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} module Main where import ClassyPrelude import Control.Lens (has, only, (^.), (^?)) import Control.Monad.Loops (whileM_) import Linear.V2 import qualified Reactive.Banana.Combinators ...
pmiddend/frp-playground
src/Frp/Main.hs
gpl-2.0
3,217
0
18
680
901
471
430
59
5
import HsTri import qualified Data.Vector as V import Control.Monad.Cont import Data.Vect.Double.Base import System.IO import EdgeCentered spqwc10 = transformCoords ((diag (Vec3 1 1 3.5) :: Mat3) `lmul`) $ lensSpace 10 1 spqwc = lensSpace 5 1 main = viewFundEdgeSolutionsInBlender spqwc (const . Just . edT...
DanielSchuessler/hstri
bin/lens-space-view.hs
gpl-3.0
365
0
11
65
124
71
53
10
1
module Command.Simple where import Data.Time.Clock import H.Prelude import Command data SetPaused = SetPaused Bool deriving (Show) data SetSpeed = SetSpeed SimulationSpeed deriving (Show) data SimulationSpeed = SpeedSlow | SpeedMedium | SpeedFast deriving (Eq, Ord, Enum, Bounded, Show) speedToCycleLength :...
ktvoelker/airline
src/Command/Simple.hs
gpl-3.0
698
0
8
120
198
107
91
-1
-1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} module TB.Attoparsec.Parsers.Services ( Service (..), Protocol (..), readServices, parseService, parseServices, parseServicesIO ) where import Control.Applicative import Control.Monad import Data.Attoparsec...
adarqui/ToyBox
haskell/bos/attoparsec/src/TB/Attoparsec/Parsers/Services.hs
gpl-3.0
2,646
0
12
565
589
323
266
67
1
module SpacialGameEnv.RunSGEnv where import SpacialGameEnv.SGModelEnv import qualified PureAgents2DDiscrete as Front import qualified Graphics.Gloss as GLO import Graphics.Gloss.Interface.IO.Simulate import qualified PureAgentsAct as PA import System.Random import Data.Maybe import Data.List import Control.Monad.STM...
thalerjonathan/phd
public/ArtIterating/code/haskell/PureAgentsAct/src/SpacialGameEnv/RunSGEnv.hs
gpl-3.0
3,525
0
12
1,172
942
513
429
69
1
sum1to7 = sum $ map goodstein [1..7] goodstein n | n >= 8 = error "Too large!" goodstein n = go 2 (toBinary n) where go k [] = k - 2 go k xs = k `seq` go (k + 1) (decrement (k + 1) xs) -- convert number to a list of bits, LSB first toBinary 0 = [] toBinary n = let (q, r) = divMod n 2 in r : toBinary q decr...
kkmonlee/Project-Euler-Solutions
Haskell/p396.hs
gpl-3.0
450
0
12
133
260
133
127
13
3
-- | This module contains functionality to parse LXDFiles. module Language.LXDFile ( -- * Parsing parseString , parseFile -- * Top-level types , LXDFile(..) , Action(..) , Image -- * Subtypes , Arguments(..) , Destination , Source ) where import Language.LXDFile.Parser (parseString, parseFile) import Languag...
hverr/lxdfile
src/Language/LXDFile.hs
gpl-3.0
336
0
5
56
68
47
21
11
0
{- This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. - If a copy of the MPL was not distributed with this file, - You can obtain one at http://mozilla.org/MPL/2.0/. -} import System.IO import System.Directory import System.FilePath import System.Console.GetOpt import System.Environ...
Zimmi48/gps-bank-data-analysis
Main.hs
mpl-2.0
8,156
0
15
2,813
1,558
793
765
138
6
{- Copyright (C) 2011, 2012 Jeroen Ketema 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 version 3 of the License, or (at your option) any later version. This program is distributed i...
jeroenk/iTRSsVisualised
ExampleReduction2.hs
agpl-3.0
1,591
0
12
283
193
108
85
21
1
-- can not compile myShow1 = show -- these ok myShow2 value = show value myShow :: (Show a) => a -> String myShow = show
EricYT/Haskell
src/real_haskell/chapter-6/Monomorphism.hs
apache-2.0
126
0
6
30
42
23
19
4
1
import Control.Lens import Data.Default import Data.List import Data.List.Split import Data.Time.Calendar import Data.Time.Clock import Data.Time.Format import Graphics.Rendering.Chart.Easy -- import Graphics.Rendering.Chart.Plot import Graphics.Rendering.Chart.Backend.Cairo import System.Directory import System.Proces...
wavewave/misc-utils
stat.hs
bsd-2-clause
1,824
0
17
512
523
272
251
47
2
module Language.Drasil.Generate (gen, genCode) where import System.IO (hClose, hPutStrLn, openFile, IOMode(WriteMode)) import Text.PrettyPrint.HughesPJ (Doc, render) import Prelude hiding (id) import System.Directory (createDirectoryIfMissing, getCurrentDirectory, setCurrentDirectory) import Data.Time.Clock (getCurr...
JacquesCarette/literate-scientific-software
code/drasil-gen/Language/Drasil/Generate.hs
bsd-2-clause
3,260
0
14
643
1,059
548
511
67
4
{-# LANGUAGE FlexibleInstances #-} module Linear.Persist where import Linear.V3 import Database.Persist import Database.Persist.Postgresql import Database.Persist.TH import qualified Data.Text as T instance PersistFieldSql (V3 Double) where sqlType _ = SqlString instance Persist...
massudaw/mtk
filters/attitude/Linear/Persist.hs
bsd-3-clause
817
0
13
196
290
152
138
18
0
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} module Text.Blaze.Svg.Renderer.Utf8 ( renderSvg ) where import Text.Blaze.Renderer.Utf8 (renderMarkup) renderSvg = renderMarkup
deepakjois/blaze-svg
src/Text/Blaze/Svg/Renderer/Utf8.hs
bsd-3-clause
186
0
5
25
32
22
10
5
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP , MagicHash , UnboxedTuples , ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-deprecations #-} -- kludge for the Control.Concurrent.QSem, Control.Concurrent.QSemN -- and Control.Concurrent.SampleVar imports. ----------------------------...
jstolarek/ghc
libraries/base/Control/Concurrent.hs
bsd-3-clause
24,571
0
21
6,007
1,929
1,018
911
129
3
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE RankNTypes #-} module TypeCheck (typeCheckModule, typeCheckExpr) where import Prelude hiding (lookup, span) import Control.Monad.Except import Control.Monad.State import Data.Bifunctor import Data.Either.Validation import Text.PrettyPrint.ANSI.Leijen hiding ((<$>)) import AST...
merijn/lambda-except
TypeCheck.hs
bsd-3-clause
5,420
0
17
1,589
2,230
1,102
1,128
140
4
{-# LANGUAGE CPP, GADTs, OverloadedStrings, ScopedTypeVariables #-} -- | haskell-carft is a Haskell binding to the Minecraft Pi -- API. module HaskellCraft where import Control.Monad -- #if !(MIN_VERSION_base(4,8,0)) import Data.Monoid (mempty) -- #endif import Data.Monoid ((<>)) imp...
markgrebe/haskell-craft
HaskellCraft.hs
bsd-3-clause
2,536
0
13
737
773
386
387
49
6
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Code generation for foreign calls. -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- module StgCmmForeign ( cgForeignCall, loadThreadS...
spacekitteh/smcghc
compiler/codeGen/StgCmmForeign.hs
bsd-3-clause
15,864
0
20
4,342
2,782
1,442
1,340
230
6
module QueryArrow.FFI.GenQuery.Data where data Cond = Cond String Cond2 deriving (Show) data Cond2 = EqString String | EqInteger Integer | NotEqString String | NotEqInteger Integer | GtString String | GtInteger Integer | LtString String | ...
xu-hao/QueryArrow
QueryArrow-ffi-genquery/src/QueryArrow/FFI/GenQuery/Data.hs
bsd-3-clause
959
0
7
311
225
134
91
23
0
{-# LANGUAGE PostfixOperators #-} {-# OPTIONS_HADDOCK prune, show-extensions #-} ----------------------------------------------------------------------------- -- | -- Module : ForSyDe.Core.Utility.Tuple -- Copyright : (c) George Ungureanu, KTH/ICT/ESY 2015-2020 -- License : BSD-style (see the file LICENSE...
forsyde/forsyde-atom
src/ForSyDe/Atom/Utility/Tuple.hs
bsd-3-clause
10,572
0
10
3,073
3,901
2,454
1,447
170
1
module HasOffers.API.Brand.AdvertiserBilling where import Data.Text import GHC.Generics import Data.Aeson import Control.Applicative import Network.HTTP.Client import qualified Data.ByteString.Char8 as BS import HasOffers.API.Common ----------------------------------------------------------------------------...
kelecorix/api-hasoffers
src/HasOffers/API/Brand/AdvertiserBilling.hs
bsd-3-clause
325
0
4
32
50
34
16
8
0
{-# LANGUAGE TupleSections #-} module Floskell.Imports ( sortImports, groupImports, splitImports ) where import Control.Monad.Trans.State ( State, execState, gets, modify ) import Data.Function ( on ) import Data.List ( groupBy, inits, intercalate, sor...
ennocramer/floskell
src/Floskell/Imports.hs
bsd-3-clause
3,032
0
16
994
1,125
609
516
60
4
module TestPrimitives.Utils where import Data(ThrowsError, LispVal) import Control.Monad.Except(runExcept) (===>) :: ThrowsError LispVal -> LispVal -> Bool action ===> value = runExcept action == Right value
davideGiovannini/scheme-repl
test/TestPrimitives/Utils.hs
bsd-3-clause
210
0
6
27
67
37
30
5
1
{-# LANGUAGE DefaultSignatures, FlexibleContexts, FlexibleInstances, NoImplicitPrelude #-} module Json.Internal.Classes ( -- * Core classes FromJson(..), ToJson(..), -- * Generic classes GFromJson(..), genericParseJson, GToJson(..), genericToJson, genericToEncoding, -- * Object key-value pairs...
aelve/json-x
lib/Json/Internal/Classes.hs
bsd-3-clause
8,632
0
11
1,652
778
505
273
-1
-1
module Main where import qualified FoldVersion import qualified ReactiveVersion import System.Environment main :: IO () main = do args <- getArgs case args of ["fold"] -> FoldVersion.exec ["reactive"] -> ReactiveVersion.exec _ -> putStrLn "Usage: slow-frp <test-type>"
unknownloner/slow-frp
src/Main.hs
bsd-3-clause
287
0
10
54
77
42
35
11
3
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} #ifdef DataPolyKinds {-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} #endif #ifdef SafeHaskell {-# LANGUAGE Trustworthy #-} #endif module Data.O...
duairc/has-lens
has-optic/src/Data/Optic/Instances/Tuple.hs
bsd-3-clause
12,553
0
9
3,217
6,359
3,804
2,555
257
0
{-# LANGUAGE CPP #-} -- | Extra functions for working with 'NonEmpty' lists. The package -- also exports the existing "Data.List.NonEmpty" functions. module Data.List.NonEmpty.Extra( module Data.List.NonEmpty, (|:), (|>), snoc, (!?), appendl, appendr, sortOn, union, unionBy, nubOrd, nubOrdBy, nub...
ndmitchell/extra
src/Data/List/NonEmpty/Extra.hs
bsd-3-clause
4,463
0
8
938
1,041
573
468
56
1
module Math.Graphs where -- import Control.Parallel(par,pseq) import Data.List((\\),union) data Vertex a = Vert{ label :: a } deriving Eq instance Show a => Show (Vertex a) where show (Vert a) = show a data Edge a = Edge (Vertex a) (Vertex a) deriving Eq instance Show a => Show (Edge a) where show ...
crvs/scythe
src/Math/Graphs.bak.hs
bsd-3-clause
5,868
0
15
2,016
1,829
939
890
105
2
module Data.Functor.Applicative where import Data.Functor.Apply class Apply f => Applicative f where pure :: a -> f a instance Applicative ((->) t) where pure a = \_ -> a
tonymorris/type-class
src/Data/Functor/Applicative.hs
bsd-3-clause
190
0
8
48
71
38
33
9
0
{-# LINE 1 "GHC.Event.Clock.hsc" #-} {-# LANGUAGE Trustworthy #-} {-# LINE 2 "GHC.Event.Clock.hsc" #-} {-# LANGUAGE NoImplicitPrelude #-} module GHC.Event.Clock (getMonotonicTime) where import GHC.Base import GHC.Real import Data.Word -- | Return monotonic time in seconds, since some unspecified starting point getMo...
phischu/fragnix
builtins/base/GHC.Event.Clock.hs
bsd-3-clause
531
0
10
95
85
48
37
11
1
-- -*-haskell-*- -- ** @configure_input@ ** -- =========================================================================== -- C -> Haskell Compiler: configuration -- -- Author : Manuel M T Chakravarty -- Created: 27 September 99 -- -- Copyright (c) [1...
ian-ross/c2hs-macos-test
c2hs-0.26.1/src/C2HS/Config.hs
mit
5,567
0
15
1,402
686
442
244
70
4
module Ditto.Whnf where import Ditto.Syntax import Ditto.Monad import Ditto.Sub import Data.Maybe ---------------------------------------------------------------------- whnf :: Exp -> TCM Exp whnf (EApp i1 f a) = whnf f >>= \case ELam i2 _A xb | i1 == i2 -> do (x, b) <- unbind xb whnf =<< sub1 (x , a) b f...
ditto/ditto
src/Ditto/Whnf.hs
gpl-3.0
2,832
0
15
642
1,346
671
675
-1
-1
-- This Source Code Form is subject to the terms of the Mozilla Public -- License, v. 2.0. If a copy of the MPL was not distributed with this -- file, You can obtain one at http://mozilla.org/MPL/2.0/. {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LA...
whitehead1415/cql
src/Database/CQL/Protocol/Request.hs
mpl-2.0
11,142
0
14
2,530
2,392
1,292
1,100
258
6
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/CreateApplication.hs
mpl-2.0
4,170
0
9
844
492
300
192
60
1
{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE EmptyCase #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDerivin...
deepfire/mood
te/ThinErr.hs
agpl-3.0
2,105
0
15
307
334
184
150
56
2
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE FlexibleContexts #-} module OpenCog.Lojban.Syntax.AtomUtil where import Prelude hiding (id,(.)) import Control.Category import Control.Arrow import Control.Monad.Trans.Class import Control.Monad.RWS import Iso import Syntax hiding (SynIso,Syntax) import qualified D...
misgeatgit/opencog
opencog/nlp/lojban/HaskellLib/src/OpenCog/Lojban/Syntax/AtomUtil.hs
agpl-3.0
14,207
1
18
4,967
5,424
2,916
2,508
-1
-1
{-# LANGUAGE ScopedTypeVariables, CPP, ForeignFunctionInterface #-} {-# LANGUAGE BangPatterns, MagicHash, UnboxedTuples #-} -- | Copyright : (c) 2010 - 2011 Simon Meier -- (c) 2011 MailRank, Inc. -- License : BSD3-style (see LICENSE) -- -- Maintainer : Simon Meier <iridcode@gmail.com> -- Portability ...
meiersi/bytestring-builder
Data/ByteString/Lazy/Builder/ASCII.hs
bsd-3-clause
11,789
0
15
2,608
1,786
1,026
760
136
1
{-# LANGUAGE QuasiQuotes, RecordWildCards #-} -- | (you should read the source for documentation: just think of this module as a config file) module Commands.Frontends.Dragon13.Shim ( module Commands.Frontends.Dragon13.Shim.Types , module Commands.Frontends.Dragon13.Shim.Commands , module Commands.Frontends.Drago...
sboosali/commands-frontend-DragonNaturallySpeaking
sources/Commands/Frontends/Dragon13/Shim.hs
bsd-3-clause
494
0
5
50
63
48
15
8
0
module Java.JAR (readManifest, readJAR, readMainClass, addJAR ) where import Control.Monad.Trans (liftIO) import qualified Control.Monad.State as St import Data.List import qualified Codec.Archive.LibZip as Zip import Java.ClassPath import Java.JAR.Archive import Java.META readManifest :: Zip.Archive ...
ledyba/hs-java
Java/JAR.hs
lgpl-3.0
1,965
0
21
520
643
316
327
55
4
module CaseIn4 where data S = S1 { x :: Int } | S2 { x :: Int } deriving Show {- map2 xs = map ( \ y -> (case y of S1 _ -> S1 1 S2 _ -> S2 1)) xs -} map2 xs = (case ((\ y -> case y of S1 _ -> S1 1 S2...
kmate/HaRe
old/testing/generativeFold/CaseIn1.hs
bsd-3-clause
422
0
13
234
144
80
64
7
3
{-# OPTIONS -fglasgow-exts #-} -- We want to get the type -- g :: forall a b c. C a (b,c) => a -> b --but GHC 6.0 bogusly gets -- g :: forall a b. C a (b,()) => a -> b module ShouldCompile where class C a b where { op :: a -> b } f x = fst (op x)
hvr/jhc
regress/tests/1_typecheck/2_pass/ghc/tc168.hs
mit
259
0
7
76
48
28
20
-1
-1
module Meas () where import Language.Haskell.Liquid.Prelude import qualified Data.Map import Data.List (foldl') ---------------------------------------------------------------- --- Step 1: Map each element into key-value list (concatMap) --- ---------------------------------------------------------------- expand ...
abakst/liquidhaskell
tests/pos/mapreduce.hs
bsd-3-clause
1,979
0
11
320
424
238
186
21
2
{-# LANGUAGE PartialTypeSignatures, NamedWildCards #-} module ScopedNamedWildcardsGood where -- The named wildcards aren't scoped as the ScopedTypeVariables extension -- isn't enabled, of which the behaviour is copied. Thus, the _a annotation of -- x, which must be Bool, isn't the same as the _a in g, which is now --...
urbanslug/ghc
testsuite/tests/partial-sigs/should_compile/ScopedNamedWildcardsGood.hs
bsd-3-clause
441
0
9
111
63
35
28
7
1
{-# LANGUAGE TypeFamilies #-} module Simple10 where type family T a foo, bar :: T a -> a foo = undefined bar x = foo x
urbanslug/ghc
testsuite/tests/indexed-types/should_compile/Simple10.hs
bsd-3-clause
123
0
6
30
41
24
17
6
1
module PositiveInteger where import Text.Trifecta import Control.Applicative import Data.Char -- 24.11, Ex. 2 parseDigit :: Parser Char parseDigit = char '0' <|> char '1' <|> char '2' <|> char '3' <|> char '4' <|> char '5' <|> char '6' <|> char '7' <|> char '8' <|> char '9' {- peeking at the implementation of `digi...
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter24/PostiveInteger/src/PositiveInteger.hs
mit
1,131
0
14
207
283
148
135
18
1
module Main ( main ) where import Data.Foldable (minimumBy) import qualified Data.Text as T import GHC.Base (until) input :: IO (Int, [(Int, Int)]) input = do raw <- readFileText "input.txt" let (a, bs) = second (zip [0 ..] . T.splitOn "," . T.strip) $ T.breakOn "\n" raw ts ...
genos/online_problems
advent_of_code_2020/day13/Main.hs
mit
932
0
17
239
459
256
203
-1
-1
{-# LANGUAGE ScopedTypeVariables #-} module Main where import Control.Monad import Data.GraphViz (GraphvizOutput(Png), runGraphviz, addExtension) import System.Console.CmdArgs import Sanre.Draw import Sanre.FileTree import Sanre.Types import Sanre.Graph conf :: Config conf = Config { directory = def &= args &= ...
triplepointfive/sanre
src/Main.hs
mit
1,075
0
12
239
255
138
117
30
1
{-# htermination succ :: Bool -> Bool #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_succ_7.hs
mit
42
0
2
8
3
2
1
1
0
{-# LANGUAGE RecordWildCards #-} module Domain.User where import Control.Lens import Control.Monad.Except import Domain.Roles import Data.Text (Text) import Data.Time import Database.Persist import DBTypes import Models import ...
wz1000/haskell-webapps
ServantPersistent/src/Domain/User.hs
mit
4,184
0
17
1,766
1,076
531
545
89
2
{-# OPTIONS_GHC -funbox-strict-fields #-} {-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE N...
MaxDaten/yage
src/Yage/Formats/Ygm.hs
mit
4,478
0
15
986
1,388
763
625
-1
-1
module Y2017.M07.D07.Exercise where import Data.Map (Map) import qualified Data.Map as Map import Data.Set (Set) {-- Today is the seventh day of the seventh month of the seven(teen)th year. WHAT DOES IT ALL MEAN? Well, for me, it means ... pause ... wait, for effect ... SCRABBLE DAY! So, given the scrabble tiles ...
geophf/1HaskellADay
exercises/HAD/Y2017/M07/D07/Exercise.hs
mit
1,428
0
9
256
207
124
83
14
1
{-# LANGUAGE MultiWayIf #-} {-# LANGUAGE OverloadedStrings #-} import ForgetYourPassword.Lib import Numeric import Options.Applicative import Text.Printf data Args = Args { passwordData :: PasswordData } plReader :: ReadM Int plReader = eitherReader $ \arg -> c...
KenetJervet/forget-your-password
app/Main.hs
mit
1,184
0
15
361
335
168
167
33
1
module Defs.Common where -- | Type for names type Name = String -- | Type for storing the variable names defined in a program newtype VariableName = V { unV :: String } deriving (Show, Eq) -- | Type for storing the function names defined in a program newtype FunctionName = F { unF :: String } deriving (Show, Eq)
alistra/data-structure-inferrer
Defs/Common.hs
mit
316
0
6
62
63
41
22
4
0
import qualified Data.ByteString as BS import System.Environment import Data.List.Split import Numeric import Data.List main :: IO () main = do args <- getArgs bs <- BS.readFile $ head args let whenLoadedOnRam = length args >= 2 && last args == "-m" let chunkSize = 16 let bytesInHex = map ( myShowHex 2 ) $ d...
igrep/ikebin-exercise
ex1-bin-dump.hs
mit
936
0
14
221
371
187
184
28
2
{- CIS-194 (Spring 2013) Source: http://www.seas.upenn.edu/~cs194/spring13/hw/06-laziness.pdf -} {-# OPTIONS_GHC -Wall #-} {-# OPTIONS_GHC -fno-warn-missing-methods #-} {-# LANGUAGE FlexibleInstances #-} module Fibonacci where -------------- -- Exercise 1 -------------- fib :: Integer -> Integer fib 0 = 0 fib 1 =...
umairsd/course-haskell-cis194
hw06/Fibonacci.hs
mit
4,532
0
13
977
1,220
655
565
61
1
{-# LANGUAGE JavaScriptFFI #-} -- | FIXME: doc module GHCJS.Electron.SystemPreferences where
taktoa/ghcjs-electron
src/GHCJS/Electron/SystemPreferences.hs
mit
94
0
3
12
9
7
2
2
0
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.SVGFitToViewBox (js_getViewBox, getViewBox, js_getPreserveAspectRatio, getPreserveAspectRatio, SVGFitToViewBox, castToSVGFitToViewBox, gTypeSVGFitToViewBox) where import Prelude ((.),...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/SVGFitToViewBox.hs
mit
2,030
12
10
280
460
283
177
33
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.HTMLBaseElement (js_setHref, setHref, js_getHref, getHref, js_setTarget, setTarget, js_getTarget, getTarget, HTMLBaseElement, castToHTMLBaseElement, gTypeHTMLBaseElement) where import...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/HTMLBaseElement.hs
mit
2,647
28
10
373
660
387
273
40
1
-- jugador = ("Nombre","Padre",(fuerza,precision)) bart = ("Bart","Homero",(25,60)) todd = ("Todd","Ned",(15,80)) rafa = ("Rafa","Gorgory",(10,1)) nombre (n,_,_) = n padre (_,p,_) = p habilidad (_,_,h) = h -- ( Tiro -> Bool, Tiro -> Tiro ) -- ((velocidad,precision,altura), efecto) laguna largo = ((\(v,_,a) -> v>80 &&...
mnicoletti/pdep-utn-frba
funcional/tps/00-beta-test.hs
mit
6,040
0
12
983
1,247
666
581
42
1
{- Determine if two files of bases are equivalent under permutations. 2009 Nathan Blythe, Dr. Oscar Boykin (see LICENSE for details) -} import System(getArgs) import Data.List import Perms eperm a b = any (== b) (permuteAll a) inperm l a = any (eperm a) l {- EquivBases <f1> <f2> -} main = do {- Comma...
nblythe/MUB-Search
EquivBases.hs
mit
806
0
12
207
233
119
114
14
1
import Test.HUnit import Data.Iter import Data.Iter.String import Data.Iter.MVar import Control.Concurrent import Control.Concurrent.MVar testFilePath = "../test/testfile.txt" tests = ["push and pull from mvar" ~: do var <- newEmptyMVar let i = ilines' . iterFile $ testFilePath forkIO $ ...
shangaslammi/haskell-iter
test/test_mvar.hs
mit
468
0
14
118
142
75
67
15
1
{-| Module : Script Description : All script datastructures -} module Script ( -- * Data structures IVIScriptArgs(..) , IVIScript(..) , IVIScriptResult(..) ) where -- | IVI script arguments data IVIScriptArgs = -- | Script arguments consist of the raw command (currently) Args S...
NorfairKing/IVI
src/Script.hs
gpl-2.0
844
0
9
223
102
67
35
17
0
-- Copyright (C) 2002-2005 David Roundy -- -- 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, or (at your option) -- any later version. -- -- This program is distributed ...
DavidAlphaFox/darcs
src/Darcs/Patch/Apply.hs
gpl-2.0
3,692
0
13
900
955
528
427
-1
-1
-- | -- -- TODO grammar-level indices should be colored red! also, make grammar -- globally available (reader monad) module FormalLanguage.CFG.PrettyPrint.ANSI -- ( grammarDoc -- , rulesDoc -- , printDoc -- , symbolDoc -- ) where where import Control.Lens hiding (outside,Index) import Control.Monad.Reader imp...
choener/FormalGrammars
FormalLanguage/CFG/PrettyPrint/ANSI.hs
gpl-3.0
3,593
0
18
943
1,363
690
673
-1
-1
-- -*- fundamental -*- -- parse haskellized expressions module ExpParse ( pline -- expression or declaration ) where import Maybes import Char import Lex import PI import Ids import Syntax import Options import Prec import Monad -------------------------------------------------------- paParen p = do { ll...
jwaldmann/rx
src/ExpParse.hs
gpl-3.0
5,880
199
18
1,629
2,414
1,239
1,175
128
4
{-# LANGUAGE TemplateHaskell #-} {-| Module : Back Description : QuickCheck properties of the voogie translator. Copyright : (c) Evgenii Kotelnikov, 2019 License : GPL-3 Maintainer : evgeny.kotelnikov@gmail.com Stability : provisional -} module Back ( main ) where import Test.QuickCheck (Proper...
aztek/voogie
tests/Back.hs
gpl-3.0
778
0
8
138
148
85
63
14
1
{-# LANGUAGE OverloadedStrings #-} module Config where import Data.Configurator import Auth loadConfig :: Worth FilePath -> IO AuthConfig loadConfig path = do cfg <- load [path] s <- require cfg "auth0_secret" i <- require cfg "auth0_issuer" a <- require cfg "auth0_audience" return $ AuthConfig { privatekey...
patrickboe/wheel
src/lib/hs/Config.hs
gpl-3.0
398
0
9
112
112
57
55
13
1
module DL3059 (tests) where import Data.Text as Text import Helpers import Test.Hspec tests :: SpecWith () tests = do let ?rulesConfig = mempty describe "DL3059 - Multiple consecutive `RUN` instructions" $ do it "ok with no `RUN` at all" $ do ruleCatchesNot "DL3059" "FROM debian:10" it "ok with one...
lukasmartinelli/hadolint
test/DL3059.hs
gpl-3.0
1,287
0
17
331
232
105
127
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-ml/gen/Network/Google/Resource/Ml/Projects/Locations/Operations/Cancel.hs
mpl-2.0
6,211
0
15
1,270
714
424
290
105
1
-- Implicit CAD. Copyright (C) 2011, Christopher Olah (chris@colah.ca) -- Copyright 2014 2015 2016, Julia Longtin (julial@turinglace.com) -- Copyright 2015 2016, Mike MacHenry (mike.machenry@gmail.com) -- Released under the GNU AGPLV3+, see LICENSE module Graphics.Implicit.ObjectUtil.GetBox3 (getBox3) where import Pr...
krakrjak/ImplicitCAD
Graphics/Implicit/ObjectUtil/GetBox3.hs
agpl-3.0
7,537
5
18
2,150
3,196
1,814
1,382
145
6
module Moonbase.Signal where import Control.Concurrent.STM import Control.Lens import Control.Monad import Moonbase.Core isDebug :: Bool isDebug = True verbose :: Moon () -> Moon () verbose f = do rt <- get when (rt ^. options ^. isVerbose) f signal :: Signal -> Moon (...
felixsch/moonbase-ng
src/Moonbase/Signal.hs
lgpl-2.1
825
0
10
193
312
156
156
25
1
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE PostfixOperators #-} -- | The logic to render Java code is contained in this module module GOOL.Drasil.LanguageRenderer.JavaRenderer ( -- * Java Code Configuration -- defines syntax of all Java code JavaCode(..) ) where import Utils.Drasil (indent) import GOOL.Drasil.Co...
JacquesCarette/literate-scientific-software
code/drasil-gool/GOOL/Drasil/LanguageRenderer/JavaRenderer.hs
bsd-2-clause
38,133
0
32
7,962
13,376
7,033
6,343
844
7
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} #if MIN_VERSION_base(4,9,0) {-# OPTIONS_GHC -fno-warn-redundant-constraints #-} #endif ----------------------------------------------------------------------------- -- | -- Module : Text.CSL.Proc.Disamb -- Copyrig...
jgm/pandoc-citeproc
src/Text/CSL/Proc/Disamb.hs
bsd-3-clause
18,840
0
19
6,546
5,739
2,984
2,755
311
15
{-# LANGUAGE TypeOperators, OverloadedStrings, MultiParamTypeClasses, GADTs #-} module Control.Wakarusa.Session.Wreq where import Data.Aeson import Control.Natural import Control.Transformation import Control.Wakarusa.Session import Network.Wreq as W import Control.Lens ((^?)) wreqClient :: ( ToJSON req, Fr...
ku-fpg/wakarusa
wakarusa-wreq/Control/Wakarusa/Session/Wreq.hs
bsd-3-clause
781
0
18
285
200
105
95
19
3
data Size = Short | Tall | Grande | Venti deriving (Eq, Ord, Bounded, Enum, Show, Read)
YoshikuniJujo/funpaala
samples/27_basic_type_classes/drinkSize1.hs
bsd-3-clause
89
2
6
18
46
25
21
2
0
-- | -- Module : Core.Utils -- Copyright : (c) Radek Micek 2009, 2010 -- License : BSD3 -- Stability : experimental -- -- Utility functions. -- module Core.Utils where import Numeric (showHex) import Data.Maybe (fromJust) import Data.List (group, groupBy, sortBy) -- | Removes duplicate items from the given sorte...
radekm/crep
Core/Utils.hs
bsd-3-clause
2,587
0
11
652
753
408
345
43
9
import Control.Monad import qualified Data.Vector.Storable as VS import Numeric.LinearAlgebra ( (><), ident, Additive(add), Linear(scale) ) import Numeric.Minimization.QuadProgPP ( solveQuadProg ) import Test.Tasty ( defaultMain, testGroup, TestTree ) import Test.Tasty.HUnit ( testCase, assertEqual, assertFailure )...
tsurucapital/hmatrix-quadprogpp
tests/small.hs
bsd-3-clause
3,848
0
18
1,552
1,186
641
545
95
2
-- This module exists so we can test the message (de)serialization without -- exposing it from Internal.Peers.Handler module Internal.Peers.Handler.Messages ( Handshake(..), PeerMsg(..), decodeI, enumPeerMsg, foreachI ) where import Control.Applicative import Control.Monad import Data.B...
enolan/whiteout
src/Internal/Peers/Handler/Messages.hs
bsd-3-clause
5,236
0
16
1,551
1,690
881
809
-1
-1
-------------------------------------------------------------------------------- module Hakyll.Core.Util.String.Tests ( tests ) where -------------------------------------------------------------------------------- import Test.Framework (Test, testGroup) import Test.HUnit ...
bergmark/hakyll
tests/Hakyll/Core/Util/String/Tests.hs
bsd-3-clause
1,019
0
13
237
167
97
70
16
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NamedFieldPuns #-} module Main where import Control.Monad.Trans import Control.Monad.Trans.Class import Control.Monad.Trans.Reader import Data.IORef import qualified Data.Map as M import Data.Maybe (fromMaybe) import Data.Text.Lazy (Text) import qualified Data.Text.Lazy ...
nicklawls/haskellbook
src/HitCounter.hs
bsd-3-clause
1,763
0
13
401
497
267
230
45
2
{-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverlappingInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE ScopedTypeVariables #-} module Generic.Routes.Show {- ( g...
fusion5/generic-web-routes
src/Generic/Routes/Show.hs
bsd-3-clause
2,577
0
10
626
769
405
364
63
1
{-# LANGUAGE TypeSynonymInstances #-} module Main where import qualified Text.XML.HXT.XPath as XP import qualified Text.XML.HXT.Core as X import qualified Network.Curl as C import qualified Network.Curl.Code as CC import qualified Network.Curl.Opts as CO import System.Environment import System.Directory (getAppUserD...
jdevelop/leproimg
Main.hs
bsd-3-clause
2,419
0
14
447
671
374
297
53
2
module Data.Number.IReal.UnsafeMemo where import Data.Number.IReal.Scalable import Control.Concurrent.MVar (newMVar, readMVar, modifyMVar_) import System.IO.Unsafe (unsafePerformIO) -- | Memoizing a function which satisfies the property @f (p-r) = scale (f p) (-r)@ for all @r > 0@. -- Unsafe; based on ideas from Len...
sydow/ireal
Data/Number/IReal/UnsafeMemo.hs
bsd-3-clause
914
0
25
253
316
162
154
20
3
module MongoDB.QueryBuilderSpec (main, spec) where import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = do describe "someFunction" $ do it "should work fine" $ do True `shouldBe` False
fujimura/mongodb-query-builder
test/MongoDB/QueryBuilderSpec.hs
bsd-3-clause
217
0
13
49
76
40
36
9
1
-- Examples from http://www.grabmueller.de/martin/www/pub/Transformers.pdf module Transformers where import Control.Monad.Identity (Identity, runIdentity) import Control.Monad.Error (ErrorT, runErrorT, throwError) import Control.Monad.Reader (MonadReader(..), ReaderT, ask, runReaderT) import Control.Monad.State (Mona...
carletes/monad-transformers
Transformers.hs
bsd-3-clause
7,850
0
15
3,423
2,580
1,259
1,321
149
4
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-} -- {-# OPTIONS_GHC -cpp -DPiForallInstalled #-} -------------------------------------------------------------------- -- | -- Copyright : (c) Andreas Reuleaux 2015 -- License : BSD2 -- Maintainer: Andreas Reuleaux <rx@a-rx.info> -- Stability : experimen...
reuleaux/pire
tests/ParserTests/Lambda.hs
bsd-3-clause
11,034
0
24
3,238
2,986
1,572
1,414
92
1
{-| Contains functionality to convert data between different types such as orgmode-parse data to internal data in this library, different types of representation of time. -} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE StandaloneDeriving #-} module Database.OrgMode.Internal.PersistDerive where import ...
rzetterberg/orgmode-sql
lib/Database/OrgMode/Internal/PersistDerive.hs
bsd-3-clause
634
0
6
90
64
40
24
-1
-1