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 Stack where import Control.Monad.State type Stack = [Int] pop :: State Stack Int pop = state $ \(x:xs) -> (x, xs) push :: Int -> State Stack () push a = state $ \xs -> ((), a:xs) stackManip :: State Stack Int stackManip = do push 3 _ <- pop pop stackStuff :: State Stack () stackStuff = do a <- pop ...
alexliew/learn_you_a_haskell
code/stack.hs
unlicense
775
0
10
222
387
199
188
41
2
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DerivingVia #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE Strict #-} {-# LANGUAGE StrictData #-} {-# LANG...
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/monads/2020-06-hc-reader-and-monad-write-state-io/src/Control/Monad/RWSIO/Strict.hs
unlicense
3,410
0
13
1,029
1,393
745
648
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {- Copyright 2016 The CodeWorld Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may no...
nomeata/codeworld
codeworld-base/src/Internal/Num.hs
apache-2.0
12,691
2
12
2,864
2,679
1,468
1,211
-1
-1
----------------------------------------------------------------------------- -- Copyright 2012 Microsoft Corporation. -- -- This is free software; you can redistribute it and/or modify it under the -- terms of the Apache License, Version 2.0. A copy of the License can be -- found in the file "license.txt" at the root ...
lpeterse/koka
src/Compiler/Options.hs
apache-2.0
19,294
1
21
6,090
5,084
2,753
2,331
376
7
{-# LANGUAGE RecordWildCards #-} module Concurrent.Internal.Backoff where import Control.Concurrent data Backoff = Backoff { current , cap , totalWait :: {-# UNPACK #-} !Int } defaultBackoff :: Backoff defaultBackoff = Backoff 0 10000 0 -- 10ms backoff :: Backoff -> IO Backoff backoff b@Backoff{..} | cur...
ekmett/concurrent
src/Concurrent/Internal/Backoff.hs
bsd-2-clause
508
0
13
115
163
87
76
17
1
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.SGIS.PointParameters -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portabl...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/SGIS/PointParameters.hs
bsd-3-clause
877
0
4
100
61
48
13
9
0
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeSynonymInstances #-} module Jat.PState.MemoryModel.PairSharing ( PairSharing ) where import qualified Control.Applicative as A import Jat.Constraints (PATerm) import Jat.JatM import qualified Jat.PairSet as PS import Jat.PState.AbstrValue import Jat.PStat...
ComputationWithBoundedResources/jat
src/Jat/PState/MemoryModel/PairSharing.hs
bsd-3-clause
18,835
0
22
4,791
7,321
3,718
3,603
343
14
module Hsync where import Hsync.LCS import Codec.Utils import Data.Digest.MD5 import System.FilePath.Posix import qualified Data.ByteString.Lazy.Char8 as BL import Data.ByteString.Internal (c2w,w2c) import System.IO bs :: Integer bs = 1024*4 -- 4 kB -- | return the raw data from a handle @hdl@ from @Offset@ to @Offs...
mee/hsync
Hsync.hs
bsd-3-clause
4,446
0
16
1,365
1,504
802
702
81
9
module Vehicles where import Data.Int data Price = Price Integer deriving (Eq, Show) data Manufacturer = Mini | Mazda | Tata deriving (Eq, Show) data Airline = PapuAir | CatapultsR'Us | TakeYourChancesUnited deriving (Eq, S...
dsaenztagarro/haskellbook
src/chapter11/Vehicles.hs
bsd-3-clause
826
0
10
251
288
157
131
27
1
{-| Description: High-level SDL state. Provides SDL state which can be advanced given recent queue of events. -} module Graphics.UI.SDL.State ( module Types , module Lens , module Advance ) where import Graphics.UI.SDL.State.Types as Types import Graphics.UI.SDL.State.Lens as Lens import G...
abbradar/MySDL
src/Graphics/UI/SDL/State.hs
bsd-3-clause
360
0
4
73
53
41
12
7
0
-------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.SGIS.TextureEdgeClamp -- Copyright : (c) Sven Panne 2015 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability : portab...
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/SGIS/TextureEdgeClamp.hs
bsd-3-clause
672
0
4
78
37
31
6
3
0
{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} -- | Text frontend based on Gtk. module Game.LambdaHack.Client.UI.Frontend.Gtk ( -- * Session data type for the frontend FrontendSession(sescMVar) -- * The output and input operations , fdisplay, fpromptGetKey, fsyncFrames -- * Frontend a...
Concomitant/LambdaHack
Game/LambdaHack/Client/UI/Frontend/Gtk.hs
bsd-3-clause
21,242
0
26
5,746
4,737
2,394
2,343
-1
-1
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE OverloadedStrings #-} module Duckling.Ordinal.RO.Corpus ( corpus ) where import Prelude import D...
facebookincubator/duckling
Duckling/Ordinal/RO/Corpus.hs
bsd-3-clause
1,626
0
9
676
268
162
106
48
1
{-# LANGUAGE UnicodeSyntax #-} module Shake.It.Global ( phonyArgs , phonyActions , objects , objectsList ) where import System.IO.Unsafe import Data.IORef phonyArgs ∷ IORef [String] {-# NOINLINE phonyArgs #-} phonyArgs = unsafePerformIO (newIORef []) phonyActions ∷ IORef [(String, IO ...
Heather/Shake.it.off
src/Shake/It/Global.hs
bsd-3-clause
619
0
9
114
170
96
74
20
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/PT/Corpus.hs
bsd-3-clause
1,376
0
11
450
207
126
81
33
1
import qualified Data.Map as Map import Data.Char import System.Environment import System.Directory import System.FilePath import Data.List import Text.Show.Pretty main = listAll getPings = do xs <- getDirectoryContents "." return (filter ((== ".png") . takeExtension) xs) listAll = do xs <- getPings pu...
GaloisInc/verification-game
web-prover/web_src/img/creatures/fixCreatures.hs
bsd-3-clause
754
0
12
211
338
173
165
25
4
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE Unsafe #-} -- | It provides functions which map read and write effects into security checks. module MAC.Effects ( create , writeup , readdown , fix , read_and_fix , write_and_fix , rw_read , rw_write ) where import MA...
alejandrorusso/mac-privacy
MAC/Effects.hs
bsd-3-clause
2,060
0
11
525
659
328
331
30
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PackageImports #-} {-# LANGUAGE UnicodeSyntax #-} {-| [@ISO639-1@] ht [@ISO639-2@] hat [@ISO639-3@] hat [@Native name@] - [@English name@] Haitian Creole -} module Text.Numeral.Language.HAT.TestDat...
telser/numerals
src-test/Text/Numeral/Language/HAT/TestData.hs
bsd-3-clause
6,214
0
8
1,905
1,723
1,151
572
193
1
{-# LANGUAGE LambdaCase #-} module Main where import Control.Monad import System.Environment (getArgs) import System.IO (BufferMode (NoBuffering), hSetBuffering, stdin, stdout) import Text.Show.Prettyprint import ...
iostat/imperator
app/Main.hs
bsd-3-clause
1,144
0
17
332
257
124
133
27
3
{-# LANGUAGE FlexibleContexts #-} module Insomnia.ToF.Type where import Control.Lens import Control.Monad.Reader import Data.Monoid import qualified Data.Map as M import qualified Unbound.Generics.LocallyNameless as U import Insomnia.Identifier import Insomnia.Types import Insomnia.TypeDefn import qualified FOmega....
lambdageek/insomnia
src/Insomnia/ToF/Type.hs
bsd-3-clause
4,509
0
22
1,170
1,757
872
885
120
10
module HighOrderFunc where flip :: (a -> b -> c) -> b -> a -> c flip f x y = f y x flip' f = \x y -> f y x returnLast :: a -> b -> c -> d -> d returnLast _ _ _ d = d -- won't work returnLast' :: (((a -> b) -> c) -> d) -> d returnLast' _ _ _ d = d -- this works returnLast'' :: a -> (b -> (c -> (d -> d))) returnLast'...
chengzh2008/hpffp
src/ch07-FunctionPattern/highOrderFun.hs
bsd-3-clause
334
0
11
97
194
104
90
10
1
{-# LANGUAGE ScopedTypeVariables #-} module OpenSSL.X509.SystemStore.Unix ( contextLoadSystemCerts ) where import OpenSSL.Session (SSLContext, contextSetCADirectory, contextSetCAFile) import qualified System.Posix.Files as U import Control.Exception (try, IOException) import System.IO.Unsafe (unsafePerformIO)...
redneb/HsOpenSSL-x509-system
OpenSSL/X509/SystemStore/Unix.hs
bsd-3-clause
1,882
0
16
428
355
202
153
30
4
{- DO NOT EDIT THIS FILE THIS FILE IS AUTOMAGICALLY GENERATED AND YOUR CHANGES WILL BE EATEN BY THE GENERATOR OVERLORD All changes should go into the Model file (e.g. App/Models/ExampleModel.hs) -} module App.Models.Bases.PageFunctions where import App.Models.Bases.Common import qualified Database.HDBC as HDBC...
alsonkemp/turbinado-website
App/Models/Bases/PageFunctions.hs
bsd-3-clause
6,754
0
26
2,077
2,155
1,108
1,047
-1
-1
module Chapter2.ExercisesSpec where import Test.Hspec x = y ^ 2 waxOn = x * 5 y = z + 8 z = 7 triple x = x * 3 waxOff x = triple x squareAndPi :: Integer -> Double squareAndPi value = undefined spec :: Spec spec = describe "Exercises Chapter 2" $ do it "should compile" $ "" `shouldBe` "" -- des...
yannick-cw/haskell_katas
test/Chapter2/ExercisesSpec.hs
bsd-3-clause
1,830
0
10
468
134
80
54
14
1
{-# LANGUAGE UnicodeSyntax #-} module Shake.It.Rust.Cargo ( cargo ) where import Control.Monad import Shake.It.Core cargo ∷ [String] → IO () cargo α = rawSystem "cargo" α >>= checkExitCode
Heather/Shake.it.off
src/Shake/It/Rust/Cargo.hs
bsd-3-clause
222
0
7
55
59
34
25
7
1
{-# LANGUAGE FlexibleContexts, FlexibleInstances #-} {- | Module : ./Haskell/HatAna.hs Description : calling programatica's analysis Copyright : (c) Christian Maeder, Uni Bremen 2002-2006 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portab...
spechub/Hets
Haskell/HatAna.hs
gpl-2.0
8,859
0
22
2,681
3,321
1,735
1,586
199
7
{- - Copyright 2011 Per Magnus Therning - - 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 ag...
magthe/cblrepo
src/BuildPkgs.hs
apache-2.0
877
0
12
176
97
50
47
9
1
{-# LANGUAGE FlexibleContexts, MultiParamTypeClasses, FunctionalDependencies #-} module CSPM.TypeChecker.Common where import CSPM.Syntax.Literals import CSPM.Syntax.Types import CSPM.TypeChecker.Monad import CSPM.TypeChecker.Unification -- a -> b <=> We can't have two instances that match on a but differ on b class T...
sashabu/libcspm
src/CSPM/TypeChecker/Common.hs
bsd-3-clause
2,882
0
12
561
875
422
453
64
1
import System.Plugins import API -- -- what happens if we try to use code that has been unloaded? -- main = do m_v <- load "../Null.o" ["../api"] [] "resource" (m,v) <- case m_v of LoadSuccess m v -> return (m,v) _ -> error "load failed" putStrLn ( show (a v) ) unload...
abuiles/turbinado-blog
tmp/dependencies/hs-plugins-1.3.1/testsuite/unload/sjwtrap/prog/Main.hs
bsd-3-clause
323
0
12
105
108
54
54
9
2
module Ch08par where -- todays goal is get through vid of 8
HaskellForCats/HaskellForCats
MenaBeginning/Ch001/2014-0224gargbColl.hs
mit
63
0
2
15
5
4
1
1
0
{-# LANGUAGE RecursiveDo #-} module Ho.Build ( module Ho.Type, dumpHoFile, parseFiles, preprocess, preprocessHs, buildLibrary ) where import Util.Std import Control.Concurrent import Data.IORef import Data.Tree import Data.Version(Version,parseVersion,showVersion) import System.FilePath as ...
hvr/jhc
src/Ho/Build.hs
mit
42,275
0
45
13,245
13,914
6,994
6,920
-1
-1
module TestData where import Data.IntMap as IMap import Data.Set as Set data Codegen = C | JS deriving (Show, Eq, Ord) type Index = Int data CompatCodegen = ANY | C_CG | NODE_CG | NONE -- A TestFamily groups tests that share the same theme data TestFamily = TestFamily { -- A shorter lowcase name to use in filename...
kojiromike/Idris-dev
test/TestData.hs
bsd-3-clause
8,810
0
13
3,933
3,196
2,089
1,107
325
4
{-# OPTIONS -fglasgow-exts #-} -- This one killed GHC 5.05 and earlier -- The problem was in a newtype with a record selector, with -- a polymorphic argument type. MkId generated a bogus selector -- function module ShouldCompile where type M3 a = forall r. (forall b. M3' b -> (b -> M3' a) -> r) -> r newtype M3' a ...
hvr/jhc
regress/tests/1_typecheck/2_pass/ghc/tc163.hs
mit
1,198
0
21
334
320
177
143
-1
-1
{-# LANGUAGE PatternSynonyms, ViewPatterns #-} module Foo (Foo(P)) where data Foo a = Foo a instance C Foo where build a = Foo a destruct (Foo a) = a class C f where build :: a -> f a destruct :: f a -> a pattern P :: C f => a -> f a pattern P x <- (destruct -> x) where P x = build x
ezyang/ghc
testsuite/tests/patsyn/should_compile/poly-export.hs
bsd-3-clause
307
0
8
90
141
73
68
16
0
{-# LANGUAGE TypeFamilies #-} module ShouldFail where class C1 a where data S1 a :: * -- must fail: wrong category of type instance instance C1 Int where type S1 Int = Bool
siddhanathan/ghc
testsuite/tests/indexed-types/should_fail/SimpleFail3a.hs
bsd-3-clause
180
0
6
40
39
23
16
6
0
{-# LANGUAGE ExistentialQuantification #-} -- Illegal existential context on a newtype module ShouldFail where newtype Foo = forall a . Foo a
ryantm/ghc
testsuite/tests/typecheck/should_fail/tcfail156.hs
bsd-3-clause
146
1
5
26
16
11
5
3
0
import qualified Attribute as A attributeTypeOrdinal :: A.ComponentType -> Integer attributeTypeOrdinal A.IntegerSigned = 0 attributeTypeOrdinal A.IntegerUnsigned = 1 attributeTypeOrdinal A.FloatingPoint = 2
io7m/smf
com.io7m.smfj.specification/src/main/resources/com/io7m/smfj/specification/attribute_map.hs
isc
212
0
6
26
48
26
22
5
1
module Day5Spec (spec) where import Day5 import Test.Hspec main :: IO () main = hspec spec spec :: Spec spec = do describe "day5" $ do it "ugknbfddgicrmopn is nice because it has at least three vowels (u...i...o...), a double letter (...dd...), and none of the disallowed substrings." $ do day...
brianshourd/adventOfCode2015
test/Day5Spec.hs
mit
2,074
0
17
527
346
168
178
31
1
-- Problem 17 -- -- If the numbers 1 to 5 are written out in words: one, two, three, four, -- five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. -- -- If all the numbers from 1 to 1000 (one thousand) inclusive were written -- out in words, how many letters would be used? euler17 = length1To1000 len...
RossMeikleham/Project-Euler-Haskell
17.hs
mit
1,261
0
14
279
335
164
171
23
1
-- Part B also -- Does part A in 11s, part B in ~20m -- import Control.Monad import Data.List.Extra import Data.Maybe import qualified Data.Char as C import qualified Data.Map as Map -- --import qualified Data.Sequence as S --import Data.Sequence ((<|), (|>), (><), ViewL(..)) import Debug.Trace -------- {- type Qu...
msullivan/advent-of-code
2016/A11a.hs
mit
2,850
0
18
743
1,022
558
464
66
2
module Main ( main ) where import Diagrams.Prelude import Render diagram = circle 1 main = defaultMain diagram
leksah/leksah-diagrams-hello
src/Main.hs
mit
118
0
5
25
33
19
14
6
1
{-# LANGUAGE RankNTypes, OverloadedStrings, FlexibleContexts #-} module FTag.AtomicSets.Operations where import Data.Maybe import Control.Exception (throw) import Env import FTag.Data import FTag.DB import FTag.AtomicSets.SpecialTags atomicToStor :: UserAtomicSet -> FTag StorAtomicSet atomicToStor = runInDB . c wh...
chrys-h/ftag
src/FTag/AtomicSets/Operations.hs
mit
966
0
21
326
263
132
131
25
7
module PNM where import qualified Data.ByteString.Lazy.Char8 as L8 import qualified Data.ByteString.Lazy as L import Data.Char (isSpace) data GreyMap = GreyMap {greyWidth, greyHeight, greyMax :: Int, greyData :: L.ByteString} deriving (Eq) instance Show GreyMap where show (GreyMap w h m _) = "GreyMap...
cirquit/Personal-Repository
Haskell/RWH/PGMParser/PNM.hs
mit
2,967
0
26
1,071
983
512
471
65
7
import qualified Data.Map as M import qualified Data.ByteString.Lazy as L import Network.HTTP.Conduit import Control.Monad.IO.Class type Query = M.Map String [String] main = search "http://localhost:9200/" M.empty >>= L.putStr search :: MonadIO m => String -> Query -> m L.ByteString search uri query = simpleHttp uri...
fabianvf/hselasticsearch
client.hs
mit
321
0
9
47
103
58
45
8
1
module DestinationType where import System.IO.Unsafe import Data.Unique import Data.List import qualified Data.Map as HM import TypeSystem destinationType :: Package -> Term -> Term destinationType pkg (Var variable) = case flowTermByVar (pkg_getRule pkg) (Var variable) of No...
mcimini/GradualizerDynamicSemantics
DestinationType.hs
mit
1,935
0
12
483
485
251
234
24
3
{-# LANGUAGE OverloadedStrings #-} module Data.Text.Extended ( module Data.Text , constTimeCompare ) where import Data.Bits import Data.Char import Data.Function (on) import qualified Data.List as L import Data.Text import Prelude hid...
juretta/haskell-jwt
src/Data/Text/Extended.hs
mit
518
0
13
163
156
87
69
13
1
-------------------------------------------------------------------------------- -- | -- Module : AI.Clustering.Hierarchical.Internal -- Copyright : (c) 2015 Kai Zhang -- License : MIT -- -- Maintainer : kai@kzhang.org -- Stability : experimental -- Portability : portable -- ------------------------...
kaizhang/clustering
src/AI/Clustering/Hierarchical/Internal.hs
mit
5,558
0
22
1,570
1,888
958
930
101
3
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-} module Yi.Prelude ( (<>), (++), -- consider scrapping this and replacing it by the above (=<<), Double, Char, Either(..), Endom, Eq(..), Fractional(..), Functor(..), IO, Integer, Integral(..), Bounded(..), Enum(..), Maybe(..), Monad(..), Num(..), Ord(...
codemac/yi-editor
src/Yi/Prelude.hs
gpl-2.0
5,393
0
12
1,112
1,984
1,147
837
158
3
module Desugar ( desugar )where import Syntax desugar :: [Toplevel] -> [CoreToplevel] desugar = map desugarTop desugarTop :: Toplevel -> CoreToplevel desugarTop (TopVarDef n t e) = CTopVarDef n t (desugarExpr e ) desugarTop (TopFunDef n as t e) = CTopVarDef n t' e' where aNames = map fst as ...
dosenfrucht/beagle
src/Desugar.hs
gpl-2.0
1,630
0
14
607
597
295
302
42
14
module Sivi.Operation.FromGCodeSpec ( spec ) where import Test.Hspec import Linear import Sivi import Sivi.IR spec :: SpecWith () spec = describe "fromGCode" $ it "transforms a simple program into an operation" $ do let program = GCode [ g00 {x = Just 10, y = ...
iemxblog/sivi-haskell
tests/Sivi/Operation/FromGCodeSpec.hs
gpl-2.0
1,963
0
19
1,031
739
399
340
38
1
-- Difference between (sum x)^2 and sum(x^2) x from N sumOfSquares = sum $ map (^2) [1..100] squaredSum = (^2) $ sum [1..100] main = do return $ squaredSum - sumOfSquares
NaevaTheCat/Project-Euler-Haskell
P6.hs
gpl-2.0
174
0
8
34
62
34
28
4
1
{- A Module to implement Vertical Rhythm in Css generated using clay -} {-# LANGUAGE OverloadedStrings #-} module VerticalRhythmFunctions where import Clay import Control.Monad.State import Data.Default import Data.Maybe -- | Type CSSState stores base_font_size, base_line_height, browser_default_font_size data V...
pgarg22/Pottery
VerticalRhythmFunctions.hs
gpl-2.0
15,759
35
17
3,936
2,422
1,203
1,219
134
4
{-# LANGUAGE BangPatterns, DeriveDataTypeable, DeriveGeneric, FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-} {-# OPTIONS_GHC -w #-} module GTFS.Realtime.Internal.Com.Google.Transit.Realtime.VehiclePosition.CongestionLevel (CongestionLevel(..)) where import Prelude ((+), (/), (.)) import qualified Prel...
romanofski/gtfsschedule
src/GTFS/Realtime/Internal/Com/Google/Transit/Realtime/VehiclePosition/CongestionLevel.hs
gpl-3.0
3,916
0
11
649
845
471
374
80
1
module Hadolint.Rule.DL3029 (rule) where import Hadolint.Rule import Language.Docker.Syntax rule :: Rule args rule = simpleRule code severity message check where code = "DL3029" severity = DLWarningC message = "Do not use --platform flag with FROM" check (From BaseImage {platform = Just p}) = p == ...
lukasmartinelli/hadolint
src/Hadolint/Rule/DL3029.hs
gpl-3.0
366
0
13
79
101
56
45
10
2
{-# LANGUAGE NamedFieldPuns, ViewPatterns, MultiWayIf #-} module Schafkopf.AI (GameState(..), trumps, trickRule, play, overbid) where import Utility import Utility.Cond import Cards import Trick.Rules import S...
Bolpat/CardGames
src/Schafkopf/AI.hs
gpl-3.0
4,973
0
22
1,839
1,167
647
520
101
3
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Main where -- base, mtl, array, containers, random, monad-loops, ncurses, astar, hfov import Control.Monad.State import Data.Array.IArray import Data.Array.IO import Data.List (sortBy, find) import Data.Ord (comparing) import Data.Char import qualified Data.Set as Set...
dvolk/hoodie
Main.hs
gpl-3.0
48,872
0
24
15,030
15,551
8,167
7,384
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-games/gen/Network/Google/Resource/Games/TurnBasedMatches/Leave.hs
mpl-2.0
3,444
0
14
778
391
235
156
62
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-spanner/gen/Network/Google/Resource/Spanner/Projects/Instances/Operations/List.hs
mpl-2.0
7,387
0
18
1,608
976
571
405
138
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-androidmanagement/gen/Network/Google/Resource/AndroidManagement/Enterprises/Devices/Get.hs
mpl-2.0
4,597
0
15
1,022
696
407
289
100
1
data MyRecord = MyRecord { a :: Int -- comment , b :: Int }
lspitzner/brittany
data/Test63.hs
agpl-3.0
70
0
8
25
23
14
9
3
0
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} -------------------------------------------------------------------------------- -- See end of this file for licence information. -------------------------------------------------------------------------------- -- | -- Module : N3FormatterTest -- Copyrig...
DougBurke/swish
tests/N3FormatterTest.hs
lgpl-2.1
45,943
0
13
12,370
9,087
5,088
3,999
936
3
-- | -- Module : Examples.swmmout2csv -- Copyright : (C) 2014 Siddhanathan Shanmugam -- License : LGPL (see LICENSE) -- Maintainer : siddhanathan@gmail.com -- Portability : very -- -- Example of a program using SWMMoutGetMB for parsing SWMM .OUT files -- Inspired by OOW/swmmout2csv originally written by @mplourde -- {...
Acidburn0zzz/SWMMoutGetMB
examples/swmmout2csv.hs
lgpl-3.0
10,932
0
21
4,050
2,699
1,386
1,313
199
3
{-# language ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} module LevelServer.Client where import Control.Exception import Control.Monad.Trans.Error import Data.Aeson import qualified Data.ByteString.Lazy as BSL import Network.Client import ...
nikki-and-the-robots/nikki
src/LevelServer/Client.hs
lgpl-3.0
4,318
0
17
1,158
1,082
532
550
88
4
---- -- Copyright (c) 2013 Andrea Bernardini. -- -- 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 a...
andrebask/newsprint
src/UserInterface/NewsPrint/Foundation.hs
apache-2.0
7,170
0
15
1,518
674
401
273
-1
-1
{- Copyright 2015 David Farrell <shokku.ra@gmail.com> - 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...
shockkolate/arata
plugins/NickServ/Del.hs
apache-2.0
976
0
9
166
116
65
51
8
1
-- | -- -- Functions in this module return well-formed 'Encoding''. -- Polymorphic variants, which return @'Encoding' a@, return a textual JSON -- value, so it can be used as both @'Encoding'' 'Text'@ and @'Encoding' = 'Encoding'' 'Value'@. module Data.Aeson.Encoding ( -- * Encoding Encoding , Encodin...
sol/aeson
Data/Aeson/Encoding.hs
bsd-3-clause
1,191
0
4
330
196
135
61
36
0
{-# LANGUAGE DeriveDataTypeable, FlexibleContexts, Rank2Types #-} ----------------------------------------------------------------------------- -- | -- Module : Numeric.LinearAlgebra.Packed.Base -- Copyright : Copyright (c) 2010, Patrick Perry <patperry@gmail.com> -- License : BSD3 -- Maintainer : Patrick Perry...
patperry/hs-linear-algebra
lib/Numeric/LinearAlgebra/Packed/Base.hs
bsd-3-clause
12,703
0
14
4,138
3,038
1,537
1,501
254
1
-- | -- Module : Crypto.Hash.SHA3 -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : unknown -- -- Module containing the binding functions to work with the -- SHA3 cryptographic hash. -- {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUA...
tekul/cryptonite
Crypto/Hash/SHA3.hs
bsd-3-clause
3,227
0
11
850
668
362
306
65
0
module Main ( main ) where import Control.Monad import Control.Monad.IO.Class import Control.Concurrent (threadDelay) import Control.Exception (SomeException) import Data.Aeson import qualified Data.ByteString.Char8 as C8 import qualified Data.ByteString.Lazy as B (toStrict) import qualified Data.Text as T imp...
f-me/carma-test
tools/carma-test-run.hs
bsd-3-clause
1,538
0
19
434
494
259
235
36
2
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Coerce where import Data.Coerce newtype V = V Int deriving (Show, Read, Eq, Ord, Num) test :: [[Int]] test = coerce [[V 1, V 2], [V 3, V 4, V 5]]
notae/haskell-exercise
data/Coerce.hs
bsd-3-clause
201
0
8
40
96
54
42
6
1
maxFactor x = helper x 2 where divide x p = until (\x -> x `mod` p /= 0) (`div` p) x helper x p | x < p * p = x | x `mod` p == 0 = max p $ helper (divide x p) (p + 1) | otherwise = helper x (p + 1) main = print $ maxFactor 600851475143
foreverbell/project-euler-solutions
src/3.hs
bsd-3-clause
285
0
11
113
160
81
79
6
1
{-# LANGUAGE FlexibleContexts, FlexibleInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, StandaloneDeriving, UndecidableInstances #-} module Network.IRC.Bot.BotMonad ( BotPartT(..) , BotMonad(..) , BotEnv(..) , runBotPartT , mapBotPartT , maybeZero ) where import Control.Applica...
hrushikesh/ircbot
Network/IRC/Bot/BotMonad.hs
bsd-3-clause
2,864
0
15
600
987
546
441
62
1
{-# OPTIONS_GHC -fno-warn-orphans #-} module Data.ByteString.Num ( numCompare ) where import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as LBS import Data.Bits import Data.Binary ( encode ) import Data.List ( foldl', mapAccumL ) import Data.Word -- Little Endian ByteStrings instance Num BS....
travitch/ddmin
src/Data/ByteString/Num.hs
bsd-3-clause
5,401
0
17
1,520
2,383
1,244
1,139
124
3
module Frenetic.TopoGen ( linear , linearHosts , kComplete , kCompleteHosts , waxman , smallworld , fattree ) where import Frenetic.Topo import qualified Data.List as List import qualified Data.Maybe as Maybe import qualified Data.Set as Set import System.Random import Frenetic.NetCore.Types hiding (Sw...
frenetic-lang/netcore-1.0
src/Frenetic/TopoGen.hs
bsd-3-clause
6,101
0
19
1,778
2,139
1,180
959
117
2
{-# LANGUAGE OverloadedStrings, RecordWildCards, ScopedTypeVariables #-} module Main where import Web.ClientSession import qualified Data.ByteString.Char8 as B8 main = do key <- getDefaultKey s <- B8.getContents let r = decrypt key s print r
spacewaffle/ether
exp/session/Main2.hs
bsd-3-clause
257
0
10
48
60
32
28
9
1
{-# LANGUAGE ExtendedDefaultRules #-} {-# LANGUAGE OverloadedStrings #-} module Controllers.Tag ( routes , saveTags , filterExistsTags ) where import Application import qualified Data.ByteString as BS import Data.List (deleteFirstsBy, nub) import qualifie...
HaskellCNOrg/snap-web
src/Controllers/Tag.hs
bsd-3-clause
2,025
0
13
470
409
228
181
40
2
module Main where import qualified Insomnia.Main as M main :: IO () main = M.compilerMain
lambdageek/insomnia
main-compile/Main.hs
bsd-3-clause
92
0
6
17
29
18
11
4
1
module Main where -- This program can act as a FastCGI executable when the -- program name is simple.fcgi. import System.Environment import System.Exit (exitFailure) import Text.PrettyPrint.HughesPJClass import Test.HUnit import Language.Mojito.Syntax.SExpr import Language.Mojito.Syntax.ExprBuilder import qualified ...
noteed/mojito
mojito.hs
bsd-3-clause
2,851
0
21
833
728
376
352
70
9
{-# LANGUAGE BangPatterns, CPP, MagicHash, NondecreasingIndentation #-} ------------------------------------------------------------------------------- -- -- | Main API for compiling plain Haskell source code. -- -- This module implements compilation of a Haskell source. It is -- /not/ concerned with preprocessing of ...
jstolarek/ghc
compiler/main/HscMain.hs
bsd-3-clause
69,057
0
27
20,555
11,569
5,908
5,661
826
9
{-# LANGUAGE CPP #-} module Database.HDBC.Locale ( defaultTimeLocale, iso8601DateFormat, oldIso8601DateFormat ) where #ifdef MIN_TIME_15 import Data.Time.Format (defaultTimeLocale) #else import System.Locale (defaultTimeLocale) #endif -- | As the semantic of System.Locale.iso8601DateFormat has...
hdbc/hdbc
Database/HDBC/Locale.hs
bsd-3-clause
1,101
0
9
243
134
76
58
17
2
module Window (withWindow) where import System.Exit import qualified Graphics.UI.GLFW as G withWindow :: Int -> Int -> String -> (G.Window -> IO ()) -> IO () withWindow width height title f = do G.setErrorCallback $ Just simpleErrorCallback successfulInit <- G.init bool successfulInit exitFailure $ do ...
sgillis/HOpenGL
src/Window.hs
gpl-2.0
793
0
16
236
240
118
122
21
2
{-# LANGUAGE DeriveDataTypeable #-} {- | Module : ./Common/Prec.hs Description : precedence checking Copyright : Christian Maeder and Uni Bremen 2006 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : experimental Portability : portable Precedence checkin...
spechub/Hets
Common/Prec.hs
gpl-2.0
4,558
0
18
1,259
1,414
741
673
100
10
a@(b, c) = (2, 3) main = (a, b, c)
roberth/uu-helium
test/parser/AsPatternBinding2.hs
gpl-3.0
38
0
6
13
36
22
14
2
1
module Main (main) where import Control.Concurrent.Async import System.Environment import PHash main :: IO () main = do (path:_) <- getArgs -- mapM imageHash (replicate 10 path) mapConcurrently imageHash (replicate 50 path) return () -- (path1:path2:_) <- getArgs -- (Just ph1) <- imageHash path1 -- (Jus...
MichaelXavier/phash
Main.hs
gpl-3.0
567
0
9
85
82
46
36
9
1
module Tools ( separator ) where separator :: String -> String separator msg = let width = 80 pre = "-- " post = replicate (width - length pre - length msg - 1) '-' in pre ++ msg ++ " " ++ post
FractalBobz/game
Tools.hs
gpl-3.0
229
0
14
79
85
44
41
8
1
-------------------------------------------------------------------------------- {-| Module : Events Copyright : (c) Daan Leijen 2003 (c) Shelarcy (shelarcy@gmail.com) 2006 License : wxWindows Maintainer : wxhaskell-devel@lists.sourceforge.net Stability : provisional Portability : p...
jacekszymanski/wxHaskell
wx/src/Graphics/UI/WX/Events.hs
lgpl-2.1
13,240
0
13
3,138
2,543
1,341
1,202
188
2
{-# LANGUAGE TupleSections #-} {-| Implementation of the Ganeti confd server functionality. -} {- Copyright (C) 2011, 2012, 2013 Google Inc. 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. Redist...
mbakke/ganeti
src/Ganeti/Confd/Server.hs
bsd-2-clause
14,984
0
19
3,625
3,641
1,854
1,787
258
18
module Idris.REPL.Commands where import Idris.AbsSyntaxTree import Idris.Colours import Idris.Core.TT -- | REPL commands data Command = Quit | Help | Eval PTerm | NewDefn [PDecl] -- ^ Each 'PDecl' should be either a type declaration (at most one) or a clause defining the same na...
bravit/Idris-dev
src/Idris/REPL/Commands.hs
bsd-3-clause
2,628
0
8
1,257
438
264
174
73
0
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE OverloadedStrings #-} import Foreign.C.Types import qualified Language.C.Inline as C import qualified Language.C.Inline.Unsafe as CU C.include "<math.h>" C.include "<stdio.h>" test_cexp :: CD...
fpco/inline-c
sample-cabal-project/src/Main.hs
mit
738
0
8
129
173
97
76
22
1
{- Copyright 2017 The CodeWorld Authors. All rights reserved. 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 applicab...
nomeata/codeworld
codeworld-prediction/tests/prediction.hs
apache-2.0
4,434
0
14
1,099
1,377
720
657
93
4
-- data FooType = Baz data TestType a = Foo a | Bar a FooType Bool -- foo :: TestType a -- foo = undefined bar (Foo x) | x == 1 = Foo 1
themattchan/tandoori
input/input-3.hs
bsd-3-clause
155
0
8
54
50
26
24
2
1
{-# LANGUAGE MagicHash #-} ----------------------------------------------------------------------------- -- -- GHCi Interactive debugging commands -- -- Pepe Iborra (supported by Google SoC) 2006 -- -- ToDo: lots of violation of layering here. This module should -- decide whether it is above the GHC API (import GHC a...
ezyang/ghc
compiler/ghci/Debugger.hs
bsd-3-clause
9,705
0
20
3,023
2,359
1,208
1,151
175
8
<?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="sq-AL"> <title>FuzzDB Files</title> <maps> <homeID>fuzzdb</homeID> <mapref location="ma...
thc202/zap-extensions
addOns/fuzzdb/src/main/javahelp/help_sq_AL/helpset_sq_AL.hs
apache-2.0
960
77
66
156
407
206
201
-1
-1
module Foo.Baz where bar = 4
RefactoringTools/HaRe
test/testdata/cabal/foo/src/Foo/Baz.hs
bsd-3-clause
30
0
4
7
11
7
4
2
1
---------------------------------------------------------------------------------------------------------------- -- Module : RefacTypeUtils -- Maintainer : refactor-fp\@kent.ac.uk -- | -- -- This module contains a collection of program analysis and transformation functions (the API) that work -- over the Type...
kmate/HaRe
old/refactorer/RefacTypeUtils.hs
bsd-3-clause
142,300
97
31
44,912
37,212
19,433
17,779
-1
-1
import System.Posix.Time import System.Posix.Unistd import System.Posix.Signals main = do start <- epochTime blockSignals reservedSignals -- see #4504 sleep 1 finish <- epochTime let slept = finish - start if slept >= 1 && slept <= 2 then putStrLn "OK" ...
rimmington/unix
tests/libposix/posix006.hs
bsd-3-clause
544
0
10
246
126
57
69
16
2
module T5327 where newtype Size = Size Int {-# INLINABLE val2 #-} val2 = Size 17 -- In the core, we should see a comparison against 34#, i.e. constant -- folding should have happened. We actually see it twice: Once in f's -- definition, and once in its unfolding. f n = case val2 of Size s -> s + s > n
wxwxwwxxx/ghc
testsuite/tests/simplCore/should_compile/T5327.hs
bsd-3-clause
307
0
9
67
53
30
23
4
1
{- Copyright (c) 2008, 2009 Russell O'Connor Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, dist...
haasn/colour
Data/Colour/Internal.hs
mit
7,741
0
12
1,500
1,785
955
830
90
1
module Main ( main ) where -- doctest import qualified Test.DocTest as DocTest main :: IO () main = DocTest.doctest [ "-isrc" , "src/JoinList.hs" , "src/Scrabble.hs" ]
mauriciofierrom/cis194-homework
homework07/test/examples/Main.hs
mit
195
0
6
54
47
29
18
9
1
{-# LANGUAGE CPP, ForeignFunctionInterface #-} module Regex where import Foreign import Foreign.C.Types #include <pcre.h> newtype PCREOption = PCREOption { unPCREOption :: CInt } deriving (Eq, Show)
zhangjiji/real-world-haskell
ch17/Regex-hsc.hs
mit
222
0
6
49
39
26
13
6
0