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
-- Implementation to represent peano numbers data Pint = Zero | Succ Pint deriving(Eq,Show) istZahl :: Pint -> Bool istZahl x = case x of {Zero -> True; (Succ y) -> istZahl y} --If the first is a Boolean use istZahl to check for a valid number istZahlAll :: PintAll -> Bool istZahlAll (x,y) = case x of {True -> ...
situx/Misc
Haskell/peano.hs
gpl-3.0
3,000
2
18
844
1,084
572
512
49
5
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Translate.Types.Sum -- Copyright : (c) 2015-2016 Brend...
rueshyna/gogol
gogol-translate/gen/Network/Google/Translate/Types/Sum.hs
mpl-2.0
1,434
0
11
310
191
110
81
26
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-ml/gen/Network/Google/Resource/Ml/Projects/Locations/Studies/Trials/Complete.hs
mpl-2.0
5,453
0
16
1,187
779
455
324
112
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-cloudprivatecatalogproducer/gen/Network/Google/Resource/CloudPrivateCatalogProducer/Catalogs/Products/Versions/List.hs
mpl-2.0
6,210
0
18
1,386
883
512
371
128
1
{-# LANGUAGE BangPatterns , MultiParamTypeClasses #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- 'Convertible' instances for conversions between pixel types. module Vision.Image.Conversion (Convertible (..), convert) where import Data.Convertible (Convertible (..), ConvertResult, convert) import Data.Word i...
RaphaelJ/friday
src/Vision/Image/Conversion.hs
lgpl-3.0
6,333
0
18
1,876
1,778
918
860
112
1
module Chess.A278211Spec (main, spec) where import Test.Hspec import Chess.A278211 (a278211) main :: IO () main = hspec spec spec :: Spec spec = describe "A278211" $ it "correctly computes the first 3 elements" $ map a278211 [1..3] `shouldBe` expectedValue where expectedValue = [0,4,12]
peterokagey/haskellOEIS
test/Chess/A278211Spec.hs
apache-2.0
306
0
8
61
103
58
45
10
1
{-# LANGUAGE PatternGuards #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeOperators #-} -- | K3 Program constructor module Language.K3.Parser.ProgramBuilder ( defaultIncludes, defaultRoleName, processInitsAndRoles, endpointMethods, bindSource, mkRunSourceE, mkRunSinkE, declareBuiltins, resolve...
DaMSL/K3
src/Language/K3/Parser/ProgramBuilder.hs
apache-2.0
31,160
0
22
8,284
10,022
5,128
4,894
539
52
{-# LANGUAGE TemplateHaskell #-} module Cluster where import Control.Lens import Control.Lens.TH import Control.Concurrent.STM newtype Cluster = Cluster { _size :: Int } makeLenses ''Cluster
kdkeyser/halvin
src/halvin/Cluster.hs
apache-2.0
196
0
6
29
43
27
16
8
0
module SSync.JSVector (Vector, (!), create, empty) where import qualified SSync.JSVectorM as VM import System.IO.Unsafe (unsafePerformIO) import SSync.JSVector.Internal newtype Vector = Vector VM.Vector instance Show Vector where show _ = "[...]" foreign import javascript unsafe "$1[$2]" idx :: VM.Vector -> Int ...
socrata-platform/ssync
src/main/haskell/SSync/JSVector.hs
apache-2.0
818
9
8
134
212
120
92
18
1
-- Copyright 2020 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 -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in ...
google/hrepl
hrepl/tests/Chain3Dupe.hs
apache-2.0
668
0
5
115
36
26
10
3
1
import Data.Monoid {-comp :: String -> String -> Ordering-} {-comp xs ys-} {-| length xs < length ys = LT-} {-| length xs > length ys = GT-} {-| otherwise = xs `compare` ys-} comp' :: String -> String -> Ordering comp' x y = (length x `compare` length y) `mappend` noVowels x y `mappend` ...
paulbarbu/haskell-ground
monoid.hs
apache-2.0
518
0
10
178
127
73
54
8
1
{-# LANGUAGE FlexibleContexts #-} module HaskHOL.Lib.IndTypes.Pre where import HaskHOL.Core hiding (typeOf, rights, lefts) import HaskHOL.Core.Kernel (typeOf) import qualified HaskHOL.Core.State as S (mkType) import HaskHOL.Deductive hiding (getDefinition, getSpecification, newDefinition) import HaskHOL.Lib.Pair impo...
ecaustin/haskhol-math
src/HaskHOL/Lib/IndTypes/Pre.hs
bsd-2-clause
27,255
1
23
10,208
9,471
4,635
4,836
-1
-1
----------------------------------------------------------------------------- -- | -- Module : Haddock.Backends.Html.DocMarkup -- Copyright : (c) Simon Marlow 2003-2006, -- David Waern 2006-2009, -- Mark Lentczner 2010 -- License : BSD-like -- -- Maintainer : h...
JPMoresmau/haddock
haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
bsd-2-clause
10,602
0
17
3,017
2,478
1,313
1,165
155
9
module Data.Text.Prettyprint.Doc.Render.Terminal.Internal {-# DEPRECATED "Use \"Prettyprinter.Render.Terminal.Internal\" instead." #-} ( module Prettyprinter.Render.Terminal.Internal ) where import Prettyprinter.Render.Terminal.Internal
quchen/prettyprinter
prettyprinter-ansi-terminal/src/Data/Text/Prettyprint/Doc/Render/Terminal/Internal.hs
bsd-2-clause
244
0
5
22
29
22
7
3
0
module Application.DocManager.Command where import Application.DocManager.ProgType import Application.DocManager.Job import Application.DocManager.Config import Text.Parsec import System.Environment import System.FilePath commandLineProcess :: Docmanager -> IO () commandLineProcess c = do putStrLn "test calle...
wavewave/docmanager
lib/Application/DocManager/Command.hs
bsd-2-clause
686
0
15
133
181
88
93
20
3
module Test.Day17 where import Day17 import Test.Tasty import Test.Tasty.HUnit day17 :: TestTree day17 = testGroup "No Such Thing as Too Much" [part1, part2] part1 :: TestTree part1 = testGroup "Part 1" [p1Tests, p1Puzzle] containers :: [Int] containers = [20, 15, 10, 5, 5] p1Tests :: TestTree p1Tests = testGroup...
taylor1791/adventofcode
2015/test/Test/Day17.hs
bsd-2-clause
1,008
2
14
186
347
181
166
26
1
{-# LANGUAGE OverloadedStrings #-} module FortuneIndexer ( getTerm ) where import Control.Monad (forM_) import Data.List.Split (splitOn) import Data.Char (isLetter, isSpace) import Data.Text.Encoding as E import qualified Data.Map as M import qualified Data.Text as T import qualified Data.Text...
fffej/Keyword-Search
FortuneIndexer.hs
bsd-2-clause
2,165
0
13
393
822
448
374
46
1
----------------------------------------------------------------------------- -- | -- Module : Application.HXournal.Coroutine.Eraser -- Copyright : (c) 2011, 2012 Ian-Woo Kim -- -- License : BSD3 -- Maintainer : Ian-Woo Kim <ianwookim@gmail.com> -- Stability : experimental -- Portability : GHC -- -------...
wavewave/hxournal
lib/Application/HXournal/Coroutine/Eraser.hs
bsd-2-clause
4,097
0
19
922
934
515
419
76
2
{-# LANGUAGE RecordWildCards #-} module Main where import Control.Applicative import Control.Exception import Data.Aeson import Data.Aeson.Diff import qualified Data.ByteString.Char8 as BS import qualified Data.ByteString.Lazy as BSL import Data.Monoid import...
thsutton/aeson-diff
src/patch.hs
bsd-2-clause
2,671
0
14
835
734
368
366
77
3
#!/usr/local/bin/runhaskell {-# LANGUAGE DeriveDataTypeable #-} import Text.Hastache import Text.Hastache.Context import qualified Data.Text.Lazy.IO as TL import Data.Data import Data.Generics main = hastacheStr defaultConfig (encodeStr template) context >>= TL.putStrLn -- begin example data Hero = Hero { na...
lymar/hastache
examples/listsGeneric.hs
bsd-3-clause
639
0
9
111
164
97
67
16
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE PolyKinds, DataKinds, TypeFamilies, TypeOperators, UndecidableInstances #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Either -- Copyright : ...
gridaphobe/ghc
libraries/base/Data/Either.hs
bsd-3-clause
8,020
1
9
1,702
847
509
338
50
1
{-# LANGUAGE UndecidableInstances #-} module Database.Esqueleto.Join where import Data.Singletons.TH import Database.Esqueleto import Prelude $(singletons [d| data MaybeCon = Present | Absent deriving (Eq, Show) |]) type family MaybeMaybe (a :: MaybeCon) (b :: *) :: * where MaybeMaybe 'Present b = Maybe b Ma...
pseudonom/dovetail
src/Database/Esqueleto/Join.hs
bsd-3-clause
4,240
7
17
1,139
1,849
1,008
841
-1
-1
{-# LANGUAGE BangPatterns #-} module Main where import qualified Data.ByteString as B import qualified Crypto.MAC.SipHash as SipHash import Criterion.Main main = do let !bs5 = B.pack [0..4] !bs8 = B.pack [0..7] !bs11 = B.pack [0..10] !bs40 = B.pack [0..39] !bs1Mb = B.pack . map fro...
vincenthz/hs-siphash
Benchs/Bench.hs
bsd-3-clause
685
0
12
237
255
124
131
20
1
module Text.Highlighter.Lexers.Bash (lexer) where import Text.Regex.PCRE.Light import Text.Highlighter.Types lexer :: Lexer lexer = Lexer { lName = "Bash" , lAliases = ["bash", "sh", "ksh"] , lExtensions = [".sh", ".ksh", ".bash", ".ebuild", ".eclass"] , lMimetypes = ["application/x-sh", "application/...
chemist/highlighter
src/Text/Highlighter/Lexers/Bash.hs
bsd-3-clause
3,145
0
12
535
819
427
392
61
1
{-| Module : Data.BinaryIndexedTree.ST Description : Binary Indexed Trees (a.k.a. Fenwick Trees) Copyright : (c) 2012 Maxwell Sayles. License : BSD3 Maintainer : maxwellsayles@gmail.com Stability : stable Portability : portable Implements mutable binary indexed trees (a.k.a. Fenwick Trees) in O(logn) fo...
maxwellsayles/binary-indexed-tree
Data/BinaryIndexedTree/ST.hs
bsd-3-clause
1,795
0
20
472
389
202
187
27
1
module HipBot.Naggy.Scheduling ( startReminder , stopReminder , stopReminders ) where import Control.Concurrent import Control.Concurrent.STM import Control.Lens import Control.Monad.Reader import Data.Foldable import qualified Data.HashMap.Strict as HashMap import Data.Monoid import qualified Data.Set as Set ...
purefn/naggy
src/HipBot/Naggy/Scheduling.hs
bsd-3-clause
2,977
0
24
745
1,080
537
543
-1
-1
{-| Module : W Description : Merge sort algorithm Copyright : (c) Maksymilian Wojczuk, 2017 Implementation of merge sort alghoritm. -} module MergeSort ( mergeSort, merge ) where -- |Function takes 2 sorted lists and merges them into one sorted list merge :: Ord a => [a] -> [a] -> [a] merge xs [] = xs...
maxiwoj/HaskellProject
src/MergeSort.hs
bsd-3-clause
906
0
10
204
276
148
128
15
1
---------------------------------------------------------------------------- -- | -- Module : Control.Monad.ErrorExcept -- Copyright : (c) Sergey Vinokurov 2018 -- License : BSD3-style (see LICENSE) -- Maintainer : serg.foo@gmail.com ----------------------------------------------------------------------...
sergv/tags-server
src/Control/Monad/ErrorExcept.hs
bsd-3-clause
2,454
0
10
497
512
287
225
58
1
{-# LANGUAGE LambdaCase #-} module Data.ListParse where import Control.Applicative import Control.Monad -- Quick and dirty monadic parser for list inputs data Parser a r = Parser { parse :: [a] -> Either String ([a], r) } instance Functor (Parser a) where fmap f (Parser p) = Parser (fmap (fmap f) . p) instance...
bhamrick/wordpairs
Data/ListParse.hs
bsd-3-clause
1,215
0
13
365
526
270
256
36
3
import Control.Monad (when) import Data.List (intercalate) import Data.List.Split (splitOn) import Development.Shake.Config import Need import Node import Paths import Shake.BuildNode import Syst...
reckbo/ppl
pipeline-cli/Main.hs
bsd-3-clause
2,331
0
22
971
573
292
281
58
2
module Combinations where -- | List all combinations of length n of a list (6 kyu) -- | Link: https://biturl.io/Combinations -- | My original solution combinations :: Int -> [a] -> [[a]] combinations n xs = filter ((n ==) . length) $ foldr (\a b -> b ++ map (a :) b) [[]] xs -- | Refactored solution I came up with ...
Eugleo/Code-Wars
src/combinatorics-kata/Combinations.hs
bsd-3-clause
937
0
12
231
355
196
159
19
2
{-# LANGUAGE OverloadedStrings #-} module ByteStringToBase64 where import Data.ByteString.Lazy (ByteString) import qualified Data.ByteString.Lazy as B import Data.ByteString.Base64.Lazy (encode) import qualified Data.ByteString.Lazy.Char8 as BC import Data.Text ...
stla/jsonxlsx
src/ByteStringToBase64.hs
bsd-3-clause
662
0
9
155
149
90
59
12
1
{-# LANGUAGE BangPatterns, RecordWildCards, GADTs #-} module GHC.Cmm.LayoutStack ( cmmLayoutStack, setInfoTableStackMap ) where import GhcPrelude hiding ((<*>)) import GHC.StgToCmm.Utils ( callerSaveVolatileRegs, newTemp ) -- XXX layering violation import GHC.StgToCmm.Foreign ( saveThreadState, load...
sdiehl/ghc
compiler/GHC/Cmm/LayoutStack.hs
bsd-3-clause
47,009
1
25
13,614
7,793
4,165
3,628
556
6
module Graphics.ChalkBoard.Font ( Graphics.ChalkBoard.Font.initFont , Font , letter , lineSpacing , label ) where --import Data.Boolean --import Data.Ix import Data.Array.Unboxed import Graphics.Rendering.TrueType.STB hiding (Font) import qualified Graphics.Rendering.TrueType.STB as STB --import Graphics.Chalk...
andygill/chalkboard2
Graphics/ChalkBoard/Font.hs
bsd-3-clause
3,058
64
14
779
989
542
447
62
4
----------------------------------------------------------------------------- -- | -- Module : RefacInstantiate -- Copyright : (c) Christopher Brown 2007 -- -- Maintainer : cmb21@kent.ac.uk -- Stability : provisional -- Portability : portable -- -- This module contains a transformation for HaRe. -- Insta...
forste/haReFork
refactorer/RefacInstantiate.hs
bsd-3-clause
4,417
0
21
1,199
1,477
758
719
-1
-1
module Network.Probecraft where import Network.Pcap import Network.Probecraft.Sniff printPackets iface cnt bpf = do pcap <- openLive iface 1500 False 100000 setFilter pcap bpf True 0 link <- datalink pcap print $ show link loopBS pcap cnt handler (statistics pcap) >>= print where handler ...
lucasdicioccio/probecraft-hs
Network/Probecraft.hs
bsd-3-clause
614
0
16
227
187
88
99
16
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE...
vigoo/stack
src/Stack/Types/Build.hs
bsd-3-clause
30,493
0
21
9,666
5,724
3,130
2,594
708
7
{-# LANGUAGE NoMonomorphismRestriction #-} module RE.Parse where import Control.Applicative import Text.Trifecta import Text.Trifecta.Delta import Text.Trifecta.Parser import Text.Trifecta.Result import RE.AST parse s = let Success ast = parseString expr (Lines 0 0 0 0) s in ast expr = term `chainl1` or_op ...
forestbelton/revm
src/RE/Parse.hs
bsd-3-clause
662
0
11
130
229
121
108
20
1
-- -- -- ----------------- -- Exercise 11.5. ----------------- -- -- -- module E'11''5 where -- zipWith applies the application operator to each element in the first list "[ sum , product ]". -- The arguments for each application are in the second list "[ [1, 2] , [3, 4] ]". -- -- Each application result is an eleme...
pascal-knodel/haskell-craft
_/links/E'11''5.hs
mit
444
0
2
99
19
18
1
1
0
{-# LANGUAGE Arrows #-} {-# LANGUAGE FlexibleContexts #-} module Environment ( cellUnoccupied , cellOccupied , regrow , sugEnvironment ) where import Data.Maybe import Control.Monad.Random import Control.Monad.State.Strict import FRP.BearRiver import Common import Disc...
thalerjonathan/phd
thesis/code/concurrent/sugarscape/SugarScapeIO/src/Environment.hs
gpl-3.0
1,928
1
16
477
438
230
208
46
1
module HplAssets.Hephaestus.Parser.HephaestusParser where import HplAssets.Hephaestus.Types import BasicTypes -- imports to function parserHephaestus import Language.Haskell.Parser -- import to function outputHephaestus import Language.Haskell.Syntax import Language.Haskell.Pretty import Distribution.ModuleName...
alessandroleite/hephaestus-pl
src/meta-hephaestus/HplAssets/Hephaestus/Parser/HephaestusParser.hs
lgpl-3.0
958
0
13
196
295
146
149
22
1
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeInType #-} module Bug where import Data.Kind type HRank1 ty = forall k1. k1 -> ty type HRank2 ty = forall k2. k2 -> ty data HREFL11 :: HRank1 (HRank1 Type) -- FAILS data HREFL12 :: HRank1 (HRank2 Type) data HREFL21 :: HRank2 (HRank1 Type) data HREFL22 :: HRank2 (HRank2 Ty...
shlevy/ghc
testsuite/tests/polykinds/T14515.hs
bsd-3-clause
333
0
7
62
105
62
43
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Configure -- Copyright : Isaac Jones 2003-2005 -- Lice...
tolysz/prepare-ghcjs
spec-lts8/cabal/Cabal/Distribution/Simple/Configure.hs
bsd-3-clause
94,037
16
24
28,828
15,541
8,121
7,420
1,360
15
{-# Language PatternGuards #-} module Blub ( blub , foo , bar ) where import Ugah.Foo import Control.Applicative import Ugah.Blub (a, b, c, d, e, f) f :: Int -> Int f = (+ 3) g :: Int g = where
jystic/hsimport
tests/inputFiles/SymbolTest27.hs
bsd-3-clause
228
0
5
75
79
50
29
-1
-1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- License : BSD-3-Clause -- Maintainer : Oleg Grenrus <oleg.grenrus@iki.fi> -- -- The repo commits API as described on -- <http://developer.github.com/v3/repos/commits/>. module GitHub.Endpoints.Repos.Commits...
jwiegley/github
src/GitHub/Endpoints/Repos/Commits.hs
bsd-3-clause
2,535
0
11
374
598
322
276
32
1
module Main where import qualified Codec.Archive.Tar.Index as Index import qualified Codec.Archive.Tar.Index.IntTrie as IntTrie import qualified Codec.Archive.Tar.Index.StringTable as StringTable import Test.Tasty import Test.Tasty.QuickCheck main :: IO () main = defaultMain $ testGroup "tar tests" [ tes...
hvr/tar
test/Properties.hs
bsd-3-clause
871
0
11
209
175
100
75
21
1
{-# OPTIONS_HADDOCK hide #-} -- #hide #if __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Safe #-} #endif module Text.XHtml.Frameset.Attributes where import Text.XHtml.Internals -- * Extra attributes in XHTML Frameset frameborder :: Int -> HtmlAttr frameborder = intAttr "frameborder" marginheight ...
DavidAlphaFox/ghc
libraries/xhtml/Text/XHtml/Frameset/Attributes.hs
bsd-3-clause
654
0
5
193
101
59
42
13
1
module Stack.DefaultColorWhen ( defaultColorWhen ) where import Stack.Prelude (stdout) import Stack.Types.Config (ColorWhen (ColorAuto, ColorNever)) import System.Console.ANSI (hSupportsANSIWithoutEmulation) import System.Environment (lookupEnv) -- | The default adopts the standard proposed at http://no-color.or...
juhp/stack
src/Stack/DefaultColorWhen.hs
bsd-3-clause
1,049
0
14
188
145
82
63
15
3
{-# LANGUAGE OverloadedStrings #-} module Clay.Pseudo where import Data.Text (Text) import Clay.Selector -- List of specific pseudo classes, from: -- https://developer.mozilla.org/en-US/docs/CSS/Pseudo-classes after, before :: Refinement after = ":after" before = ":before" link, visited, active, hover, focus, fi...
damianfral/clay
src/Clay/Pseudo.hs
bsd-3-clause
1,541
0
6
350
319
207
112
42
1
module Main where import Haste import Haste.DOM import Haste.Events main = withElems ["a","b","op","result"] calculator calculator [a,b,op,result] = do onEvent a KeyUp $ \_ -> recalculate onEvent b KeyUp $ \_ -> recalculate onEvent op Change $ \_ -> recalculate where recalculate = do ma <- g...
beni55/haste-compiler
examples/calculator/calculator.hs
bsd-3-clause
643
0
15
205
271
142
129
21
6
module Meas () where import Language.Haskell.Liquid.Prelude mylen :: [a] -> Int mylen [] = 0 mylen (_:xs) = 1 + mylen xs mymap f [] = [] mymap f (x:xs) = (f x) : (mymap f xs) zs :: [Int] zs = [1..100] prop2 = liquidAssertB (n1 == n2) where n1 = mylen zs n2 = mylen $ mymap (`plus` 1)...
mightymoose/liquidhaskell
tests/pos/meas4.hs
bsd-3-clause
325
0
9
100
170
94
76
12
1
module Lamdu.Data.ExampleDB(initDB, createBuiltins) where import Control.Applicative (Applicative(..), liftA2, (<$>)) import Control.Lens.Operators import Control.Monad (join, unless, void, (<=<)) import Control.Monad.Trans.Class (lift) import Control.MonadA (MonadA) import Data.Binary (Binary(..)) import Data.Foldabl...
schell/lamdu
Lamdu/Data/ExampleDB.hs
gpl-3.0
11,600
0
20
2,843
3,860
1,968
1,892
278
1
module T11272a where import Control.Monad.Trans.State import Control.Monad overloaded :: Ord a => a -> a -> State () () overloaded x y = do () <- get when (x <= y) (overloaded y x) {-# INLINABLE overloaded #-}
ezyang/ghc
testsuite/tests/simplCore/should_compile/T11272a.hs
bsd-3-clause
216
0
9
44
88
46
42
7
1
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts, GADTs #-} module FDsFromGivens where class C a b | a -> b where cop :: a -> b -> () {- Failing, as it righteously should! It's inaccessible code -} -- But (c.f. test T5236) we no longer reject this in the -- typechecker (see Trac #12466...
olsner/ghc
testsuite/tests/typecheck/should_fail/FDsFromGivens.hs
bsd-3-clause
478
0
9
90
85
49
36
6
1
module T10598_fail5 where data Foo = Foo deriving Eq deriving Ord
ezyang/ghc
testsuite/tests/deriving/should_fail/T10598_fail5.hs
bsd-3-clause
71
0
5
16
17
11
6
4
0
module Tree where data Tree a = EmptyTree | Node a (Tree a) (Tree a) deriving (Show, Read, Eq) singleton :: a -> Tree a singleton x = Node x EmptyTree EmptyTree treeInsert :: (Ord a) => a -> Tree a -> Tree a treeInsert x EmptyTree = singleton x treeInsert x tree@(Node e left right) | x == e = tree | x < e = Nod...
fredmorcos/attic
snippets/haskell/Tree.hs
isc
708
0
8
178
373
183
190
19
1
{-# LANGUAGE ViewPatterns #-} ----------------------------------------------------------------------------- -- | -- Module : Algebra.Graph.Test.Acyclic.AdjacencyMap -- Copyright : (c) Andrey Mokhov 2016-2022 -- License : MIT (see the file LICENSE) -- Maintainer : andrey.mokhov@gmail.com -- Stability : experime...
snowleopard/alga
test/Algebra/Graph/Test/Acyclic/AdjacencyMap.hs
mit
23,251
0
16
7,821
6,872
3,393
3,479
-1
-1
{-# LANGUAGE TypeFamilies, TypeOperators #-} {-# LANGUAGE GADTs, DataKinds, PolyKinds #-} {-# LANGUAGE TypeSynonymInstances, FlexibleContexts, FlexibleInstances, UndecidableInstances #-} module Singletons where import Data.Type.Equality data family Sing (a :: k) :: * class SingI (a :: k) where sing :: Sing a dat...
vladfi1/hs-misc
Singletons.hs
mit
1,155
4
10
266
455
235
220
35
0
module Cmm.Cmm where import Cmm.CmmNode
C-Elegans/linear
Cmm/Cmm.hs
mit
40
0
4
5
11
7
4
2
0
{-# htermination enumFromThenTo :: Bool -> Bool -> Bool -> [Bool] #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_enumFromThenTo_7.hs
mit
70
0
2
12
3
2
1
1
0
-- | -- Module : Data.Edison.Coll.SkewHeap -- Copyright : Copyright (c) 1998-1999, 2008 Chris Okasaki -- License : MIT; see COPYRIGHT file for terms and conditions -- -- Maintainer : robdockins AT fastmail DOT fm -- Stability : stable -- Portability : GHC, Hugs (MPTC and FD) -- -- Skew...
robdockins/edison
edison-core/src/Data/Edison/Coll/SkewHeap.hs
mit
14,726
0
18
4,381
6,991
3,560
3,431
-1
-1
{-# LANGUAGE PackageImports #-} module Core.TypeCheck where import Control.Applicative import Control.Monad import "mtl" Control.Monad.State import Data.Either import qualified Data.Map as M import Data.Maybe import Text.Printf import Core.AST import Core.PrettyPrinter -- | Check types. Simple enough. typecheck :: ...
tcsavage/lazy-compiler
src/Core/TypeCheck.hs
mit
7,477
0
24
2,126
2,315
1,107
1,208
158
11
{-# LANGUAGE ScopedTypeVariables #-} --module JobServer (initializeJobServer, getJobServer, clearJobServer, runJobs, runJob, waitOnJobs, -- printJobServerHandle, JobServerHandle, tryWaitOnJobs) where import Control.Concurrent (newEmptyMVar, putMVar, takeMVar, tryTakeMVar, MVar, threadDelay, forkOS) i...
dinkelk/job-server
JobServer.hs
mit
7,575
0
13
2,015
2,145
1,076
1,069
129
2
module ProgramOptions ( options, Options(..) ) where import Data.Text.Read import Options.Applicative data Options = Options { word :: String , seed :: Integer , bytes :: Maybe String } options :: Parser (Maybe Options) options = flag' Nothing (long "version" <> hidden) <|> (Jus...
sclausen/haskell-weighted-inits
src/ProgramOptions.hs
mit
805
0
15
279
219
112
107
26
1
module Mish.Util where import System.Random choice :: [a] -> StdGen -> (a, StdGen) choice [] _ = error "invalid list for choice" choice l g = (l !! index, g') where (index, g') = randomR (0, length l - 1) g
halvorgb/mish
src/Mish/Util.hs
mit
212
0
10
46
100
55
45
6
1
-- | -- Module : $Header$ -- Description : Ohua namespaces -- Copyright : (c) Justus Adam 2018. All Rights Reserved. -- License : EPL-1.0 -- Maintainer : sebastian.ertel@gmail.com, dev@justus.science -- Stability : experimental -- Portability : portable -- This source code is licensed under the terms desc...
ohua-dev/ohua-core
core/src/Ohua/Frontend/NS.hs
epl-1.0
3,484
0
15
864
967
536
431
-1
-1
module Main where import System (getArgs) import IO import List (isSuffixOf) import Maybe (fromJust) import Text.XML.HaXml.Types (Document(..),Content(..)) import Text.XML.HaXml.Parse (xmlParse,dtdParse) import Text.XML.HaXml.Validate (validate) import Text.XML.HaXml.Wrappers (fix2Args) -- This is a fai...
jgoerzen/dtmconv
HaXml-1.12/src/tools/Validate.hs
gpl-2.0
843
0
12
181
223
127
96
18
3
module Interpolacion where import GramaticaAbstracta import Semantica import SistemasEcuaciones import FuncionesAuxiliaresSE {-METODO DE NEWTON CON DIFERENCIAS DIVIDIDAS NOTA: Este metodo tiene dos partes: Una que evalua un punto nuevo en el polinomio y da el resultado de la interpolacion y otra que entrega el polin...
dmuneras/LambdaMethods
src/Interpolacion.hs
gpl-2.0
14,045
0
21
3,226
5,464
2,962
2,502
164
3
{-# LANGUAGE MultiParamTypeClasses #-} module NFA.Compress.Inter where import NFA.Compress.Compressed import NFA.Compress.Instance import NFA.Compress.Data import NFA.Compress.Look import NFA.Compress.Roll import NFA.Compress.Config import qualified Fun.Table as F import Autolib.Reporter import Autolib.ToDoc import...
Erdwolf/autotool-bonn
src/NFA/Compress/Inter.hs
gpl-2.0
2,023
11
18
519
666
349
317
54
1
{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE OverloadedStrings #-} module MusicBrainz.API.Recording where import Control.Applicative import Control.Lens import Data.Text (Text) import Text.Digestive import qualified Data.Map as Map import qualified Data.Set as Set i...
metabrainz/musicbrainz-data-service
src/MusicBrainz/API/Recording.hs
gpl-2.0
3,900
0
13
589
708
383
325
56
1
{-# LANGUAGE Arrows #-} {-# LANGUAGE MultiWayIf #-} -- | This module defines the time transformation functions. module Game.Time where -- External imports import FRP.Yampa import FRP.Yampa.Extra -- Internal iports import Game.Input import Game.ObjectSF -- | Time transformation that allows time to be reversed. ti...
keera-studios/pang-a-lambda
src/Game/Time.hs
gpl-3.0
1,421
2
18
372
363
194
169
28
4
{-# LANGUAGE OverloadedLists, QuasiQuotes #-} module Nirum.Constructs.ServiceSpec where import Data.String.QQ (s) import Data.Map.Strict as Map (fromList) import Test.Hspec.Meta import Nirum.Constructs.Annotation import Nirum.Constructs.Annotation.Internal import Nirum.Constructs.Docs (toCode) import Nirum.Constructs...
spoqa/nirum
test/Nirum/Constructs/ServiceSpec.hs
gpl-3.0
10,056
0
16
4,861
1,567
819
748
166
1
{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ImplicitParams #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE Rank2Types #-} import Control.Applicative ((<$>)) import Control.Monad (forM_, when, unless) import Control.Monad.Reader (asks) import Data.Defa...
aartamonau/repo-bisect
src/Snapshot.hs
gpl-3.0
9,201
0
22
2,784
2,054
1,121
933
207
3
module HipSpec.Literal (trLiteral) where import HipSpec.Theory import HipSpec.Translate import HipSpec.Property import HipSpec.Lang.PolyFOL import HipSpec.Id trLiteral :: ArityMap -> [Id] -> Literal -> Formula LogicId LogicId trLiteral am sc (e1 :=: e2) = trSimpExpr am sc e1 === trSimpExpr am sc e2
danr/hipspec
src/HipSpec/Literal.hs
gpl-3.0
304
0
8
45
99
54
45
8
1
{-# LANGUAGE OverloadedStrings, FlexibleContexts #-} module AnsiParser.Parser where import AnsiParser.Types -- import Text.ParserCombinators.Parsec.Token -- import Text.Parsec -- import Text.Parsec.Char (oneOf, satisfy) -- import Text.Parsec.ByteString (Parser) -- import Data.String (IsString) -- -- import Data.Byt...
pscollins/ansi-parser
src/AnsiParser/Parser.hs
gpl-3.0
1,796
0
4
587
46
42
4
3
0
{-# LANGUAGE DeriveGeneric #-} import Text.Printf (printf) import Data.Aeson import GHC.Generics import Network.HTTP.Conduit (simpleHttp) import Data.Text (Text) import qualified Data.Text as T import Data.List (maximumBy, sortBy) import Data.Function (on) data Person = Person { name :: Text , craft :: Text...
ciderpunx/57-exercises-for-programmers
src/P47InSpace.hs
gpl-3.0
1,733
0
14
506
547
286
261
49
2
import Data.List( nub, foldl' ) import Control.Monad( liftM, replicateM_ ) fact1 n = product [1..n] z1 = length . takeWhile (=='0') . reverse . show . fact1 check3 n = mod_2 || mod_5 where mod_2 = (n `mod` 2) == 0 mod_5 = (n `mod` 5) == 0 fact3 n = product . filter check3 $ [2..n] z3 = length . takeWhile...
zhensydow/ljcsandbox
lang/haskell/spoj/FCTRL.hs
gpl-3.0
1,139
0
11
270
693
368
325
36
1
module PropT10 where import Prelude(Bool(..)) import Zeno -- Definitions True && x = x _ && _ = False False || x = x _ || _ = True not True = False not False = True -- Nats data Nat = S Nat | Z (+) :: Nat -> Nat -> Nat Z + y = y (S x) + y = S (x + y) (*) :: Nat -> Nat -> Nat Z * _ = Z (S x) * y = y + (x...
danr/hipspec
testsuite/prod/zeno_version/PropT10.hs
gpl-3.0
2,957
0
10
913
1,989
1,035
954
114
2
{-# LANGUAGE OverloadedStrings #-} module TypeCheck where import AST import qualified Data.Map as M import Control.Monad import Control.Monad.Reader import Control.Applicative import Data.Ord import qualified Data.List as L import Prelude hiding (lookup) (>>>) = flip ($) trace = flip const lookup key map = case ...
joelwilliamson/modern-compilers-exercises
TypeCheck.hs
gpl-3.0
10,156
96
18
2,415
4,340
2,112
2,228
213
10
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-iam/gen/Network/AWS/IAM/ListVirtualMFADevices.hs
mpl-2.0
7,418
0
14
1,516
993
587
406
112
1
-- Problem 1 -- Find the last element of a list. last' [] = error "Empty list has no last element." last' (x:[]) = x last' (_:xs) = last' xs -- Problem 2 -- Find the last but one element of a list. butLast' [] = error "Empty list has has no but last element." butLast' (_:[]) = error "List with one element has no but...
porglezomp/learn-languages
haskell/99.hs
unlicense
2,234
0
11
540
751
396
355
37
2
import System.IO getChar' :: IO (Char, Char) getChar' = do x <- getChar getChar y <- getChar return (x, y) getLine' :: IO String getLine' = do x <- getChar if x == '\n' then return [] else do xs <- getLine' ...
dongarerahul/edx-haskell
chapter-8.hs
apache-2.0
2,223
1
12
825
800
383
417
62
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Kubernetes.V1.ResourceQuotaStatus where import GHC.Generics import Kubernetes.Any import qualified Data.Aeson -- | ResourceQuotaStatus defines...
minhdoboi/deprecated-openshift-haskell-api
kubernetes/lib/Kubernetes/V1/ResourceQuotaStatus.hs
apache-2.0
868
0
9
116
93
56
37
15
0
{-# LANGUAGE CPP #-} module CLaSH.GHC.Compat.GHC ( defaultErrorHandler ) where import qualified DynFlags import qualified Exception import qualified GHC import qualified MonadUtils defaultErrorHandler :: (Exception.ExceptionMonad m, MonadUtils.MonadIO m) => m a -> m a #if __GLASGOW_HASKELL__ >= 706 defaultE...
christiaanb/clash-compiler
clash-ghc/src-ghc/CLaSH/GHC/Compat/GHC.hs
bsd-2-clause
498
0
7
61
83
50
33
12
1
module Development.Cake3.Ext.UrEmbed.Types where import Data.Char import System.FilePath import Text.Printf data Args = A { bver :: Bool , out_c :: FilePath , out_h :: FilePath , out_urs :: FilePath , out_wrapper :: FilePath , out_ffi_js :: FilePath , mangle_css_url :: Bool , inp :: FilePath } -- o...
grwlf/cake3
src/Development/Cake3/Ext/UrEmbed/Types.hs
bsd-3-clause
1,331
0
12
314
412
221
191
33
3
module Chess.FEN ( fromFEN , toFEN , defaultFEN , defaultBoard ) where import Chess import qualified Data.List as L import Data.Char import Data.Array import Data.Maybe split [] delim = [""] split (c:cs) delim | c == delim = "" :...
ArnoVanLumig/chesshs
Chess/FEN.hs
bsd-3-clause
1,970
2
19
555
834
438
396
45
5
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE BangPatterns #-} -- | Property module Haskus.System.Linux.Graphics.Property ( PropertyMeta (..) , PropertyType (..) , RawProperty (..) , Pr...
hsyl20/ViperVM
haskus-system/src/lib/Haskus/System/Linux/Graphics/Property.hs
bsd-3-clause
8,582
0
27
2,944
2,013
1,097
916
165
11
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Concurrent (forkIO) import Control.Exception (try, SomeException(..)) import Control.Monad (void, when) import qualified Data.ByteString.Char8 as BS import Network.DNS import Network.DNS.Cache as DNSC import Data.Time confs :: [ResolvConf] confs = ...
kazu-yamamoto/concurrent-dns-cache
test/main.hs
bsd-3-clause
1,396
0
19
431
475
251
224
44
3
-------------------------------------------------------------------------------- module Crypto ( Pass , EncryptedPass , toPass , encryptPass , verifyPass ) where import Control.Applicative ((<$>)) import Data.Text (Text) import qualified Crypto.Scrypt as C import qualified Data.Text.Encodin...
mietek/untitled-wai
src/Crypto.hs
bsd-3-clause
1,334
0
11
194
302
171
131
30
1
module QuadTree ( QuadTree(..), AABB(..), HasAABB(..), subQuadrants, intersectAABB, empty, insert, remove, move, toList, queryIntersecting ) where import Data.List hiding (insert) import Control.Exception ...
alexisVallet/haskell-shmup
QuadTree.hs
bsd-3-clause
4,056
0
12
1,048
1,880
982
898
98
5
---------------------------------------------------------------------------- -- | -- Module : Language.Core.Interpreter.Evaluable -- Copyright : (c) Carlos López-Camey, University of Freiburg -- License : BSD-3 -- -- Maintainer : c.lopez@kmels.net -- Stability : stable -- -- -- Contains a type class ...
kmels/dart-haskell
src/Language/Core/Interpreter/Evaluable.hs
bsd-3-clause
24,168
78
32
6,353
5,925
2,973
2,952
358
4
module PCA ( fitPCA, transformPCA ) where import PCA.QModels import Numeric.LinearAlgebra.Data (Matrix, Vector, toRows, fromRows) import qualified Numeric.LinearAlgebra.HMatrix as H -- | Theta parameteres which we will you for predict in model data PCAModel = PCAModel { scale :: Matrix Double --...
DbIHbKA/vbpca
src/PCA.hs
bsd-3-clause
716
0
11
227
206
116
90
22
1
{- (c) The GRASP/AQUA Project, Glasgow University, 1993-1998 \section[Specialise]{Stamping out overloading, and (optionally) polymorphism} -} {-# LANGUAGE CPP #-} module Specialise ( specProgram, specUnfolding ) where #include "HsVersions.h" import Id import TcType hiding( substTy ) import Type hiding( substTy, e...
vikraman/ghc
compiler/specialise/Specialise.hs
bsd-3-clause
94,194
1
22
27,570
11,139
6,040
5,099
-1
-1
{-# LANGUAGE GADTs #-} module Architecture.ARM.Instructions.UAL.Semantics where import Architecture.ARM.State import Architecture.ARM.Instructions.UAL import Data.Record.Label -- This should be put somewhere else, maybe even in a separate package data Expr a where Const :: a -> Expr a (:+) :: Expr a -> Expr...
copumpkin/charm
src/Architecture/ARM/Instructions/UAL/Semantics.hs
bsd-3-clause
1,306
0
8
345
288
153
135
17
0
{-# LANGUAGE DeriveGeneric #-} module Crawl.Stats.Armour where import qualified Data.Csv as CSV import GHC.Generics (Generic) import qualified Data.Default as Default import qualified Crawl.Stats.Named as Named data Armour = Armour { name :: String, baseAc :: Integer, encumbrance :: Integer, gdr :: Integer ...
jfrikker/crawlstats
src/Crawl/Stats/Armour.hs
bsd-3-clause
498
0
8
86
135
82
53
17
0
{-# LANGUAGE QuasiQuotes, OverloadedStrings, FlexibleContexts, FlexibleInstances #-} module Data.Excelx where import Data.Maybe import Data.Monoid import Data.Time.LocalTime import Data.Time.Calendar import Control.Monad import Control.Monad.Reader import qualified Data.Text as T import qualified Data.ByteString.L...
mebaran/hs-excelx
src/Data/Excelx.hs
bsd-3-clause
7,488
0
24
1,889
2,639
1,310
1,329
175
2
module Guide.Types.Session ( GuideData (..), sessionUserID, emptyGuideData, SpockSession, GuideSession, sess_id, sess_csrfToken, sess_validUntil, sess_data, unwrapSession, wrapSession, SessionId, ) where import Imports import Data.SafeCopy hiding (kind) import Data.SafeCopy.Migrate i...
aelve/guide
back/src/Guide/Types/Session.hs
bsd-3-clause
1,668
0
11
305
400
231
169
-1
-1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StandaloneDeriving #-} module Logic.Pheasant where import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map import Data.Set (Se...
thsutton/pheasant
lib/Logic/Pheasant.hs
bsd-3-clause
3,795
0
14
905
1,062
577
485
85
3
{-# LANGUAGE FlexibleContexts, OverloadedStrings #-} {-# LANGUAGE OverloadedLists #-} {-# LANGUAGE NoImplicitPrelude #-} -- | Checks the balances of accounts. Useful to keep your ledgers -- consistent with the statements that come from the bank. module Penny.BalanceCheck (checkBalances) where import qualified Contr...
massysett/penny
penny/lib/Penny/BalanceCheck.hs
bsd-3-clause
6,211
0
16
1,365
1,681
896
785
138
4
module Rules.Compile (compilePackage) where import Hadrian.BuildPath import Hadrian.Oracles.TextFile import Base import Context as C import Expression import Oracles.Flag (platformSupportsSharedLibs) import Rules.Generate import Settings import Target import Utilities import qualified Text.Parsec as Parsec -- * Rul...
sdiehl/ghc
hadrian/src/Rules/Compile.hs
bsd-3-clause
9,882
0
17
2,313
2,130
1,095
1,035
-1
-1