code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
{-# LANGUAGE OverloadedStrings #-} module Main where import Data.Monoid import Data.Bifunctor import Data.Either import Test.Tasty import Test.Tasty.HUnit import Control.Monad import Control.Applicative import Control.Monad.Trans.Except import qualified Data.Text as T import qualified Data.Attoparsec.Text as A imp...
danidiaz/foldl-transduce-attoparsec
tests/tests.hs
bsd-3-clause
2,494
0
18
830
860
474
386
64
1
{-# LANGUAGE FlexibleContexts, BangPatterns #-} -- |Monadic Iteratees: -- incremental input parsers, processors, and transformers -- -- Iteratees for parsing binary data. module Data.Iteratee.Binary ( -- * Types Endian (..) -- * Endian multi-byte iteratees ,endianRead2 ,endianRead3 ,endianRead3i ,endian...
iteloo/tsuru-sample
iteratee-0.8.9.6/src/Data/Iteratee/Binary.hs
bsd-3-clause
6,174
0
20
1,472
1,871
977
894
146
5
module Blog.Widgets.Twitter (boot_twitter, get_tweets, TwitterController ( poller, twitter_tid )) where import Text.ParserCombinators.Parsec import qualified Debug.Trace as D import Network.HTTP import Network.HTTP.Headers import Network.URI ( parseURI ) import Data.Maybe ( fromJust ) import Data.List ( elemIndex, i...
prb/perpubplat
src/Blog/Widgets/Twitter.hs
bsd-3-clause
5,455
19
18
1,922
1,607
852
755
106
2
module FreeDSL.BFS.Interpreter ( runBFSState , runBFSFullState , runBFS ) where import Data.Hashable --import Control.Monad --import Data.Maybe (maybe) import Control.Monad.Free (Free(..)) import PolyGraph.ReadOnly.Graph (AdjacencyIndex(..), neighborsOf) import qualified FreeDSL.BFS.VTraversal as DSL import q...
rpeszek/GraphPlay
src/FreeDSL/BFS/Interpreter.hs
bsd-3-clause
3,951
0
12
1,032
1,495
825
670
-1
-1
module Pear.Operator.Tree where import Pear.Operator.Algebra import Control.Monad.State.Lazy import Data.Functor data AST a b = UNode { uNode :: b, child :: AST a b} | BNode { bNode :: b, lChild :: AST a b, rchild :: AST a b} | Leaf { terminal :: b } deriving (Show) -- Build an abstract sy...
Charlesetc/haskell-parsing
src/Pear/Operator/Tree.hs
bsd-3-clause
1,756
0
14
419
806
419
387
46
4
import Data.Conduit.Shell import Options.Applicative as OA import Imessage data Options = Options { buddy :: String , message :: String } main :: IO () main = execParser opts >>= runMain where opts = OA.info (helper <*> parseOptions) ( fullDesc ...
mitchty/imessage
Main.hs
bsd-3-clause
971
0
12
376
235
118
117
26
1
import Data.Maybe (fromMaybe) import Text.Read (readMaybe) getInteger :: IO Integer getInteger = fromMaybe 0 . readMaybe <$> getLine main :: IO () main = do putStrLn "Please input two number for add" putStrLn . show =<< (+) <$> getInteger <*> getInteger
YoshikuniJujo/funpaala
samples/39_learn_io/additionA.hs
bsd-3-clause
258
0
10
45
87
45
42
8
1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 Loading interface files -} {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module LoadIface ( -- Importing one thing tcLookupImported_maybe, importDecl, checkWiredInTyCon, ifCheckWiredIn...
ezyang/ghc
compiler/iface/LoadIface.hs
bsd-3-clause
52,514
475
24
17,052
8,544
4,576
3,968
-1
-1
import Types import Graphics.GL.Pal someCubes1 :: Float -> [Cube] someCubes1 t = [ newCube { cubeColor = colorHSL (x*0.01+t*0.3) 0.9 0.4 , cubeRotation = axisAngle (V3 0 1 0) 2 , cubePosition = V3 (sin (t+x*0.11)) (x*0.1-1) 0 ...
lukexi/cubensis
defs/Cubes1.hs
bsd-3-clause
520
0
13
241
203
109
94
15
1
{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving #-} module Data.Bitmap.Array.Internal ( BitmapArray(..) ) where import Data.Array.Unboxed import Data.Binary import Data.Bitmap.Class import Data.Bitmap.Pixel import Data.Bitmap.Types import Data.Serialize -- | Arrays of 32-bit RGBA pixels newtype BitmapA...
bairyn/bitmaps
src/Data/Bitmap/Array/Internal.hs
bsd-3-clause
1,366
0
14
378
378
214
164
25
0
module NeuralA where import Numeric.LinearAlgebra x = vector [-5.0,-4.9..5.0] y1 = cmap sigmoid x sigmoid :: Double -> Double sigmoid x = 1.0 / (1.0 + exp(-x)) step_func :: Double -> Double step_func x | x > 0.0 = 1.0 | otherwise = 0.0 relu :: Double -> Double relu x | x > 0.0 = x | otherwise = 0.0
chupaaaaaaan/nn-with-haskell
src/NeuralA.hs
bsd-3-clause
315
0
10
76
147
75
72
14
1
module Feldspar.Core where import Data.List import Data.Int import Data.Word type Var = Int data Expr = Int Type Integer | Float Float | Double Double | Boolean Bool | Rational Rational | Binop Binop Expr Expr | Unop Unop Expr | Parallel Expr Var Expr -- Array value. Without this, the language is ...
josefs/MiniDSL
Feldspar/Core.hs
bsd-3-clause
6,893
0
17
2,435
2,990
1,499
1,491
211
3
module Data.Knot where
kylcarte/knots
src/Data/Knot.hs
bsd-3-clause
27
0
3
7
6
4
2
1
0
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} module ModelFit.Fit where import Data.Foldable as F import Data.Monoid (Monoid (..), Sum (..)) import Control.Lens import qualified Data.Vector.Storable as VS im...
bgamari/model-fit
ModelFit/Fit.hs
bsd-3-clause
2,116
0
15
522
791
409
382
44
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} -- | This module provides a monadic facility similar (and built on top -- of) "Futhark.FreshNames". The removes the need for a (small) amount of -- boilerplate, at the cost of using some GHC extensions. The idea is -- that if your compiler pass...
HIPERFIT/futhark
src/Futhark/MonadFreshNames.hs
isc
5,062
0
10
874
1,096
611
485
105
1
{-# Language OverloadedStrings #-} {-| Module : Client.View.Cert Description : Network certificate renderer Copyright : (c) Eric Mertens, 2019 License : ISC Maintainer : emertens@gmail.com -} module Client.View.Cert ( certViewLines ) where import Client.Image.PackedImage import Cl...
dolio/irc-core
src/Client/View/Cert.hs
isc
1,221
0
11
298
278
145
133
29
3
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} module DigitalOcean.Size( Size(..), sizes ) where import Control.Applicative () import Control.Monad (liftM, mzero) import Control.Monad.IO.Class import Data.Aeson ((.:), FromJSON(..), Value(..), decode) import DigitalOcean.Bas...
satokazuma/digitalocean-kzs
src/DigitalOcean/Size.hs
mit
1,606
0
15
383
452
262
190
41
2
-- -- exponent myExponent :: Int -> Int -> Int myExponent n x | n < 0 || x < 0 = error "Positives only!" | x == 0 = 1 | otherwise = n * (myExponent n (x-1)) and' :: [Bool] -> Bool and' list = foldr (\x l -> x && l) True list concat' :: [[x]] -> [x] concat' list = foldr (\x l -> x ++ l) [] list re...
decomputed/haskellLaboratory
programmingInHaskell/chapter06.hs
mit
1,217
5
10
350
844
430
414
42
2
-- -- 10.DataChar.hs -- R_Functional_Programming -- -- Created by RocKK on 2/13/14. -- Copyright (c) 2014 RocKK. -- All rights reserved. -- -- Redistribution and use in source and binary forms are permitted -- provided that the above copyright notice and this paragraph are -- duplicated in all such forms and th...
RocKK-MD/R_Functional_Programming
Sources/10.DataChar.hs
bsd-2-clause
1,089
1
10
225
130
65
65
11
1
{-# LANGUAGE BangPatterns, CPP, MagicHash #-} ----------------------------------------------------------------------------- -- | -- Module : ExtsCompat46 -- Copyright : (c) Lodz University of Technology 2013 -- License : see LICENSE -- -- Maintainer : ghc-devs@haskell.org -- Stability : internal -- ...
rahulmutt/ghcvm
compiler/Eta/Utils/ExtsCompat46.hs
bsd-3-clause
8,932
0
8
1,824
2,174
1,271
903
127
1
{-| Functions on lists and sequences. Some of the functions follow the style of Data.Random.Extras (from the random-extras package), but are written for use with PRNGs from the "mwc-random" package rather than from the "random-fu" package. -} module Language.Hakaru.Util.Extras where import qualified Data.Seq...
suhailshergill/hakaru
Language/Hakaru/Util/Extras.hs
bsd-3-clause
3,237
1
17
909
1,257
654
603
60
3
-- Copyright (c) 2014 Eric McCorkle. All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions -- are met: -- 1. Redistributions of source code must retain the above copyright -- notice, this list of conditions...
emc2/compiler-misc
src/Control/Monad/SourceBuffer/Class.hs
bsd-3-clause
3,903
0
10
752
568
316
252
48
0
{-# LANGUAGE CPP, BangPatterns, ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {- | Copyright : (c) 2010-2012 Simon Meier (c) 2010 Jasper van der Jeugt License : BSD3-style (see LICENSE) Maintainer : Simon Meier <iridcode@gmail.com> Portability : GHC This mod...
meiersi/bytestring-builder
Data/ByteString/Lazy/Builder/BasicEncoding.hs
bsd-3-clause
24,284
0
21
5,159
2,266
1,315
951
187
2
{-# LANGUAGE RankNTypes #-} {-# OPTIONS_HADDOCK hide #-} -- | -- Lens are immensely useful for working with state but I don't want -- to pull in full Kmettoverse for small set of combinators. -- -- Here we redefine all necessary combinators. Full compatibility with -- lens is maintained. module DNA.Lens where import C...
SKA-ScienceDataProcessor/RC
MS6/dna/core/DNA/Lens.hs
apache-2.0
1,760
0
15
479
821
420
401
44
2
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelTransfer -- Copyright : (c) Sven Panne 2002-2013 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portabili...
hesiod/OpenGL
src/Graphics/Rendering/OpenGL/GL/PixelRectangles/PixelTransfer.hs
bsd-3-clause
8,389
0
11
1,966
1,386
766
620
189
30
{-# OPTIONS_GHC -fno-warn-orphans #-} -- This module is full of orphans, unfortunately module GHCi.TH.Binary () where import Data.Binary import qualified Data.ByteString as B import Data.Typeable import GHC.Serialized import qualified Language.Haskell.TH as TH import qualified Language.Haskell.TH.Syntax as TH ...
tolysz/prepare-ghcjs
spec-lts8/ghci/GHCi/TH/Binary.hs
bsd-3-clause
2,248
0
10
328
677
326
351
67
0
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Stg to C--: code generation for constructors -- -- This module provides the support code for StgCmm to deal with with -- constructors on the RHSs of let(rec)s. -- -- (c) The University of Glasgow 2004-2006 -- -----...
frantisekfarka/ghc-dsi
compiler/codeGen/StgCmmCon.hs
bsd-3-clause
10,519
0
16
2,882
1,606
846
760
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module Main where ------------------------------------------------------------------------------ import Control.Concurrent import Control.Exception (SomeException (..), bracket, catch, finally) import ...
sopvop/snap
test/suite/TestSuite.hs
bsd-3-clause
4,159
0
16
1,250
781
467
314
77
1
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="ar-SA"> <title>Groovy Support</title> <maps> <homeID>top</homeID> <mapref location="map...
kingthorin/zap-extensions
addOns/groovy/src/main/javahelp/org/zaproxy/zap/extension/groovy/resources/help_ar_SA/helpset_ar_SA.hs
apache-2.0
959
89
29
156
389
209
180
-1
-1
{-# LANGUAGE CPP #-} import System.Environment import System.FilePath import Test.Haddock checkConfig :: CheckConfig String checkConfig = CheckConfig { ccfgRead = Just , ccfgClean = \_ -> id , ccfgDump = id , ccfgEqual = (==) } dirConfig :: DirConfig dirConfig = defaultDirConfig $ takeDirecto...
Helkafen/haddock
hoogle-test/Main.hs
bsd-2-clause
609
1
11
177
148
81
67
20
1
{- Refactoring: move the definiton 'fringe' to module B2 which is a client module of D2. This example aims to test the moving of the definition and the modification of export/import -} module D2(fringe, sumSquares) where import C2 fringe :: Tree a -> [a] fringe (Leaf x) = [x] fringe (Branch left right) = fr...
kmate/HaRe
old/testing/moveDefBtwMods/D2.hs
bsd-3-clause
457
0
7
120
126
66
60
9
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE ImpredicativeTypes #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ScopedTypeVariables #-} -- | -- Module : Data.Array.Accelerate.CUDA.CodeGen.Stencil -- Copyright : [2008..2014] Manuel M T Chakravarty, Gabriele Keller ...
flowbox-public/accelerate-cuda
Data/Array/Accelerate/CUDA/CodeGen/Stencil.hs
bsd-3-clause
8,667
0
15
2,888
1,436
802
634
89
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : System.IO.Error -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintai...
beni55/haste-compiler
libraries/ghc-7.8/base/System/IO/Error.hs
bsd-3-clause
17,061
0
11
3,858
1,931
1,141
790
118
1
{-# OPTIONS_GHC -Wall #-} module B where answer_to_live_the_universe_and_everything = length [1..23*2] - 4
urbanslug/ghc
testsuite/tests/ghc-api/apirecomp001/B.hs
bsd-3-clause
111
0
8
17
26
15
11
4
1
{-# LANGUAGE QuasiQuotes #-} module S01C04Spec (main, spec) where import Test.Hspec import Heredoc import qualified S01C03 (analyze) import S01C04 (findLine) testData = [str|295f3bfae9271ae8065a3b4417545c3e5b0df11a53351c78530915392d2e 074a122ee01b17131e4e124e2322a9560ce4120e37582b24e1036fe93f30 3c08290121090ef72f2...
blast-hardcheese/cryptopals
test/S01C04Spec.hs
mit
3,452
0
14
138
110
63
47
14
1
module Main (main) where import Hyperprism import Data.Monoid (mempty) import Options.Applicative (execParser,info,short,long,metavar,help,strOption,(<>)) import System.Environment (getEnv) getApiKey :: IO ApiKey getApiKey = getEnv "GITHUB_API_KEY" getOrg :: IO Org getOrg = execParser $ info parseOrg mempty whe...
mfine/hyperprism
Main.hs
mit
506
0
11
93
175
94
81
17
1
{-# LANGUAGE CPP #-} module GHCJS.DOM.SourceBufferList ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.SourceBufferList #else #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) import GHCJS.DOM.JSFFI...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/SourceBufferList.hs
mit
361
0
5
33
33
26
7
4
0
module Display where import Data.List(intercalate) import Text.Printf(printf) class (Show a) => Display a where display :: a -> String displayList :: Display a => [a] -> IO () displayList list = printf . (++ "\n") . intercalate "\n" . map (("-" ++) . display) $ list
marcusbuffett/Clanki
src/Display.hs
mit
275
0
10
54
120
65
55
7
1
module Game.Render.Update ( Renderable(..) , removeRenderObjects , newRenderObjects , update ) where import Debug.Trace import Control.Monad.RWS.Strict import Control.Monad.State.Strict import Data.Maybe import Game.Input.Input import Control.Wire import Control.Monad import qualified Control.Wir...
mfpi/q-inqu
Game/Render/Update.hs
mit
3,927
2
11
723
435
292
143
39
2
module HaskellCourse.AE.Parser (parseExp) where import Data.Maybe (fromMaybe) import HaskellCourse.Parsing import HaskellCourse.Prim import HaskellCourse.AE.AST -- | Parse the given s-expression into an AE 'Exp'. parseExp :: SExpr -> Exp parseExp (AtomNum n) = LitInt n parseExp (AtomBool b) = LitBool b parseExp (Li...
joshcough/HaskellCourse
src/HaskellCourse/AE/Parser.hs
mit
455
0
9
71
152
81
71
10
1
-- Pretty.hs --- -- -- Filename: Pretty.hs -- Description: -- Author: Manuel Schneckenreither -- Maintainer: -- Created: Wed May 4 17:34:21 2016 (+0200) -- Version: -- Package-Requires: () -- Last-Updated: Mon Jul 23 10:23:31 2018 (+0200) -- By: Manuel Schneckenreither -- Update #: 16 -- URL: -- Doc URL:...
ComputationWithBoundedResources/ara-inference
src/Data/Rewriting/ARA/ByInferenceRules/Vector/Pretty.hs
mit
1,675
0
19
464
582
317
265
12
1
{-# LANGUAGE OverloadedStrings, NoMonomorphismRestriction, FlexibleContexts #-} module HTML.Parsec ( parseHtml, parseText, parseElement ) where import Control.Monad (liftM, void) import Control.Applicative ((<*)) import qualified Data.Text as T import Text.Parsec import Text.Parsec.Text import qu...
Hrothen/Hubert
src/HTML/Parsec.hs
mit
1,837
0
12
456
497
258
239
41
3
module HolyProject.HolyGitQueries.Test (githubAPISuite ) where import Test.Tasty (testGroup, TestTree) import Test.Tasty.HUnit import HolyProject.HolyGitQueries githubAPISuite :: TestTree githubAPISuite = testGroup "GithubAPI" [ testCase "Sean" $ ioTestEq (getGHUser ...
mankyKitty/holy-haskell-project-starter
test/HolyProject/HolyGitQueries/Test.hs
mit
714
0
10
218
156
83
73
15
1
{-# LANGUAGE PackageImports #-} import "happyscheduler" Application (develMain) import Prelude (IO) main :: IO () main = develMain
frt/happyscheduler
app/devel.hs
mit
132
1
6
19
37
20
17
5
1
{-| Module: Flaw.Graphics Description: Graphics abstraction. License: MIT Graphics system is mostly abstracted from backend. Almost everything from uploading textures to writing shader programs can be done with zero amount of backend-dependent code. Initialization of graphics subsystem is still backend-dependent thou...
quyse/flaw
flaw-graphics/Flaw/Graphics.hs
mit
15,901
0
15
3,054
3,673
1,949
1,724
259
2
{-# LANGUAGE ForeignFunctionInterface #-} {-# CFILES System/Posix/waitpid.c #-} module System.Posix.Waitpid where import Control.Monad import Data.List import Foreign import Foreign.C import Foreign.C.Types(CInt(..)) import System.Posix.Signals (Signal) import System.Posix.Types (CPid(..)) foreign import ccall unsaf...
GaloisInc/posix-waitpid
System/Posix/Waitpid.hs
mit
1,302
0
13
285
417
220
197
26
3
module Caramel where import Control.Applicative ((<*>),(<$>)) import Control.Monad (msum,replicateM) import Data.Char import Data.List (intercalate,foldl1') import Data.List.Split (splitOn) import Data.Maybe (listToMaybe,fromJust) import Text.ParserCombinators.ReadP import Text.Printf import qualified Data.Map as M im...
8l/caramel
src/Caramel.hs
mit
14,900
1
21
4,557
5,808
3,029
2,779
245
14
{-# LANGUAGE TupleSections, OverloadedStrings #-} module Forms where import Import import qualified Data.Text as T import Yesod.Form.Bootstrap3 -- form handler with default action for FormFailure and FormMissing formHandler :: FormResult a -> (a -> Handler ()) -> Handler () formHandler result f = case result of ...
haBuu/tfs-website
Forms.hs
mit
748
0
10
132
200
104
96
16
3
module Paths_minimalbug ( version, getBinDir, getLibDir, getDataDir, getLibexecDir, getDataFileName, getSysconfDir ) where import qualified Control.Exception as Exception import Data.Version (Version(..)) import System.Environment (getEnv) import Prelude catchIO :: IO a -> (Exception.IOException -> IO a...
kejace/minimalbug
dist/build/autogen/Paths_minimalbug.hs
mit
1,390
0
10
177
362
206
156
28
1
module Language.Jass.JIT.Executing( loadJassModule , loadJassModuleFromFile , withRaisedAST , optimizeModule , moduleAssembly , withJassJIT , NativeTableMaker ) where import Language.Jass.Runtime.Memory import Language.Jass.Runtime.Natives import Language.Jass.Runtime.Globals import Language.Jass.Uti...
NCrashed/hjass
src/library/Language/Jass/JIT/Executing.hs
mit
3,342
0
21
599
882
454
428
64
2
module GHCJS.DOM.QuickTimePluginReplacement ( ) where
manyoo/ghcjs-dom
ghcjs-dom-webkit/src/GHCJS/DOM/QuickTimePluginReplacement.hs
mit
56
0
3
7
10
7
3
1
0
import Data.List import System.Environment import System.FilePath import System.Process import System.INotify uniqDirs :: [FilePath] -> [FilePath] uniqDirs = nub . map takeDirectory eventHandler :: String -> [FilePath] -> FilePath -> Event -> IO () eventHandler command paths directory (Modified _ (Just file)) = ...
mastensg/monitor
monitor.hs
mit
1,045
1
12
229
423
207
216
30
2
{-# LANGUAGE BangPatterns, RankNTypes #-} {-| Space efficient bit arrays The module is meant to be imported qualified (as it is common with collection libraries). -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. This program is free software; you can redistribute it and/or modify it under the terms of...
ribag/ganeti-experiments
src/Ganeti/Objects/BitArray.hs
gpl-2.0
4,586
0
13
1,109
1,184
636
548
85
2
{-# LANGUAGE OverloadedStrings, NoMonomorphismRestriction, GADTs, TemplateHaskell #-} module Main where import Control.Applicative import Control.Lens import Data.ByteString (ByteString) import Data.Text (Text) import Data.Maybe (fromMaybe) import qualified Data.Map as M import Snap (Handler, method, Method(..), wri...
TimeAttack/time-attack-snap
src/test/Test.hs
gpl-2.0
1,625
0
16
502
398
226
172
40
5
{-# LANGUAGE ExistentialQuantification #-} {- | Module : $Header$ Description : Transforms an OMDoc file into a development graph Copyright : (c) Ewaryst Schulz, DFKI Bremen 2010 License : GPLv2 or higher, see LICENSE.txt Maintainer : Ewaryst.Schulz@dfki.de Stability : provisional Portability : non...
nevrenato/Hets_Fork
OMDoc/Import.hs
gpl-2.0
27,724
0
23
8,513
6,776
3,527
3,249
466
9
----------------------------------------------------------------------------- -- | -- Module : -- Copyright : (c) 2013 Boyun Tang -- License : BSD-style -- Maintainer : tangboyun@hotmail.com -- Stability : experimental -- Portability : ghc -- -- -- ---------------------------------------------------------------------...
tangboyun/miranda
src/MiRanda/Storage/Type.hs
gpl-3.0
3,088
0
15
881
958
560
398
80
0
module Lab2.Exercises where import Data.List import Data.Maybe import Test.QuickCheck import Data.Bits import System.Random import Control.Monad import Control.Applicative import Data.Char import Lab2.Util.Ibans import Text.Regex.Posix -- Assignment 2 / Lab 2 :: Group 14 -- -- Define Main -- main = do putStrLn "...
vdweegen/UvA-Software_Testing
Lab2/Willem/Exercises.hs
gpl-3.0
5,870
0
18
1,505
2,435
1,271
1,164
139
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} module Development.Shake.Simple (Rule, need, rule, simpleRule, simpleStoredValue, storedValue, want) where import Data.Functor (($>)) import Development.Shake (Action, Rules, S...
cblp/stack-offline
test/Development/Shake/Simple.hs
gpl-3.0
1,161
0
10
206
409
223
186
23
1
{-# LANGUAGE OverloadedStrings #-} module System.DevUtils.Base.Cloud.Amazon.EC2 ( EC2 (..), EC2Root (..), EC2Config (..), EC2Region (..), EC2InstanceType (..), EC2Size (..), EC2ValueColumns (..) ) where import System.DevUtils.Base.Cloud.Amazon.Misc import System.DevUtils.Base.Currency import Data.Aeson import ...
adarqui/DevUtils-Base
src/System/DevUtils/Base/Cloud/Amazon/EC2.hs
gpl-3.0
2,078
1
17
397
692
394
298
81
0
-- Copyright 2016, 2017 Robin Raymond -- -- This file is part of Purple Muon -- -- Purple Muon 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) an...
r-raymond/purple-muon
src/Client/Assets/Texture.hs
gpl-3.0
1,966
0
20
538
321
190
131
26
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-containerbuilder/gen/Network/Google/Resource/Cloudbuild/Operations/List.hs
mpl-2.0
6,632
0
18
1,567
971
567
404
129
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/TargetingTemplates/List.hs
mpl-2.0
8,604
0
25
2,229
1,335
765
570
188
1
{- Copyright 2015 Arun Raghavan <mail@arunraghavan.net> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed t...
ford-prefect/xml2ucm
src/Main.hs
apache-2.0
3,213
0
14
911
689
351
338
64
4
-- see: http://learnyouahaskell.com/syntax-in-functions#guards-guards module Guards where import Data.Monoid import Numeric -- output echo :: String -> String -> IO () echo msg_one msg_two = putStrLn $ msg_one `Data.Monoid.mappend` msg_two -- see: http://www.whathealth.com/bmi/formula.html calcBmi :: (RealFloat a)...
dnvriend/study-category-theory
haskell/learn_a_haskell/ch3/guards.hs
apache-2.0
1,240
0
10
271
345
172
173
24
1
-- Copyright 2014 (c) Diego Souza <dsouza@c0d3.xxx> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicabl...
locaweb/leela
src/warpdrive/src/Leela/Version.hs
apache-2.0
897
0
4
150
61
43
18
9
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleContexts #-} -- | Defines Parse class and its generic counterpart -- for easier parsing of packets. module Packet.Parse where import Data.Char import GHC.Generics import ...
mgajda/tinyMesh
Packet/GenericParse.hs
bsd-2-clause
2,429
0
15
841
559
297
262
46
4
{-# LANGUAGE OverloadedStrings #-} -- | This module implements parsing and rendering of CommonMark documents. -- -- CommonMark is a standard, unambiguous syntax specification for Markdown. -- See <http://commonmark.org> for more details. -- -- * The implementation is intended to ultimately become fully compliant -- ...
Jubobs/CommonMark-WIP
src/CommonMark.hs
bsd-3-clause
1,788
0
11
392
217
137
80
27
2
-- To be included in other files: ----------------------------------------------------------------------------- pushWork :: StepCode () -> StepCode () popWork :: R.ReaderT Sched IO (Maybe (StepCode ())) pushWork a = do Sched { workpool } <- R.ask C.liftIO$ hotVarTransaction $ do xs <- readHotVarRaw wo...
rrnewton/Haskell-CnC
Intel/simple_stack.hs
bsd-3-clause
703
0
17
172
203
95
108
-1
-1
{-# LANGUAGE UnicodeSyntax #-} module Compiler.Codegen.Model where data JExpr = JAtom String | JNew String | JDispatch JExpr String [JExpr] | JCast String JExpr | JUnop String JExpr | JBin JExpr String JExpr | JInvoke JExpr [JExpr] data JAttr = JFinal ...
YoEight/hk-coolc
src/Compiler/Codegen/Model.hs
bsd-3-clause
948
0
8
346
252
150
102
29
0
{-# LANGUAGE MultiParamTypeClasses, TypeFamilies #-} module Rubik.V3 where import Rubik.Abs import Rubik.Axis import Rubik.D3 import Rubik.Negate as N import Rubik.Sign as S import Rubik.Turn as T import Rubik.V2 import Rubik.Key as K data V3 a = V3 a a a deriving (Eq,Ord,Show) data Turn3D = Turn3D T...
andygill/rubik-solver
src/Rubik/V3.hs
bsd-3-clause
863
0
10
216
421
218
203
22
0
{-# LANGUAGE ScopedTypeVariables #-} module Angel.Files ( getFile , startFileManager ) where import Control.Exception ( try , SomeException ) import Control.Concurrent.STM ( readTChan , writeTChan , atomically ...
zalora/Angel
src/Angel/Files.hs
bsd-3-clause
1,488
0
15
533
387
198
189
40
2
----------------------------------------------------------------------------- -- | -- Module : XMonad.Prompt.DirExec -- Copyright : (C) 2008 Juraj Hercek -- License : BSD3 -- -- Maintainer : juhe_xmonad@hck.sk -- Stability : unstable -- Portability : unportable -- -- A directory file executables pro...
MasseR/xmonadcontrib
XMonad/Prompt/DirExec.hs
bsd-3-clause
3,714
0
17
846
497
287
210
34
2
----------------------------------------------------------------------------- -- | -- Module : HSX.XMLGenerator -- Copyright : (c) Niklas Broberg 2008 -- License : BSD-style (see the file LICENSE.txt) -- -- Maintainer : Niklas Broberg, nibro@cs.chalmers.se -- Stability : experimental -- Port...
abuiles/turbinado-blog
tmp/dependencies/hsx-0.4.5/src/HSX/XMLGenerator.hs
bsd-3-clause
7,075
0
13
1,739
1,999
1,053
946
-1
-1
-- -- Annotation.hs -- -- Annotation of the expression tree. -- -- Gregory Wright, 8 November 2011 -- module Math.Symbolic.Wheeler.Annotation where class Functor expr => Annotated expr where ann :: expr a -> a amap :: (a -> a) -> expr a -> expr a
gwright83/Wheeler
src/Math/Symbolic/Wheeler/Annotation.hs
bsd-3-clause
259
0
9
57
69
39
30
4
0
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE KindSignatures #-} module Types where import Language.Haskell.TH.Lib import Language.Haskell.TH.Syntax import Util -- type A = forall a. B a; type B a = Maybe a; expand [t|B A|] type ListOf x = [x] type Fo...
DanielSchuessler/th-expand-syns
testing/Types.hs
bsd-3-clause
862
0
17
201
254
147
107
24
0
module Linear.Simplex.PrimalSpec (main, spec) where import Linear.Simplex.PrimalSpec.Types import Linear.Simplex.Primal import Linear.Simplex.Primal.Types import Linear.Grammar import Test.Hspec import Test.QuickCheck import Data.Maybe import qualified Data.Map as M import Control.Applicative main :: IO () main = h...
athanclark/simplex-basic
test/Linear/Simplex/PrimalSpec.hs
bsd-3-clause
5,535
0
21
1,408
2,074
1,068
1,006
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TemplateHaskell #-} module Onedrive.Types.FileSystemInfoFacet where import Control.Lens (makeLensesWith, camelCaseFields) import Data.Aeson (FromJSON(parseJSON), Value(Object), (.:)) import D...
asvyazin/hs-onedrive
src/Onedrive/Types/FileSystemInfoFacet.hs
bsd-3-clause
776
0
9
101
147
86
61
19
0
{-# LANGUAGE CPP #-} module Test.Unit.Module ( tests ) where import Test.Tasty.TestSet (group) import Bead.Config (initTaskAssertions) import Bead.Config.Parser (parseTests) import Bead.Controller.Pages (pageDescTest) import Bead.Daemon.Logout (logoutQueueTests) import Bead.Domain.Entities (asgTests, entityTest...
pgj/bead
test/Test/Unit/Module.hs
bsd-3-clause
2,350
0
7
252
489
263
226
48
1
{-# LANGUAGE RecordWildCards, DeriveDataTypeable, ViewPatterns, TupleSections #-} module Core( Equal(..), sym, Goal(..), State(..), resetState, getState, getProofs, getGoals, defineFunction, defineData, addGoal, firstGoal, firstSubgoal, rewriteExp, applyProof, splitCase, splitCon, splitOther, r...
ndmitchell/qed
v1/Core.hs
bsd-3-clause
8,104
0
18
2,059
3,308
1,766
1,542
144
3
{- | Provide iteratee-based IO as described in Oleg Kiselyov's paper 'http://okmij.org/ftp/Haskell/Iteratee/'. Oleg's original code uses lists to store buffers of data for reading in the iteratee. This package allows the use of arbitrary types through use of the ListLike type class. Iteratees can be thought of as st...
iteloo/tsuru-sample
iteratee-0.8.9.6/src/Data/Iteratee.hs
bsd-3-clause
2,473
0
5
413
66
45
21
12
0
-- | This bitmap type is deprecated; use 'Data.Bitmap.String' instead -- -- | Bitmaps represented as strings -- -- The module provides polymorphic support for representation of bitmaps as strings. -- This module is designed to be most efficient with lazy bytestrings. module Data.Bitmap.StringRGB32 {-# DEPRECATED "Use ...
bairyn/bitmaps
src/Data/Bitmap/StringRGB32.hs
bsd-3-clause
429
0
4
66
26
20
6
3
0
-- (c) The University of Glasgow 2006 -- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 -- -- The @Class@ datatype {-# LANGUAGE CPP, DeriveDataTypeable #-} module Class ( Class, ClassOpItem, ClassATItem(..), ClassMinimalDef, DefMethInfo, pprDefMethInfo, defMethSpecOf...
tjakway/ghcjvm
compiler/types/Class.hs
bsd-3-clause
11,156
0
12
3,137
1,713
987
726
140
2
{-# LANGUAGE CPP, MultiParamTypeClasses, FlexibleInstances, FlexibleContexts #-} {-# OPTIONS -Wall #-} module Language.Haskell.TH.Build.Convertible where import Language.Haskell.TH import Data.Char import Control.Monad isUpperName :: Name -> Bool isUpperName = liftM2 (||) (==':') isUpper . head . nameBase ifUpperThe...
DanielSchuessler/th-build
Language/Haskell/TH/Build/Convertible.hs
bsd-3-clause
6,410
0
14
1,141
1,974
1,060
914
-1
-1
import System.Environment import System.Directory import System.IO import Data.List main = do (command:args) <- getArgs let (Just action) = lookup command dispatch action args dispatch :: [(String, [String] -> IO ())] dispatch = [ ("add", add), ("view", view), ("remove", remove) ] add :: [String] -> IO (...
leichunfeng/learnyouahaskell
todo.hs
mit
1,097
0
15
239
415
207
208
31
1
module UtilSpec (main, spec) where import Test.Hspec import Util main :: IO () main = hspec spec spec :: Spec spec = do describe "normalizeFields" $ do it "converts to snake_case" $ do normalizeFields "Record" ["foo", "fooBar", "fooBarBaz"] `shouldBe` ["foo", "foo_bar", "foo_bar_baz"...
sol/json-fu
test/UtilSpec.hs
mit
778
0
18
171
204
109
95
16
1
-- | Test out contatentation. -- Concatenation is a core operation that exercises the representation of nested -- arrays, as well as the extractsPR function from the dph-lifted-vseg library. import Vectorised import Test.HUnit import qualified Data.Array.Parallel.PArray as PA arr2 :: [[Int]] arr2 = [ [...
mainland/dph
dph-examples/examples/smoke/prims/Concat/Main.hs
bsd-3-clause
857
0
13
232
361
213
148
13
1
module HaskellHighlighter (highlightHaskell) where import Language.Haskell.Lexer highlightHaskell :: String -> String highlightHaskell src = init (colorize (lexerPass0 (src++"\n"))) -- the lexer requires this newline for single-line comments to work colorize :: [PosToken] -> String colorize [] = "" colorize ((_,(_,"...
TomMD/irc-core
driver/HaskellHighlighter.hs
bsd-3-clause
2,266
0
12
1,013
590
312
278
64
43
{-# LANGUAGE FlexibleContexts, TypeFamilies #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Packed.Array.Solve -- Copyright : (c) Alberto Ruiz 2009 -- License : BSD3 -- Maintainer : Alberto Ruiz -- Stability : provisional -- -- Solution of gener...
kjslag/hTensor
lib/Numeric/LinearAlgebra/Array/Solve.hs
bsd-3-clause
12,787
1
17
3,258
3,844
2,041
1,803
205
3
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_HADDOCK show-extensions #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} -- | -- Module ...
noughtmare/yi
yi-core/src/Yi/Tag.hs
gpl-2.0
5,265
0
14
1,383
1,152
663
489
94
3
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE LambdaCase #-} {-# LANGUA...
wskplho/stack
src/Stack/Config.hs
bsd-3-clause
21,247
0
33
6,483
4,683
2,346
2,337
414
13
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} -- | Test suite for Stack.Dot module Stack.DotSpec where import Control.Monad (filterM) import Data.Foldable as F import Data.Functor.Identity import Data.List ((\\)) import qualified Data.Map...
AndreasPK/stack
src/test/Stack/DotSpec.hs
bsd-3-clause
5,531
0
24
1,274
1,561
845
716
102
30
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP , GHCForeignImportPrim , NoImplicitPrelude , MagicHash , UnboxedTuples , UnliftedFFITypes #-} {-# LANGUAGE CApiFFI #-} -- We believe we could deorphan this module, by moving lots of things -- around, but we haven't go...
ezyang/ghc
libraries/base/GHC/Float.hs
bsd-3-clause
51,084
1
29
16,582
11,209
5,929
5,280
-1
-1
-- !!! Type sigs in instance decl module M where data T = T Int instance Eq T where (==) :: T -> T -> Bool T x == T y = x == y
ghc-android/ghc
testsuite/tests/module/mod45.hs
bsd-3-clause
132
0
7
40
58
31
27
-1
-1
module Vogogo.Transaction (sendEFT) where import Data.Fixed (Centi) import Control.Monad (when) import Currency (ISO4217Currency) import Data.Aeson ((.=)) import Control.Error (EitherT(..), throwT, runEitherT) import Network.Http.Client (getStatusCode) import qualified Data.Aeson as Aeson import qualified Data.Text as...
singpolyma/vogogo-haskell
Vogogo/Transaction.hs
isc
1,027
26
13
183
381
205
176
29
1
module Control.Concurrent.STM.ClosableQueue where import Control.Concurrent.STM import Control.Concurrent.STM.TBMQueue import Control.Concurrent.STM.TMQueue class ClosableQueue q where isClosedQueue :: q -> STM Bool closeQueue :: q -> STM () instance ClosableQueue (TMQueue a) where isClosedQueue = isClosedT...
MRudolph/stm-chans-class
src/Control/Concurrent/STM/ClosableQueue.hs
mit
462
0
9
66
111
63
48
13
0
{-# LANGUAGE CPP #-} {-# LANGUAGE TypeFamilies #-} {- | Module : System.Log.Handler.Simple Copyright : Copyright (C) 2004-2011 John Goerzen License : BSD3 Maintainer : John Goerzen <jgoerzen@complete.org> Stability : provisional Portability: portable Simple log handlers Written b...
serokell/log-warper
src/System/Wlog/LogHandler/Simple.hs
mit
4,178
0
16
1,037
943
507
436
-1
-1
module Data.ExplicitMinHeap( ExplicitMinHeap(..), empty, isEmpty, insert, merge, findMin, deleteMin, ) where import Data.Heap data ExplicitMinHeap h a = E | NE a (h a) instance Heap h => Heap (ExplicitMinHeap h) where empty = E isEmpty E = True isEmpty _ = False findMin (NE x _) = x delet...
syunta/PFDS
Data/ExplicitMinHeap.hs
mit
672
0
12
244
301
154
147
24
0
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE ViewPatterns #-} module Hpack.Syntax.DependencyVersion ( githubBaseUrl , GitRef , GitUrl , VersionConstraint(..) , versionConstraint , anyVersion , versionRange , DependencyVersion(..) , withDependencyVersion , dependen...
sol/hpack
src/Hpack/Syntax/DependencyVersion.hs
mit
6,305
0
17
1,219
1,766
914
852
140
11
module Yesod.Hunt ( module Yesod.Hunt.SubSite , module Yesod.Hunt.Routes ) where import Yesod.Hunt.SubSite import Yesod.Hunt.Routes
hunt-framework/yesod-hunt
src/Yesod/Hunt.hs
mit
133
0
5
15
34
23
11
5
0
module Server.HandleUserInput where import Server.ClientQueries import Server.GlobalState import Data.Schema import Utils.Utils import CodeGen.Metadata.SimpleRecord import CodeGen.Metadata.SimpleSubInstance import CodeGen.Metadata.CoLimit import Data.Types import Server.Execute import CodeGen.Metadata.Metadata import ...
jvictor0/JoSQL
Server/HandleUserInput.hs
mit
11,730
1
31
2,265
3,809
1,843
1,966
217
10