code
stringlengths
5
1.03M
repo_name
stringlengths
5
90
path
stringlengths
4
158
license
stringclasses
15 values
size
int64
5
1.03M
n_ast_errors
int64
0
53.9k
ast_max_depth
int64
2
4.17k
n_whitespaces
int64
0
365k
n_ast_nodes
int64
3
317k
n_ast_terminals
int64
1
171k
n_ast_nonterminals
int64
1
146k
loc
int64
-1
37.3k
cycloplexity
int64
-1
1.31k
module Syntax.ANF ( ) where import Text.PrettyPrint.Leijen data
kvanberendonck/ssa-to-cps
src/Syntax/ANF.hs
bsd-3-clause
76
1
5
20
17
11
6
-1
-1
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, TemplateHaskell, FlexibleContexts #-} module TypeSystem.Rule where import Utils.Utils import Utils.ToString import TypeSystem.Types import TypeSystem.Syntax import TypeSystem.ParseTree import TypeSystem.Expression import TypeSystem.Relation import Data.Maybe im...
pietervdvn/ALGT
src/TypeSystem/Rule.hs
bsd-3-clause
11,490
515
18
2,161
3,742
1,965
1,777
230
1
{-# LANGUAGE UnicodeSyntax #-} {-# LANGUAGE OverloadedStrings #-} module Main where import Grammar import GrammarLexer import GrammarProcessing import Generator import System.Environment import System.IO import Data.Either.Combinators import Filesystem.Path import Filesystem.Path.CurrentOS generateParser ∷ String → S...
flyingleafe/parser-gen
app/Main.hs
bsd-3-clause
1,289
0
14
373
329
173
156
36
3
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} module Language.PiSigma.Equality ( eq ) where import Control.Monad import Language.PiSigma.Evaluate import Language.PiSigma.Syntax class Equal a where eq :: a -> a -> Eval () instance Equal (Clos Term) where eq t u = do t' <- e...
zlizta/PiSigma
src/Language/PiSigma/Equality.hs
bsd-3-clause
4,701
10
16
1,728
2,511
1,312
1,199
118
2
-- | Input and output. -- -- TODO: input. module Propane.IO ( saveRaster , saveRastimation ) where import qualified Data.Array.Repa as R import qualified Data.Array.Repa.IO.DevIL as D import qualified Data.Foldable as F import Control.Monad import Control.Concurrent.Spawn import Control.Exceptio...
kmcallister/propane
Propane/IO.hs
bsd-3-clause
1,768
0
15
354
378
213
165
29
1
-- TODO: Review and possibly move elsewhere. This code was part of the -- RecentPackages (formerly "Check") feature, but that caused some cyclic -- dependencies. module Distribution.Server.Packages.Render ( -- * Package render PackageRender(..) , DependencyTree , IsBuildable (..) , doPackageRender --...
chrisdotcode/hackage-server
Distribution/Server/Packages/Render.hs
bsd-3-clause
10,234
0
16
2,637
2,362
1,293
1,069
174
8
module Code07 where import Data.List (minimumBy) import Data.Ord (comparing) data Tree = Leaf Int | Fork Tree Tree deriving (Eq,Show) fringe :: Tree -> [Int] fringe (Leaf x) = [x] fringe (Fork xt yt) = fringe xt ++ fringe yt treeRec :: [Int] -> Tree treeRec [x] = Leaf x treeRec xs = Fork (treeRec ys) (...
sampou-org/pfad
Code/Code07.hs
bsd-3-clause
3,241
0
10
1,057
1,556
837
719
77
3
-- Hesthoppning -- Problem ID: hesthoppning Time limit: 7 seconds Memory limit: 1024 MB -- Input: första raden: rutans storlek: N och M, separerade med ett blanksteg. -- N rader med M tecken: Ett ’.’= tom, ’#’ = sten, ’H’ = hest -- Hagen är omgiven av stängsel. Det är garanterat att indata alltid innehåller exakt två ’...
patrikja/progolymp
onlinekval/2015/hesthoppning.hs
bsd-3-clause
4,346
151
9
1,052
1,561
865
696
79
2
-- -- Copyright (c) 2009-2011, ERICSSON AB -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list...
emwap/feldspar-compiler
lib/Feldspar/Compiler/Backend/C/Platforms.hs
bsd-3-clause
8,147
0
16
2,113
2,225
1,197
1,028
128
3
{-# LANGUAGE TemplateHaskell #-} module SyntaxHighlighting.AsSVGPt where {- Draws parsetrees as images -} import Utils.Utils import Utils.Image import TypeSystem import SyntaxHighlighting.Coloring import SyntaxHighlighting.Renderer import Text.Blaze.Svg11 ((!), stringValue) import qualified Text.Blaze.Svg11 as S ...
pietervdvn/ALGT
src/SyntaxHighlighting/AsSVGPt.hs
bsd-3-clause
4,973
288
12
1,078
1,977
1,096
881
134
1
{-# LANGUAGE OverloadedStrings, DeriveDataTypeable , NoMonomorphismRestriction #-} import MFlow.Wai.Blaze.Html.All hiding (footer, retry,step, push) import Control.Monad.State import Data.Monoid import Control.Applicative import Control.Concurrent import Control.Workflow as WF import Control.Workflow.Stat import ...
agocorona/MFlow
tests/workflow.hs
bsd-3-clause
7,629
5
25
2,512
2,127
1,030
1,097
181
6
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, GADTs, ScopedTypeVariables, FlexibleContexts, TemplateHaskell #-} {-| This module contains functionality related to K3's let-bound polymorphism model. -} module Language.K3.TypeSystem.Polymorphism ( generalize , polyinstantiate ) where import Control.Applicativ...
DaMSL/K3
src/Language/K3/TypeSystem/Polymorphism.hs
apache-2.0
4,172
0
18
903
1,132
589
543
89
5
module DebuggerUtils ( dataConInfoPtrToName, ) where import ByteCodeItbls import FastString import TcRnTypes import TcRnMonad import IfaceEnv import CgInfoTbls import SMRep import Module import OccName import Name import Outputable import Constants import MonadUtils () import Util import Data.Char import For...
mcmaniac/ghc
compiler/ghci/DebuggerUtils.hs
bsd-3-clause
5,002
0
15
1,526
784
432
352
55
3
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE UndecidableInstances #-} -- | Provides functions for manipulating articulation. module Music.Score.Articulation ( ...
music-suite/music-score
src/Music/Score/Articulation.hs
bsd-3-clause
14,942
0
10
3,341
4,500
2,414
2,086
-1
-1
-- | -- Module : Basement.FinalPtr -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : portable -- -- A smaller ForeignPtr reimplementation that work in any prim monad. -- -- Here be dragon. -- {-# LANGUAGE MagicHash #-} {-# LANGUAGE Unboxe...
vincenthz/hs-foundation
basement/Basement/FinalPtr.hs
bsd-3-clause
3,919
0
11
785
1,063
543
520
74
1
import Control.Monad (unless) import Data.List (isInfixOf) import StackTest main :: IO () main = do stack ["setup"] stackCheckStderr ["test", "--coverage"] $ \out -> do unless ("The coverage report for foo's test-suite \"foo-test\" is available at" `isInfixOf` out) $ fail "Coverage report d...
juhp/stack
test/integration/tests/3997-coverage-with-cabal-3/Main.hs
bsd-3-clause
333
1
14
72
94
48
46
9
1
module Main where import GUI.Main (runGUI) import System.Environment import System.Exit import System.Console.GetOpt import Data.Version (showVersion) import Paths_threadscope (version) ------------------------------------------------------------------------------- main :: IO () main = do args <- getArgs (f...
ml9951/ThreadScope
Main.hs
bsd-3-clause
2,387
0
16
580
695
366
329
57
4
{-# LANGUAGE Haskell98 #-} {-# LINE 1 "Network/Wai/Handler/Warp/IO.hs" #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} module Network.Wai.Handler.Warp.IO where import Data.ByteString (ByteStrin...
phischu/fragnix
tests/packages/scotty/Network.Wai.Handler.Warp.IO.hs
bsd-3-clause
1,157
0
15
433
270
141
129
27
3
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.GLU.Errors -- Copyright : (c) Sven Panne 2002-2013 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portable -- -- ...
hesiod/OpenGL
src/Graphics/Rendering/OpenGL/GLU/Errors.hs
bsd-3-clause
1,392
0
6
200
85
64
21
6
1
module Main where ------------------------------------------------------------------------------- import Data.Conduit import Data.Conduit.Binary import Data.Conduit.List import System.IO ------------------------------------------------------------------------------- import ...
fpinsight/hadron
src/Hadron/OutputFixer.hs
bsd-3-clause
554
0
9
96
81
46
35
12
1
{-# LANGUAGE FlexibleInstances, FlexibleContexts, GADTs, OverloadedStrings #-} -- | Hash manipulation and callbacks. module Haste.Hash ( onHashChange, onHashChange', setHash, getHash, setHash', getHash' ) where import Haste.Foreign import Control.Monad.IO.Class import Haste.Prim -- | Register a callback to be ru...
beni55/haste-compiler
libraries/haste-lib/src/Haste/Hash.hs
bsd-3-clause
2,025
0
11
469
408
212
196
34
1
maxSubarray :: (Num a, Ord a) => [a] -> a maxSubarray [x] = x maxSubarray (x:xs) = snd $ foldl msReducer (x, x) xs msReducer :: (Num a, Ord a) => (a, a) -> a -> (a, a) msReducer (maxEndingHere, maxSoFar) x = (meh, maxSoFar `max` meh) where meh = x `max` (maxEndingHere + x) testMaxSubarray :: Bool testMaxSubarray ...
warreee/Algorithm-Implementations
Maximum_Subarray/Haskell/jcla1/kadane.hs
mit
499
0
11
126
295
171
124
10
1
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} {-# LANGUAGE ImplicitParams, RankNTypes #-} -- This program failed to typecheck in an early version of -- GHC with impredicative polymorphism, but it was fixed by -- doing pre-subsumption in the subsumption check. -- Trac bug #821 module ShouldCompile where type PP...
urbanslug/ghc
testsuite/tests/typecheck/should_compile/tc208.hs
bsd-3-clause
379
0
6
66
39
27
12
6
1
-- | Convenience methods and types for interacting with "Network.Curl". module LinkChecker.Curl ( CurlResult , statusCode , redirectTarget , getFinalRedirectTarget , processUrl ) where import Data.Version (showVersion) import Foreign.C.Types (CChar, CInt) import Foreign (Ptr) import Network.Cu...
bdesham/link-checker
src/LinkChecker/Curl.hs
isc
3,931
0
17
1,184
628
328
300
60
4
{-# LANGUAGE PatternGuards #-} module Draw ( drawState , drawWorld) where import State import World import Geometry.Segment import Graphics.Gloss import Graphics.Gloss.Geometry.Line import qualified Data.Vector.Unboxed as V import Data.Maybe drawState :: State -> Picture drawState state | ModeDisplayWorld <- sta...
gscalzo/HaskellTheHardWay
gloss-try/gloss-master/gloss-examples/picture/Visibility/Draw.hs
mit
2,703
97
15
601
936
494
442
85
2
-- | Configuration for Hablog {-# LANGUAGE OverloadedStrings #-} module Web.Hablog.Config where import Data.Text.Lazy (Text) -- | Data type to set the theme for your Hablog blog data Theme = Theme { bgTheme :: FilePath -- ^ General theme for hablog. a file path for a css file , codeTheme :: FilePath -- ^ Them...
soupi/hablog
src/Web/Hablog/Config.hs
mit
1,349
0
8
256
262
164
98
35
1
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE...
parsonsmatt/scotty-persistent-example
Model.hs
mit
697
0
7
218
51
34
17
13
0
{-# LANGUAGE DeriveDataTypeable, ScopedTypeVariables #-} module Contas.Couch where import Control.Monad import Data.Data (Data, Typeable) import Database.CouchDB import Text.JSON import Text.JSON.Generic (toJSON, fromJSON, decodeJSON) data Item = Item { blob, ref :: String } deriving (Eq, Show, Data, Typeable) ...
lessandro/contas
src/etc/Couch.hs
mit
1,649
3
15
356
494
253
241
39
1
module Example where import MicroKanren.Plain import MicroKanren.Cons emptyS ∷ SC α emptyS = ([], 0) aANDb ∷ Goal Int aANDb = conj (callFresh (\a -> a === LVal 7)) (callFresh (\b -> disj (b === LVal 5) (b === LVal 6))) ex1, ex2 ∷ [SC Int] ex1 = callFresh (\q -> q === LVal 5) emptyS ex2 = aANDb emptyS fives, si...
Oregu/featherweight
Example.hs
mit
705
0
14
165
361
190
171
-1
-1
{-# htermination (==) :: Char -> Char -> Bool #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_EQEQ_3.hs
mit
50
0
2
10
3
2
1
1
0
{- arch-tag: CSV tests main file Copyright (C) 2005-2011 John Goerzen <jgoerzen@complete.org> All rights reserved. For license and copyright information, see the file LICENSE -} module Str.CSVtest(tests) where import Test.HUnit import Data.CSV import Text.ParserCombinators.Parsec test_csv = let f inp exp = Tes...
haskellbr/missingh
missingh-all/testsrc/Str/CSVtest.hs
mit
1,034
0
15
311
330
178
152
20
2
{-# htermination minusFM :: (Ord a, Ord k) => FiniteMap (a,k) b1 -> FiniteMap (a,k) b2 -> FiniteMap (a,k) b1 #-} import FiniteMap
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/FiniteMap_minusFM_12.hs
mit
130
0
3
23
5
3
2
1
0
module Chorale.Test.Common ( tests) where import Chorale.Common import Chorale.Test import Data.List import Safe import Test.Framework hiding (testGroup) import Test.Framework.Providers.HUnit import Test.Framework.Providers.QuickCheck2 import Test.HUnit hiding (Test) import Test.QuickCheck.Property -- --== Tests...
mocnik-science/chorale
tests/Chorale/Test/Common.hs
mit
5,380
0
14
1,155
1,696
901
795
-1
-1
{-# OPTIONS_HADDOCK show-extensions #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE Safe #-} {-| Module : MPD.Commands.Types Copyright : (c) Joachim Fasting, 2014 License : MIT Maintainer : joachifm@fastmail.fm Stability : unstable Portability : unportable Encodi...
joachifm/nanompd
src/MPD/Commands/Types.hs
mit
6,245
0
24
1,464
2,016
1,118
898
264
1
module SpecHelper (module Helper) where import Test.Hspec as Helper import Parser.Lexer as Helper import Parser.Types as Helper import Parser.Syntax as Helper hiding (context)
Jiggins/Final-Year-Project
test/SpecHelper.hs
mit
183
0
5
30
44
31
13
5
0
{- ifl-haskell: "Implementing Functional Languages: a tutorial" in Haskell. Copyright 2014 Nikita Karetnikov <nikita@karetnikov.org> 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...
binesiyu/ifl
src/Core/Parser/Tests.hs
mit
11,615
0
19
3,771
4,241
2,396
1,845
210
1
---------------------------------------------- -- CIS 194, Homework 5 -- Author: Glenn R. Fisher -- Date: April 9, 2016 ---------------------------------------------- {-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-} import ExprT import Parser import StackVM import qualified Data.Map as M -- Evaluate an expr...
glennrfisher/cis194-haskell
05 Type Classes/Calc.hs
mit
4,775
31
10
1,119
1,177
620
557
75
2
module GHCJS.DOM.SVGFEOffsetElement ( ) where
manyoo/ghcjs-dom
ghcjs-dom-webkit/src/GHCJS/DOM/SVGFEOffsetElement.hs
mit
48
0
3
7
10
7
3
1
0
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} module PostgREST.Error ( apiRequestError , pgError , simpleError , singularityError , binaryFieldError , connectionLostError , encodeError ) where import Protolude import Data.Aeson ...
Skyfold/postgrest
src/PostgREST/Error.hs
mit
6,837
0
13
1,464
2,010
1,071
939
148
28
{-# LANGUAGE NoImplicitPrelude #-} module Main ( main ) where import Graphics.Caramia.Color import Graphics.Caramia.Prelude import Test.Framework import Test.Framework.Providers.QuickCheck2 main :: IO () main = defaultMain tests tests :: [Test] tests = [ testProperty "floatToWord8 . word8ToFloat = id" floatword...
Noeda/caramia
tests/color/Main.hs
mit
411
0
8
67
103
59
44
13
1
module Main where import Control.Monad (unless, void) import Data.IORef import Graphics.GLUtil import Graphics.UI.GLUT hiding (exit, shaderType) import Foreign.Marshal.Array (withArray) import Foreign.Storable (sizeOf) import System.Exit (exitFailur...
triplepointfive/hogldev
tutorial12/Tutorial12.hs
mit
4,995
0
18
1,457
1,275
627
648
128
1
{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} -- | Lastfm authentication procedure helpers -- -- Basically, lastfm provides 3 ways to authenticate user: -- -- - web application - <http://www.last.fm/api/webauth> -- -- - desktop application - <http://www.last.fm/api/desktopauth> --...
supki/liblastfm
src/Lastfm/Authentication.hs
mit
2,003
0
9
314
220
137
83
22
1
----------------------------------------------------------------------------- -- | -- Module : TurtleGraphics -- Copyright : Joe Jevnik 27.9.2013 -- License : GPL v2 -- -- Maintainer : Joe Jevnik -- Stability : experimental -- Portability : requires ImageUtils and devIL. -- -- An example application...
llllllllll/imageutils
src/turtle.hs
gpl-2.0
8,353
4
21
4,430
1,991
1,052
939
130
4
{-# LANGUAGE ImpredicativeTypes #-} module FrontEnd.Tc.Monad( CoerceTerm(..), Tc(), TcInfo(..), TypeEnv(), TcEnv(..), tcRecursiveCalls_u, Output(..), addCoerce, addPreds, composeCoerce, addRule, addToCollectedEnv, boxyInstantiate, boxySpec, deconstructorInstan...
dec9ue/jhc_copygc
src/FrontEnd/Tc/Monad.hs
gpl-2.0
18,181
1
20
4,855
6,421
3,236
3,185
-1
-1
-- -- Copyright (c) 2015 Assured Information Security, Inc. <pattersonc@ainfosec.com> -- Copyright (c) 2014 Citrix Systems, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either ver...
OpenXT/manager
upgrade-db/Migrations/M_27.hs
gpl-2.0
1,439
0
14
308
161
95
66
15
2
module HLinear.NormalForm.FoldUnfold.PLE.DivisionRing where import HLinear.Utility.Prelude import qualified Data.Vector as V import HLinear.Hook.PLEHook ( PLEHook(..) ) import HLinear.Matrix.Definition ( Matrix(..) ) import HLinear.NormalForm.FoldUnfold.Pivot ( splitOffPivotNonZero ) import HLinear.Utility.RPermute ...
martinra/hlinear
src/HLinear/NormalForm/FoldUnfold/PLE/DivisionRing.hs
gpl-3.0
1,760
0
18
420
574
318
256
37
2
{-# LANGUAGE FlexibleContexts , FlexibleInstances , UndecidableInstances #-} module HFlint.NMod.Tasty.QuickCheck where import Data.Maybe ( mapMaybe ) import Math.Structure ( Unit(..), DecidableUnit(..) ) import Test.QuickCheck.Arbitrary import Test.QuickCheck.Gen import HFlint.NMod.Algebra () import HFlint...
martinra/hflint
src/HFlint/NMod/Tasty/QuickCheck.hs
gpl-3.0
703
0
9
104
190
110
80
19
0
module TypeBug9 where infixl 6 <*> infixl 7 <$> type Parser symbol result = [symbol] -> [(result,[symbol])] (<*>) :: Parser s (a -> b) -> Parser s a -> Parser s b (<$>) :: (a -> b) -> Parser s a -> Parser s b (<*>) = undefined (<$>) = undefined many :: Parser s a -> Parser s [a] many = undefined chainr :: ...
roberth/uu-helium
test/typeerrors/Examples/TypeBug9.hs
gpl-3.0
482
0
10
134
259
143
116
14
1
{- Programa em Haskell para validar os digitos de um CPF Mais info em: http://pt.wikipedia.org/wiki/Cadastro_de_Pessoas_F%C3%ADsicas -} import Data.Char isCpfOk :: [Int] -> Bool isCpfOk cpf = let -- calcula primeiro digito digitos1 = take 9 cpf expr1 = (sum $ zipWith (*) digitos1 [10,9..2]) `mod` ...
AndreaInfUFSM/elc117-2016a
slides/validaCPF.hs
gpl-3.0
718
4
13
189
241
131
110
16
3
{-# LANGUAGE OverloadedStrings #-} {-| Module : ReferenceExtractor Description : Extract links from a, link etc. tag from HTML Copyright : (c) Frédéric BISSON, 2016 License : GPL-3 Maintainer : zigazou@free.fr Stability : experimental Portability : POSIX A link extractor -} module Data.ReferenceExtractor...
Zigazou/deadlink
src/Data/ReferenceExtractor.hs
gpl-3.0
1,239
0
8
263
299
158
141
21
1
{-# LANGUAGE NamedFieldPuns #-} {- | This module provides some basic logic to deal with rate limited IO actions that should be retried until successful. It provides an exponential backoff time, and it provides the ability to coordinate the rate limit over multiple threads of execution. -} module Control.Concurr...
SumAll/haskell-rate-limited-io
src/Control/Concurrent/RateLimitedIO.hs
apache-2.0
6,052
0
17
1,531
1,030
537
493
101
6
module FizzBuzz where divisibleBy :: Int -> Int -> Bool divisibleBy x y = x `mod` y == 0 fizz :: Int -> Bool fizz x = x `divisibleBy` 3 buzz :: Int -> Bool buzz x = x `divisibleBy` 5 fizzBuzzer :: Int -> String fizzBuzzer x = if fizz x && buzz x then "FizzBuzz" else if fizz x then "Fizz" else if buzz...
arthurms/tw-coding-dojo
src/FizzBuzz.hs
apache-2.0
357
0
8
101
143
78
65
16
4
module Staircase.A282573Spec (main, spec) where import Test.Hspec import Staircase.A282573 (a282573) main :: IO () main = hspec spec spec :: Spec spec = describe "A282573" $ it "correctly computes the first 20 elements" $ take 20 (map a282573 [1..]) `shouldBe` expectedValue where expectedValue = [1,3,4,7,...
peterokagey/haskellOEIS
test/Staircase/A282573Spec.hs
apache-2.0
369
0
10
59
160
95
65
10
1
-- Copyright 2018 Google LLC -- -- 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 -- -- https://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in w...
google/cabal2bazel
src/Google/Runtime/BuildHelper.hs
apache-2.0
4,077
0
23
871
616
346
270
51
2
{-# Language OverloadedStrings, LambdaCase, RecordWildCards #-} module Main where import Control.Concurrent import Control.Exception.Safe import Control.Monad import Control.Monad.IO.Class import Data.ByteArray (ScrubbedBytes) import Data.Time.Clock import Data.Time.Clock.POSIX import Data.UUID (UUID) import System.Co...
rblaze/private-cloud
app/Main.hs
apache-2.0
7,470
16
20
2,236
1,725
854
871
152
11
{-# OPTIONS -fno-warn-type-defaults #-} {-| Constants contains the Haskell constants The constants in this module are used in Haskell and are also converted to Python. Do not write any definitions in this file other than constants. Do not even write helper functions. The definitions in this module are automatically...
ganeti-github-testing/ganeti-test-1
src/Ganeti/Constants.hs
bsd-2-clause
137,931
0
13
27,097
23,627
13,994
9,633
-1
-1
module Move where import Control.Lens import Data.Complex import EngineState import GPS import Posture import Unit import Speed orderMove :: Int -> [GPS] -> EngineState () orderMove uid gs = do u <- getOwnUnit uid replaceOwnUnit $ u & unitWaypoints .~ gs -- & unitPosture .~ Moving -- moveUnitQuant :: U...
nbrk/ld
library/Move.hs
bsd-2-clause
899
0
9
230
115
69
46
-1
-1
-- -- Scene: test scene data -- module UnitTest.Aya.Scene where import Aya.Algebra xReso = 256 :: Int yReso = 256 :: Int xRegion = (-1.0, 1.0) yRegion = (-1.0, 1.0) eyepos = Vector3 1 1 1 etarget = Vector3 0 2 4 upper = Vector3 0 1 0 focus = 1.5
eiji-a/aya
src/UnitTest/Aya/Scene.hs
bsd-3-clause
259
0
6
64
98
58
40
10
1
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE Safe #-} {- | Module : Physics.Learn.Current Copyright : (c) Scott N. Walck 2012-2019 License : BSD3 (see LICENSE) Maintainer : Scott N. Walck <walck@lvc.edu> Stability : experimental This module contains functions for working with current, magnetic field, an...
walck/learn-physics
src/Physics/Learn/Current.hs
bsd-3-clause
4,449
0
11
1,145
609
354
255
69
1
{-# LANGUAGE TemplateHaskell #-} module Demo where import Prelude hiding (map, zipWith, zipWith3) import Data.Vector.Storable (Vector) import Nikola f :: Exp (Vector Float) -> Exp (Vector Float) f = map inc --inc :: Exp Float -> Exp Float inc = vapply $ \x -> x + 1
mainland/nikola
tests/Demo.hs
bsd-3-clause
271
0
8
52
88
51
37
8
1
{-# LANGUAGE OverloadedStrings #-} -- | Documentation page controller. module HL.Controller.Documentation where import HL.Controller import HL.View import HL.View.Documentation -- | Documentation controller. getDocumentationR :: C (Html ()) getDocumentationR = do tutorialMap <- fmap appTutorials getYesod lucid ...
haskell-lang/haskell-lang
src/HL/Controller/Documentation.hs
bsd-3-clause
349
0
9
46
71
39
32
9
1
{-# LANGUAGE ScopedTypeVariables #-} module Spec.ExecuteM64 where import Spec.Decode import Spec.Machine import Utility.Utility import Control.Monad execute :: forall p t. (RiscvMachine p t) => InstructionM64 -> p () -- begin ast execute (Mulw rd rs1 rs2) = do x <- getRegister rs1 y <- getRegister rs2 setRegiste...
mit-plv/riscv-semantics
src/Spec/ExecuteM64.hs
bsd-3-clause
1,131
0
16
317
534
247
287
38
1
{-# OPTIONS_GHC -freduction-depth=0 #-} -- | Devices management -- -- This module allows the creation of a 'DeviceManager' which: -- -- * maintains an up-to-date tree of connected devices -- * maintains device index by subsystem type -- * signals when tree changes through STM channels -- * allows query of ...
hsyl20/ViperVM
haskus-system/src/lib/Haskus/System/Devices.hs
bsd-3-clause
27,473
0
31
7,863
4,875
2,512
2,363
-1
-1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} module Distribution.Nixpkgs.Haskell.Derivation ( Derivation, pkgid, revision, src, isLibrary, isExecutable , extraFunctionArgs, libraryDepends, executableDepend...
psibi/cabal2nix
src/Distribution/Nixpkgs/Haskell/Derivation.hs
bsd-3-clause
6,880
0
18
1,597
1,499
814
685
121
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} -- | Various proxies that help handling the IRC business module Pipes.Network.IRC.Core where import Control.Monad (forever) import Data.ByteString (ByteString) import qualified Data.ByteStrin...
co-dan/pipes-irc
src/Pipes/Network/IRC/Core.hs
bsd-3-clause
1,947
0
20
616
486
259
227
44
3
{-# LANGUAGE TypeFamilies, EmptyDataDecls, TypeOperators #-} {-# LANGUAGE FlexibleInstances #-} -- | Embedding a higher-order domain-specific language (simply-typed -- lambda-calculus with constants) with a selectable evaluation order: -- Call-by-value, call-by-name, call-by-need in the same Final Tagless framework --...
suhailshergill/liboleg
Language/CB.hs
bsd-3-clause
6,365
2
18
1,785
1,733
920
813
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE ImplicitParams #-} module Tests.Travel where import Data.Metrology.Poly import Data.Metrology.SI.Poly import Data.Metrology.Imperial.Types (Imperial) import Data.Metrology.Imperial.Units import Data.Metrology.Show...
hesiod/units
Tests/Travel.hs
bsd-3-clause
2,447
0
16
382
721
384
337
48
1
import qualified Data.Vector.Generic.Extra as V import Data.Either import Data.Maybe import Data.Vector import Test.Tasty import qualified Test.Tasty.SmallCheck as SC main :: IO () main = defaultMain analogies analogousTo :: Eq b => (Vector a -> Vector b) -> ([a] -> [b]) -> [a] -> Bool analogousTo vf lf = vf `analog...
sjakobi/vector-extra
test/ListAnalogies.hs
bsd-3-clause
1,691
0
13
348
687
387
300
38
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. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. {-# LANGUAGE Over...
rfranek/duckling
Duckling/Temperature/KO/Corpus.hs
bsd-3-clause
1,039
0
9
286
162
99
63
24
1
import System.Environment (getArgs) cardval :: Char -> Int cardval '2' = 2 cardval '3' = 3 cardval '4' = 4 cardval '5' = 5 cardval '6' = 6 cardval '7' = 7 cardval '8' = 8 cardval '9' = 9 cardval '1' = 10 cardval 'J' = 11 cardval 'Q' = 12 cardval 'K' = 13 cardval 'A' = 14 cardval _ = -1 trump :: [Str...
nikai3d/ce-challenges
easy/simple_or_trump.hs
bsd-3-clause
914
0
11
416
363
180
183
31
1
{-# LANGUAGE TupleSections #-} {-# LANGUAGE ViewPatterns #-} -- | Lookup the documentation of a name in a module (and in a specific -- package in the case of ambiguity). module Haskell.Docs (module Haskell.Docs ,Identifier(..) ,PackageName(..)) where import Haskell.Docs.Cabal import Haskell.Docs.Formatting ...
chrisbarrett/haskell-docs
src/Haskell/Docs.hs
bsd-3-clause
2,896
0
19
1,023
671
357
314
69
5
{-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE MultiParamTypeClasses #-} import Text.XML.HXT.Core import Text.XML.HXT.HTTP import Data.Ratio import Control.Monad.State.Lazy import Music -- This ...
nickgeoca/music-browserside
Main.hs
bsd-3-clause
5,528
0
13
1,738
1,305
693
612
89
1
-- | This module provides the @TypeMap@ data structure, as well as several -- data structures for the type signatures of the various elements stored in a -- @TypeMap@. module Language.Java.Paragon.TypeChecker.TypeMap ( TypeMap ) where import Data.Map (Map) import qualified Data.Map as Map import Language.Jav...
bvdelft/paragon
src/Language/Java/Paragon/TypeChecker/TypeMap.hs
bsd-3-clause
4,446
0
10
1,101
581
384
197
61
0
{-# LANGUAGE OverloadedStrings, QuasiQuotes, ImplicitParams #-} module Matlab where import Data.String.Interpolation import Data.String import Data.Monoid import Data.Default import System.FilePath import System.Directory import System.Process import System.Exit import System.IO data MatlabImp = Matlab | Octave deri...
Tener/deeplearning-thesis
lib/Matlab.hs
bsd-3-clause
5,324
0
19
1,170
785
420
365
52
2
module Data.Metagraph.Internal.Types( MetaGraphId(..) , MetaGraph(..) , Directed(..) , isDirected , isUndirected , EdgeId(..) , MetaEdge(..) , NodeId(..) , MetaNode(..) ) where import Data.IntMap import GHC.Generics import Data.Bifunctor -- | Id of edge in metagraph newtype E...
Teaspot-Studio/metagraph
src/Data/Metagraph/Internal/Types.hs
bsd-3-clause
2,280
0
11
481
472
292
180
45
1
module Parser where import Control.Applicative hiding ((<|>), many) import Text.Parsec as P import Text.Parsec.Token import Text.Parsec.Language import Text.Parsec.String import Syntax tok :: TokenParser a tok = haskell ident :: Parser String ident = identifier tok sym :: String -> Parser String sym = symbol tok ...
kosmikus/type-inference-regensburg
src/Parser.hs
bsd-3-clause
1,184
0
20
248
462
241
221
34
1
{-# LANGUAGE DeriveDataTypeable #-} {- | Module : ./QBF/AS_BASIC_QBF.der.hs Description : Abstract syntax for propositional logic extended with QBFs Copyright : (c) Jonathan von Schroeder, DFKI GmbH 2010 License : GPLv2 or higher, see LICENSE.txt Maintainer : <jonathan.von_schroeder@dfki.de> Stability...
spechub/Hets
QBF/AS_BASIC_QBF.der.hs
gpl-2.0
8,517
6
22
2,411
2,478
1,354
1,124
179
16
module Util.Map (inverse, lookupMaybe, partitionEithers) where import Control.Arrow import Data.Foldable import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map -- | Given a list of key-value pairs, create a map from each value to its keys. /O(n*log(n))/ inverse :: Ord v =>...
rodrigo-machado/verigraph
src/library/Util/Map.hs
gpl-3.0
1,004
0
9
211
353
198
155
14
2
{-# LANGUAGE RecordWildCards #-} module System where import Data.Maybe import BasicFunctions import HardwareTypes import Sprockell -- =================================================================================== shMem :: (SharedMem, RequestFifo) -> IndRequests -> ((SharedMem, RequestFifo), ...
wouwouwou/2017_module_8
src/haskell/PP-project-2016/lib/sprockell/System.hs
apache-2.0
3,206
0
14
1,149
696
402
294
41
4
import Control.Monad import Data.Word import qualified Data.Vector.Unboxed as U import Test.Tasty import Test.Tasty.QuickCheck import Test.Tasty.HUnit import Test.QuickCheck.Monadic import System.Random.MWC ---------------------------------------------------------------- -- -----------------------------------------...
Shimuuar/mwc-random
tests/props.hs
bsd-2-clause
7,612
0
16
1,010
1,939
1,225
714
104
1
{-# LANGUAGE TemplateHaskell, FlexibleInstances , UndecidableInstances, DeriveDataTypeable, MultiParamTypeClasses, CPP, ScopedTypeVariables, ScopedTypeVariables #-} -- | Functions to allow you to use XSLT to transform your output. To use this, you would generally design your happstack application to ou...
arybczak/happstack-server
src/Happstack/Server/XSLT.hs
bsd-3-clause
7,418
0
20
1,802
1,976
1,008
968
-1
-1
-- | -- Module : Crypto.Random.Entropy.RDRand -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : Good -- {-# LANGUAGE ForeignFunctionInterface #-} module Crypto.Random.Entropy.RDRand ( RDRand ) where import Foreign.Ptr import Fore...
nomeata/cryptonite
Crypto/Random/Entropy/RDRand.hs
bsd-3-clause
1,080
0
8
195
228
127
101
22
2
{-# LANGUAGE RankNTypes, NamedFieldPuns, RecordWildCards, DoRec, BangPatterns, OverloadedStrings, CPP, TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Distribution.Server.Features.Users ( initUserFeature, UserFeature(..), UserResource(..), GroupResource(..), ) where imp...
haskell-infra/hackage-server
Distribution/Server/Features/Users.hs
bsd-3-clause
35,069
31
22
10,092
6,632
3,490
3,142
510
18
module InnerEar.Types.Handle where type Handle = String isValidHandle :: Handle -> Bool isValidHandle x = a && b && c where a = x /= [] -- not empty b = take 1 x /= " " -- first character is not a space c = take 1 (reverse x) /= " " -- last character is not a space
d0kt0r0/InnerEar
src/InnerEar/Types/Handle.hs
gpl-3.0
278
0
10
72
88
49
39
7
1
module Main where data Hello = HelloWorld deriving ( Show ) data World = Helloworld deriving ( Show ) main = do print HelloWorld print Helloworld
rahulmutt/ghcvm
tests/suite/similar-names/fail/FailDataConstructor2.hs
bsd-3-clause
154
0
7
34
49
26
23
6
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="si-LK"> <title>Groovy Support</title> <maps> <homeID>top</homeID> <mapref location="map...
thc202/zap-extensions
addOns/groovy/src/main/javahelp/org/zaproxy/zap/extension/groovy/resources/help_si_LK/helpset_si_LK.hs
apache-2.0
959
77
66
156
407
206
201
-1
-1
{- rrdgraph-haskell – Haskell DSL for rendering RRD graphs using RRDtool Copyright © 2011 Johan Kiviniemi <devel@johan.kiviniemi.name> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission no...
ion1/rrdgraph-haskell
Data/RRDGraph/Tests/State.hs
isc
3,405
1
12
565
778
406
372
-1
-1
module Server where import Config import Control.Lens import Control.Monad.IO.Class (liftIO) import CSRUtils import Data.Acid import Data.Acid.Advanced (query', update') import Data.Monoid (mconcat) import Data.Text...
tazjin/herbert
src/Server.hs
mit
4,895
0
18
1,207
1,299
622
677
111
3
import TestUtils import VectorsHMAC import qualified Data.ByteString as B import Crypto.Nettle.HMAC import Crypto.Nettle.Hash assertHMAC :: HashAlgorithm a => (B.ByteString, B.ByteString, String) -> Tagged a Assertion assertHMAC (key, msg, h) = do h' <- hmac key msg return $ assertEqualHex "" (hs h) $ B.take (B....
stbuehler/haskell-nettle
src/Tests/HMAC.hs
mit
946
4
11
158
326
183
143
23
1
bubbleSort :: (Ord a) => [a] -> [a] bubbleSort x = (!!length x) $ iterate bubble x where bubble (x:y:r) | x <= y = x : bubble (y:r) | otherwise = y : bubble (x:r) bubble x = x
Gathros/algorithm-archive
contents/bubble_sort/code/haskell/bubbleSort.hs
mit
209
0
11
73
125
63
62
6
2
module Memento.Logger where import Data.Text (Text, unpack) import System.Console.ANSI -------------------------------------------------------------------------------- reset :: IO () reset = setSGR [Reset] -------------------------------------------------------------------------------- colorised :: Color -> Text ->...
adinapoli/memento
src/Memento/Logger.hs
mit
935
0
9
101
198
104
94
18
1
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} -- | Definition for a default Entity to use with a SQL event store. module Eventful.Store.Sql.DefaultEntity ( SqlEvent (..) , SqlEventI...
jdreaver/eventful
eventful-sql-common/src/Eventful/Store/Sql/DefaultEntity.hs
mit
1,124
0
9
167
147
91
56
30
1
module GUBS.MaxPolynomial where import Data.List (nub) import qualified Text.PrettyPrint.ANSI.Leijen as PP import Data.Foldable (toList) import GUBS.Utils import GUBS.Algebra import qualified GUBS.Term as T import GUBS.Constraint import qualified GUBS.Polynomial as P import qualified GUB...
mzini/gubs
src/GUBS/MaxPolynomial.hs
mit
6,048
0
15
1,768
1,919
982
937
89
2
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RecordWildCards #-} module SWTOR.UIProfile.Placement ( Placement (..), Bounds (..) , place ) where import Control.Monad.Writer import Data.Foldable import Data.List import SWTOR.UIProfile.Layout data Placement = Placement{ placAlign :: Alignment ...
ion1/swtor-ui
src/SWTOR/UIProfile/Placement.hs
mit
3,322
0
19
1,033
1,170
638
532
76
9
main = putStrLn . show $ sum $ takeWhile (< 2000000) primes primes = sieve [2..] where sieve (p:xs) = p : sieve [x | x <- xs, mod x p > 0]
benji6/project-euler-solutions
haskell/10.hs
mit
141
0
12
35
86
44
42
3
1
module Graphics.Ninja.GL.Extensions ( openGLExtensions , requireExtensions ) where import Control.Exception import Control.Monad import Data.List ((\\)) import Foreign.C.String import Foreign.Ptr import Graphics.GL.Core33 import Graphics.Ninja.GL.Excep...
fatho/ninja
src/Graphics/Ninja/GL/Extensions.hs
mit
952
0
12
201
213
116
97
-1
-1
module Morph ( toSnake, toSnakeCaps, toDashed, toHuman, toTitle, toCamel, toUpperCamel ) where import qualified Data.Char as C import qualified Re as Re toSnake :: String -> String toSnake s = do let s1 = Re.replace "([A-Z\\d])([A-Z][a-z\\d])" s "\\1_\\2" let s2 = Re.replace "([a-z...
SKAhack/hs-morph
src/Morph.hs
mit
1,387
6
19
326
493
243
250
40
1
import Database.Kayvee.Kayvee import Database.Kayvee.GC main :: IO () main = do connect put "this is the key to the first element" "this is the contents of the first insertion" put "apple" "banana" put "apple" "fruit" x <- get "this is the key to the first element" y <- get "apple" print x ...
deweyvm/kayvee
src/Main.hs
mit
357
0
8
97
93
40
53
14
1
{-| Module : Language.GoLite.Parser Description : High level parsers and re-exports Copyright : (c) Jacob Errington and Frederic Lafrance, 2016 License : MIT Maintainer : goto@mail.jerrington.me Stability : experimental This module contains the top-most parser 'package' as well as parsers that combine bo...
djeik/goto
libgoto/Language/GoLite/Parser.hs
mit
2,281
0
13
406
406
224
182
30
1
module Web.Markury.Model.Input where import Data.Text ( Text ) data BookmarkInput = BookmarkInput { bookmarkInputTitle :: Text , bookmarkInputDescription :: Text , bookmarkInputUrl :: Text , bookmarkInputTags :: Text } data UserInput = UserInput { userInputEmail :: Text , userInputPasswor...
y-taka-23/markury
src/Web/Markury/Model/Input.hs
mit
495
0
8
121
108
68
40
15
0