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 Module4.Task28 where import Prelude hiding (lookup) import qualified Data.List as L class MapLike m where empty :: m k v lookup :: Ord k => k -> m k v -> Maybe v insert :: Ord k => k -> v -> m k v -> m k v delete :: Ord k => k -> m k v -> m k v fromList :: Ord k => [(k,v)] -> m k ...
dstarcev/stepic-haskell
src/Module4/Task28.hs
bsd-3-clause
1,139
0
13
343
603
310
293
31
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Operation ( OperationT , Permission(..) , requirePe...
meditans/haskell-webapps
ServantPersistent/src/Operation.hs
mit
2,398
0
18
618
703
374
329
62
6
-- -- -- ----------------- -- Exercise 8.23. ----------------- -- -- -- module E'8'23 where --
pascal-knodel/haskell-craft
_/links/E'8'23.hs
mit
102
0
2
22
14
13
1
1
0
{-# OPTIONS -Wall #-} -- add a few padding cell to the array and see if the performance improves
nushio3/Paraiso
Language/Paraiso/Annotation/Padding.hs
bsd-3-clause
98
0
2
20
4
3
1
1
0
module Robots3.Exact where import Robots3.Data import Autolib.Set import Control.Monad ( guard ) import Data.List ( tails ) clusters :: Set Position -> [ Set Position ] clusters ps = fixpoint cmeet $ do p <- setToList ps ; return $ unitSet p cmeet :: [ Set Position ] -> [ Set Position ] cmeet [] = [] cmeet [c]...
florianpilz/autotool
src/Robots3/Exact.hs
gpl-2.0
1,325
22
14
432
568
283
285
49
3
----------------------------------------------------------------------------- -- Strict State Thread module -- -- This library provides support for strict state threads, as described -- in the PLDI '94 paper by John Launchbury and Simon Peyton Jones. -- In addition to the monad ST, it also provides mutable variables S...
kaoskorobase/mescaline
resources/hugs/packages/hugsbase/Hugs/ST.hs
gpl-3.0
4,589
43
12
1,169
1,353
713
640
-1
-1
module Main where import System.Environment (getArgs) import System.Random (randomIO) import System.Random.MWC (Gen, initialize, uniformR) import System.Directory (getHomeDirectory, createDirectoryIfMissing) import System.FilePath ((</>)) import Control.Monad ...
TomSmeets/FractalArt
src/Main.hs
mit
5,455
0
14
1,577
2,354
1,241
1,113
131
7
{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilyDependencies #-} {-# LANGUAGE TypeInType #-...
ezyang/ghc
testsuite/tests/dependent/should_compile/T13910.hs
bsd-3-clause
4,433
93
19
1,313
1,732
994
738
-1
-1
{-# LANGUAGE BangPatterns, CPP, ForeignFunctionInterface, MagicHash, Rank2Types, RecordWildCards, UnboxedTuples, UnliftedFFITypes #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- | -- Module : Data.Text.Array -- Copyright : (c) 2009, 2010, 2011 Bryan O'Sullivan -- -- License : BSD-style -- Maintainer ...
beni55/text
Data/Text/Array.hs
bsd-2-clause
7,801
0
12
2,199
1,612
904
708
-1
-1
{-# LANGUAGE OverloadedStrings #-} module RFC2616 ( Header(..) , Request(..) , Response(..) , request , response ) where import Control.Applicative import Data.Attoparsec.ByteString as P import Data.Attoparsec.ByteString.Char8 (char8, endOfLine, isDigit_w8) import Data.ByteString (ByteSt...
beni55/attoparsec
examples/RFC2616.hs
bsd-3-clause
2,052
0
11
467
605
337
268
51
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="fa-IR"> <title>Highlighter</title> <maps> <homeID>highlighter</homeID> <mapref location...
thc202/zap-extensions
addOns/highlighter/src/main/javahelp/help_fa_IR/helpset_fa_IR.hs
apache-2.0
964
77
66
155
404
205
199
-1
-1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Stg to C--: heap management functions -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- module StgCmmHeap ( getVirtHp, setVirtHp...
GaloisInc/halvm-ghc
compiler/codeGen/StgCmmHeap.hs
bsd-3-clause
26,199
0
20
7,461
3,813
1,978
1,835
307
8
-- Test for #2188 module TH_scope where f g = [d| f :: Int f = g g :: Int g = 4 |]
sdiehl/ghc
testsuite/tests/quotes/TH_scope.hs
bsd-3-clause
115
0
5
56
17
12
5
-1
-1
module DoIn1 where --A definition can be removed if it is not used by other declarations. --Where a definition is removed, it's type signature should also be removed. --In this Example: remove the defintion 'k' io s = do let k = reverse s s <- getLine let q =(s ++ s) putStr ...
mpickering/HaRe
old/testing/removeDef/DoIn1.hs
bsd-3-clause
342
0
11
108
62
30
32
10
1
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-} {-# LANGUAGE EmptyCase, LambdaCase #-} {-# LANGUAGE TypeFamilies, UndecidableInstances #-} -- Check some type families and type synonyms module EmptyCase003 where type family A (a :: *) :: * -- Conservatively considered non-exhaustive (A a missing), --...
ezyang/ghc
testsuite/tests/pmcheck/should_compile/EmptyCase003.hs
bsd-3-clause
2,278
0
23
599
674
393
281
-1
-1
module Data.Time ( module Data.Time.Calendar, module Data.Time.Clock, module Data.Time.LocalTime, module Data.Time.Format ) where import Data.Time.Calendar import Data.Time.Clock import Data.Time.LocalTime import Data.Time.Format
beni55/haste-compiler
libraries/time/lib/Data/Time.hs
bsd-3-clause
235
8
5
26
68
45
23
10
0
module PackageTests.BuildDeps.TargetSpecificDeps1.Check where import Test.Tasty.HUnit import PackageTests.PackageTester import System.FilePath import Data.List import qualified Control.Exception as E import Text.Regex.Posix suite :: SuiteConfig -> Assertion suite config = do let spec = PackageSpec { ...
trskop/cabal
Cabal/tests/PackageTests/BuildDeps/TargetSpecificDeps1/Check.hs
bsd-3-clause
1,026
0
15
260
223
118
105
24
1
{-# LANGUAGE ImplicitParams #-} module T8474 where data D = D Int deriving Show -- In 7.7 this took exponential time! slow_to_compile :: IO () slow_to_compile = do tst1 <- return 1 let ?tst1 = tst1 {- let ?tst2 = tst1 let ?tst3 = tst1 let ?tst4 = tst1 let ?tst5 = tst1 let ?tst6 = tst1 let ?tst7 = tst...
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/typecheck/should_compile/T8474.hs
bsd-3-clause
343
0
9
87
63
33
30
8
1
{-# LANGUAGE GADTs #-} module API.WebMoney.Internal.Query where import Data.Text (Text) data QueryBestRates where QueryBestRates :: QueryBestRates data QueryExchanges where QueryExchanges :: { queryExchType :: !Int } -> QueryExchanges data QueryList where QueryList :: { listWMID :: !Text ...
triplepointfive/wmexchanger
src/API/WebMoney/Internal/Query.hs
mit
3,170
0
10
1,101
622
368
254
153
0
module Rebase.GHC.GHCi ( module GHC.GHCi ) where import GHC.GHCi
nikita-volkov/rebase
library/Rebase/GHC/GHCi.hs
mit
68
0
5
12
20
13
7
4
0
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TemplateHaskell #-} module Text.Greek.Grammar where import Control.Lens (makeLenses) import Data.Text (Text) data Source = Source { _author :: Text , _title :: Text , _year :: Int } makeLenses ''Source data Part = Section Text ...
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Text/Greek/Grammar.hs
mit
1,208
0
9
249
383
204
179
34
1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE QuasiQuotes #-} module Graphics.Urho3D.Graphics.View( View , SharedView , viewContext ) where import qualified Language.C.Inline as C import qualified Language.C.Inline.Cpp as C import Graphics.Urho3D.Graphics.Internal.View import Data.Monoid import Graphi...
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/Graphics/View.hs
mit
617
0
10
86
130
78
52
-1
-1
mystery x s = concat $ replicate (round (sqrt x)) s
rtoal/ple
haskell/mystery.hs
mit
58
0
10
17
32
15
17
2
1
module Main where {-# LANGUAGE ScopedTypeVariables #-} import Data.Maybe import Graphics.UI.WX hiding (Event) import Reactive.Banana import Reactive.Banana.WX import AI.HNN.FF.Network import Numeric.LinearAlgebra import Data.List.Split import Data.List (replicate) main :: IO () main = start gui gui :: IO () gu...
tomymehdi/ai-haskell
final/Experiments.hs
mit
2,998
10
16
807
1,075
531
544
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} module Main where import Protolude import Data.Sequence (Seq) import qualified Data.Sequence as S build :: Int -> Seq Int build n = S.fromList [1 .. n] part1 :: Int -> Int part1 = rec . build where rec xs | S.null xs = -1 | length xs <= 2 = S.index xs 0 | ...
genos/online_problems
advent_of_code_2016/day19/src/Main.hs
mit
1,030
0
12
380
412
207
205
35
1
-- The highest profit wins! -- http://www.codewars.com/kata/559590633066759614000063 module Codewars.Kata.MinMax where minMax :: (Ord a) => [a] -> (a, a) minMax xs = (minimum xs, maximum xs)
gafiatulin/codewars
src/7 kyu/MinMax.hs
mit
193
0
7
28
56
33
23
3
1
{-| Module : Data.Algorithm.PPattern Structription : Short Structription Copyright : (c) anonymous, 2016-1017, 2016-2017 License : MIT Maintainer : [email protected] Stability : experimental Pattern matching for Permutations. -} module Data.Algorithm.PPattern ( -- * Searching with default ConflictSel...
vialette/ppattern
src/Data/Algorithm/PPattern.hs
mit
4,246
0
9
700
548
305
243
40
1
{-#LANGUAGE DeriveDataTypeable #-} {-#LANGUAGE BangPatterns#-} module Control.Concurrent.HEP.Mailbox ( newMBox , sendMBox , receiveMBox , receiveMBoxAfter , receiveMBoxAfterTMVar )where import Control.Concurrent.HEP.Types import Control.Concurrent.STM import Control.Concurrent import Sys...
dambaev/hep
src/Control/Concurrent/HEP/Mailbox.hs
mit
1,081
0
11
221
333
168
165
28
1
import System.Random (randomRIO) import Control.Monad pick :: [a] -> IO a pick xs = randomRIO (0, length xs - 1) >>= return . (xs !!) firstPart :: [[Char]] firstPart = ["lazy", "stupid", "insecure", "idiotic", "slimy", "slutty", "smelly", "pompous", "communist", "dicknose", "pie-eating", "racist", "elitist", "trashy"...
Joss-Steward/Auto-Insulter
insultGenerator.hs
mit
1,022
0
11
159
379
223
156
19
1
{-# htermination min :: Float -> Float -> Float #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_min_6.hs
mit
52
0
2
10
3
2
1
1
0
module Compiler.Syntax.Type ( module Compiler.Syntax.Type.Position , module Compiler.Syntax.Type.Token ) where import Compiler.Syntax.Type.Position import Compiler.Syntax.Type.Token
banacorn/mini-pascal
src/Compiler/Syntax/Type.hs
mit
201
0
5
33
39
28
11
5
0
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE DeriveDataTypeable #-} module HsObjRaw (PolyObjCore(..), HsObj(..), objType, formObjOfType, formObjSimple, transformObjTypes, transformObjTypes', resolveToType, alig...
tbarnetlamb/hyphen
hyphen/lowlevel_src/HsObjRaw.hs
gpl-2.0
14,714
0
23
3,292
3,331
1,772
1,559
184
4
import Probability import Data.Frame generate size = do let w = [0.35, 0.4, 0.25] mu = [0.0, 2.0, 5.0] sigma = [0.5, 0.5, 1.0] xs <- iid size $ mixture w [ normal m s | (m,s) <- zip mu sigma ] return ["xs" %=% xs] main_generate = generate 1000 model xs = do let n_components = 3 w <- s...
bredelings/BAli-Phy
tests/prob_prog/examples.3/mixture_model/Main.hs
gpl-2.0
715
0
14
194
341
167
174
22
1
--------------------------------------------------------------------------- -- This file is part of grammata. -- -- grammata is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the Lice...
SRechenberger/grammata
src/Grammata/Language/Expression.hs
gpl-3.0
7,273
0
23
2,386
1,832
986
846
100
5
{-# LANGUAGE PatternGuards #-} {-# LANGUAGE QuasiQuotes #-} -- Copyright : (c) 2019 Robert Künnemann -- License : GPL v3 (see LICENSE) -- -- Maintainer : Robert Künnemann <[email protected]> -- Portability : GHC only -- -- Translation rules for local progress: processes must reduce unless they are of form !P o...
tamarin-prover/tamarin-prover
lib/sapic/src/Sapic/ProgressTranslation.hs
gpl-3.0
8,504
0
15
2,584
1,894
1,003
891
112
3
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-cloudwatch-logs/gen/Network/AWS/CloudWatchLogs/DeleteLogGroup.hs
mpl-2.0
3,002
0
9
640
345
210
135
47
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/RegionHealthChecks/List.hs
mpl-2.0
7,732
0
20
1,684
833
497
336
122
1
{-# LANGUAGE UndecidableInstances #-} module Monad.Ref ( MonadRef (..), modifyRef, RefT, runRefT ) where import Data.Functor ((<$>)) import Data.IORef (IORef, readIORef, writeIORef, newIORef) import Control.Monad.Trans.Reader (ReaderT, runReaderT) import Control.Monad.Lift.IO (MonadIO, liftIO) import Monad...
duncanburke/toliman-core
src/Monad/Ref.hs
mpl-2.0
930
0
9
204
406
220
186
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-compute/gen/Network/Google/Resource/Compute/HealthChecks/List.hs
mpl-2.0
6,626
0
18
1,464
678
409
269
96
1
module Network.HighHock.Registry ( Registry , newRegistry , applyContainer , insertContainer , removeContainer , removeMissingContainers , insertMissingContainers , removeStoppedContainers ) where import qualified Data.Map.Strict as M import qualified Data...
bluepeppers/highhockwho
src/Network/HighHock/Registry.hs
agpl-3.0
2,555
0
12
584
763
395
368
53
2
-- Implicit CAD. Copyright (C) 2011, Christopher Olah ([email protected]) -- Copyright (C) 2018, Julia Longtin ([email protected]) -- Released under the GNU AGPLV3+, see LICENSE -- be explicit about what we import. import Prelude (($), IO) -- our testing engine. import Test.Hspec(hspec, describe) -- the test forsta...
krakrjak/ImplicitCAD
tests/Main.hs
agpl-3.0
630
0
8
97
91
54
37
8
1
module OwnTypesClasses ( Point(..) -- We could also opt not to export any value constructors for Shape by just writing Shape in the export statement. -- That way, someone importing our module could only make shapes by using the auxilliary functions baseCircle and baseRect. -- Data.Map uses that approach...
mboogerd/hello-haskell
src/lyah/OwnTypesClasses.hs
apache-2.0
10,498
0
11
2,528
2,919
1,578
1,341
165
3
data ListItem a = Single a | Multiple Int a deriving (Show) decodeModified :: [ListItem a] -> [a] decodeModified [] = [] decodeModified (Single a : xs) = [a] ++ decodeModified xs decodeModified (Multiple n a : xs) = replicate n a ++ decodeModified xs
plilja/h99
p12.hs
apache-2.0
256
0
8
50
115
59
56
6
1
ans (t:n:_) | t == 1 = 6000 * n | t == 2 = 4000 * n | t == 3 = 3000 * n | t == 4 = 2000 * n main = do c <- getContents let i = map (map read) $ map words $ lines c :: [[Int]] o = map ans i mapM_ print o
a143753/AOJ
0277.hs
apache-2.0
227
0
14
86
156
74
82
10
1
{- Copyright 2010-2012 Cognimeta Inc. 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 writ...
Cognimeta/cognimeta-utils
src/Cgm/Data/Functor/Sum.hs
apache-2.0
796
0
9
152
66
41
25
6
0
module HaskHOL.Lib.IndDefs.PQ where import HaskHOL.Core import HaskHOL.Lib.IndDefs.Context -- Lift Parse Context and define quasi-quoter pcIndDefs :: ParseContext pcIndDefs = $(liftParseContext ctxtIndDefs) indDefs :: QuasiQuoter indDefs = baseQuoter ctxtIndDefs pcIndDefs
ecaustin/haskhol-deductive
src/HaskHOL/Lib/IndDefs/PQ.hs
bsd-2-clause
276
0
7
32
53
32
21
-1
-1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE ScopedTypeVariables #-} module RPG.Data.Gen.Portal ( portal ) where import Game.Sequoia.Color (yellow) import Game.Sequoia.Utils import RPG.Core import RPG.Scene portal :: ( Some r , Has (Loc -> IO ()) r , Has ((Pr...
isovector/rpg-gen
src/RPG/Data/Gen/Portal.hs
bsd-3-clause
1,302
0
18
473
496
245
251
37
1
{-# LANGUAGE NoMonomorphismRestriction #-} module Diagrams.Swimunit.Base where import Diagrams.Prelude import Diagrams.Backend.SVG.CmdLine import Diagrams.Swimunit.Dotmatrix loglevel :: Int loglevel = debugll {-| 0 Fatal 1 Error 2 Warning 3 Info 4 Debug 5 Trace -} debugll :: Int debugll = 4 errordot ...
wherkendell/diagrams-contrib
src/Diagrams/Swimunit/Base.hs
bsd-3-clause
1,110
0
11
293
161
89
72
25
1
{-# OPTIONS_GHC -Wall #-} {-# LANGUAGE OverloadedStrings #-} module Reporting.Warning where import Data.Aeson ((.=)) import qualified Data.Aeson as Json import qualified Text.PrettyPrint as P import Text.PrettyPrint ((<+>)) import qualified AST.Module as Module import qualified AST.Type as Type import qualified Nitpi...
johnpmayer/elm-compiler
src/Reporting/Warning.hs
bsd-3-clause
3,971
0
23
1,072
745
398
347
84
4
-- | General import procedure. module HN.Model.Import where import HN.Model.Feeds import HN.Model.Soup import HN.Monads import HN.System import Snap.App -- | Import ALL THE THINGS. importEverything :: Model c s () importEverything = void $ do io $ hSetBuffering stdout NoBuffering forM_ [(importRedditHaskell,"im...
jwaldmann/haskellnews
src/HN/Model/Import.hs
bsd-3-clause
1,161
0
17
258
287
172
115
30
2
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1993-1998 A ``lint'' pass to check for Core correctness -} {-# LANGUAGE CPP #-} module CoreLint ( lintCoreBindings, lintUnfolding, lintPassResult, lintInteractiveExpr, lintExpr, lintAnnots, -- ** Debug output ...
shlevy/ghc
compiler/coreSyn/CoreLint.hs
bsd-3-clause
100,043
361
21
28,972
19,709
10,343
9,366
-1
-1
{-| Module : Werewolf.Slack.Slack Copyright : (c) Henry J. Wylde, 2016 License : BSD3 Maintainer : [email protected] -} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} module Werewolf.Slack.Slack ( -- * Slack notify, ) where i...
hjwylde/werewolf-slack
app/Werewolf/Slack/Slack.hs
bsd-3-clause
1,124
0
11
268
266
142
124
24
1
module MidiRhythm.Midi ( toPresses, ) where import MidiRhythm.NotePress import qualified Sound.MIDI.File as MidiFile import qualified Sound.MIDI.Message.Channel as Channel import qualified Sound.MIDI.Message.Channel.Voice as Voice import qualified Sound.MIDI.File.Event as Event import Data.Foldable as Foldable i...
a10nik/midiRhythm
src/MidiRhythm/Midi.hs
bsd-3-clause
2,395
0
16
444
720
404
316
53
1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 Typechecking class declarations -} {-# LANGUAGE CPP #-} module TcClassDcl ( tcClassSigs, tcClassDecl2, findMethodBind, instantiateMethod, tcClassMinimalDef, Hs...
green-haskell/ghc
compiler/typecheck/TcClassDcl.hs
bsd-3-clause
16,471
0
22
5,331
2,806
1,472
1,334
198
3
{-| Module : Idris.IBC Description : Core representations and code to generate IBC files. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE TypeSynonymInstances #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} module Idris.IBC (loadIBC, loadPkgIndex, writeIBC,...
FranklinChen/Idris-dev
src/Idris/IBC.hs
bsd-3-clause
102,681
0
21
56,796
28,070
12,890
15,180
2,461
17
{-# LANGUAGE BangPatterns, DeriveFunctor #-} ----------------------------------------------------------------------------- -- | -- Module : Call.Data.Wave -- Copyright : (c) Fumiaki Kinoshita 2014 -- License : BSD3 -- -- Maintainer : Fumiaki Kinoshita <[email protected]> -- Stability : experimental...
fumieval/audiovisual
src/Data/Audio.hs
bsd-3-clause
1,573
0
17
323
472
254
218
36
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS -Wall #-} module Main (main) where import Control.Monad (foldM) import Control.Monad.Trans (liftIO, MonadIO) import qualified Data.ByteString.Char8 as C import Data.Attopars...
kfish/heapscope
tools/heapscope-zc.hs
bsd-3-clause
6,617
2
15
1,730
1,694
957
737
153
5
{-# LANGUAGE RecordWildCards #-} module Passman.Engine.KeyDerivation.PBKDF2 ( PBKDF2WithHmacSHA1(..) , PBKDF2WithHmacSHA256(..) ) where import Crypto.Hash.Algorithms (HashAlgorithm, SHA1(..), SHA256(..)) import Crypto.KDF.PBKDF2 import Data.Semigroup ...
chwthewke/passman-hs
src/Passman/Engine/KeyDerivation/PBKDF2.hs
bsd-3-clause
1,614
0
12
356
419
238
181
31
1
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} module System.Nemesis.Titan where import System.Nemesis.Env import System.Nemesis (Unit) import Air.Env hiding (mod) import Prelude () import Air.TH import Air.Data.Record.SimpleLabel (get, set, mod, label) import qualified Data.ByteString.Char8 as B im...
nfjinjing/nemesis-titan
src/System/Nemesis/Titan.hs
bsd-3-clause
10,337
15
22
2,476
2,149
1,096
1,053
236
3
import System.Random.Mersenne import qualified Data.Judy as J import Control.Monad data Nilsxp data SymSxp main = do g <- getStdGen rs <- randoms g j <- J.new :: IO (J.JudyL Int) forM_ (take 1000000 rs) $ \n -> J.insert n 1 j v <- J.findMax j case v of Nothing -> print "Done." ...
rosenbergdm/language-r
src/Language/R/sketches/judyex.hs
bsd-3-clause
349
1
11
106
152
74
78
-1
-1
module Data.Git.Common where import Bindings.Libgit2.Common import Data.Char pathListSeparator = chr c'GIT_PATH_LIST_SEPARATOR
iand675/hgit
Data/Git/Common.hs
bsd-3-clause
127
0
5
11
26
16
10
4
1
module Hydra.Utils.Impossible (impossible) where import qualified Language.Haskell.TH as TH impossible :: TH.ExpQ impossible = do loc <- TH.location let pos = (TH.loc_filename loc, fst (TH.loc_start loc), snd (TH.loc_start loc)) let message = "hydra: Impossbile happend at " ++ show pos return (TH.AppE (TH.Va...
giorgidze/Hydra
src/Hydra/Utils/Impossible.hs
bsd-3-clause
375
0
14
58
151
78
73
8
1
{-# LANGUAGE BangPatterns, FlexibleInstances, DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE PackageImports #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Main where import Data.Binary import qualified MinimalNN import System.Environment import System.FilePath import System.Directory import Text...
Tener/deeplearning-thesis
src/dbn-converter.hs
bsd-3-clause
1,467
0
14
332
387
210
177
41
2
{-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DeriveGeneric #-} -- | -- Module : P...
kadena-io/pact
src/Pact/Types/Capability.hs
bsd-3-clause
6,378
0
12
1,084
1,500
828
672
130
3
module Main where import City import Weather import Output import Model import Control.Monad main :: IO () main = do let towns = [Sydney .. Dubbo] ts <- timeSeries let stationData = map (makeStationData ts) towns mapM_ (mapM_ print) stationData
Michaelt293/TheWeather
app/Main.hs
bsd-3-clause
264
0
12
59
92
48
44
12
1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} module Main where import Data.PList.Binary import Test.Framework.TH import Test.Framework.Providers.QuickCheck2 import Test.QuickCheck import Data.DeriveTH import Test.QuickCheck.Instances import qualified Data.Vector as V import qualified Data.H...
tkonolige/haskell-bplist
test/properties.hs
bsd-3-clause
2,076
0
13
434
775
407
368
47
2
module OpenGL.Evaluator.GLFunction where import Data.Char (toUpper, toLower, isUpper, isNumber) import Data.List data TGLPrimitive = TGLbitfield | TGLboolean | TGLbyte | TGLchar | TGLclampf | TGLenum | TGLfloat ...
jfischoff/opengl-eval
src/OpenGL/Evaluator/GLFunction.hs
bsd-3-clause
2,573
0
11
895
778
430
348
64
3
module Type.PrettyPrint where import Text.PrettyPrint import qualified SourceSyntax.PrettyPrint as Src data ParensWhen = Fn | App | Never class PrettyType a where pretty :: ParensWhen -> a -> Doc commaSep docs = sep (punctuate comma docs) parensIf bool doc = if bool then parens doc else doc reprime = Src.repri...
deadfoxygrandpa/Elm
compiler/Type/PrettyPrint.hs
bsd-3-clause
322
0
8
58
101
56
45
9
2
module ExplainFolding where sum' :: [Integer] -> Integer sum'[] = 0 sum' (x:xs) = x + sum' xs length' :: [a] -> Integer length' [] = 0 length' (x:xs) = 1 + length' xs product' :: [Integer] -> Integer product' [] = 1 product' (x:xs) = x * product' xs concat' :: [[a]] -> [a] concat' [] = [] concat' (x:xs) = x ++ conc...
chengzh2008/hpffp
src/ch10-FoldingList/explainFolding.hs
bsd-3-clause
1,641
0
8
321
434
240
194
26
1
{-# LANGUAGE CPP #-} {-# LANGUAGE NoImplicitPrelude #-} -- | -- Module: $HEADER$ -- Description: Support for hidden exceptions. -- Copyright: (c) 2009-2016, Peter Trško -- License: BSD3 -- -- Stability: provisional -- Portability: non-portable (CPP, NoImplicitPrelude, depends on non-portable -- ...
trskop/tagged-exception-core
src/Control/Monad/TaggedException/Hidden.hs
bsd-3-clause
5,758
0
9
1,151
714
430
284
78
1
module Events.Keybindings ( defaultBindings , lookupKeybinding , getFirstDefaultBinding , mkKb , staticKb , mkKeybindings , handleKeyboardEvent -- Re-exports: , Keybinding (..) , KeyEvent (..) , KeyConfig , allEvents , parseBinding , keyEventName , keyEventFromName ) where import ...
aisamanra/matterhorn
src/Events/Keybindings.hs
bsd-3-clause
4,664
0
13
1,331
1,494
775
719
107
39
module IOChoiceSpec where import Control.Exception import Control.Exception.IOChoice import System.IO.Error import Test.Hspec spec :: Spec spec = describe "||>" $ do it "selects IO" $ do good ||> bad `shouldReturn` "good" bad ||> good `shouldReturn` "good" it "throws an error if all choices fa...
kazu-yamamoto/io-choice
test/IOChoiceSpec.hs
bsd-3-clause
772
0
13
173
216
111
105
24
1
module Text.HTML.Moe2.Type where import Data.Default import Control.Monad.Writer import Text.HTML.Moe2.Utils import Data.DList (DList) data Element = Element { name :: Internal , elements :: [Element] , attributes :: [Attribute] , indent :: Bool , self_close :: Bool } ...
nfjinjing/moe
src/Text/HTML/Moe2/Type.hs
bsd-3-clause
1,005
0
9
264
258
159
99
35
0
{-# LANGUAGE MultiParamTypeClasses, TypeFamilies, FlexibleContexts, FlexibleInstances, RankNTypes, MagicHash, UnboxedTuples #-} {-# OPTIONS_HADDOCK hide #-} {-# OPTIONS_GHC -fno-warn-orphans -fno-warn-name-shadowing -fno-warn-unused-binds #-} module Data.PhaseChange.Instances () where import Data.PhaseChange.Intern...
glaebhoerl/phasechange
Data/PhaseChange/Instances.hs
bsd-3-clause
6,143
0
12
1,376
1,769
932
837
89
1
{-# LANGUAGE FlexibleContexts #-} ----------------------------------------------------------------------------- -- | -- Module : MuTerm.Framework.Strategy -- Copyright : (c) muterm development team -- License : see LICENSE -- -- Maintainer : [email protected] -- Stability : unstable -- Portabil...
pepeiborra/muterm-framework
MuTerm/Framework/Strategy.hs
bsd-3-clause
3,609
0
15
759
1,060
574
486
55
3
module Utils where import Data.List import Data.Array mkPseudoImage size = let ps = generateCirclePoints (size `quot` 2, size `quot`2) (size `quot` 4) in listArray ((0,0),(size-1,size-1)) [if (x,y) `elem` ps then 255 else 0 | x <- [0..size-1], y <- [0..size-1]] type Point = (Int, Int) -- Takes the ce...
zelinskiy/ImRec
src/Utils.hs
bsd-3-clause
1,331
0
12
501
571
330
241
22
2
{-# LANGUAGE OverloadedStrings #-} module Web.Spock.Internal.Util where import Data.Maybe import Network.HTTP.Types import Network.Wai.Internal import qualified Data.Text as T import qualified Data.HashMap.Strict as HM data ClientPreferredFormat = PrefJSON | PrefXML | PrefHTML | PrefText | PrefUnknown ...
nmk/Spock
src/Web/Spock/Internal/Util.hs
bsd-3-clause
1,450
0
13
300
453
251
202
40
4
module Util ( CInt (..) , CString , CStringLen , withCString , withCStringLen , peekCStringLen ) where import Foreign.C (CInt (..), CString, CStringLen) import System.IO (utf8) import qualified GHC.Foreign as GHC withCStringLen :: String -> (CStringLen -> IO a) -> IO a withCStringLen s f = GHC.w...
sol/v8
src/Util.hs
mit
526
0
9
107
183
101
82
16
1
{-# LANGUAGE BangPatterns #-} module Lib.Directory ( getMFileStatus , catchDoesNotExist , removeFileOrDirectory , removeFileOrDirectoryOrNothing , createDirectories , getDirectoryContents , getDirectoryContentsHash , makeAbsolutePath ) where import qualified Control.Exception as E import Co...
buildsome/buildsome
src/Lib/Directory.hs
gpl-2.0
3,266
0
14
640
906
462
444
80
2
----------------------------------------------------------------------------- -- | -- Module : Text.Parsec.Language -- Copyright : (c) Daan Leijen 1999-2001, (c) Paolo Martini 2007 -- License : BSD-style (see the LICENSE file) -- -- Maintainer : [email protected] -- Stability : provisional --...
antarestrader/sapphire
Text/Parsec/Language.hs
gpl-3.0
5,121
36
8
1,496
686
431
255
72
1
{-# LANGUAGE FlexibleInstances, IncoherentInstances #-} module Test.QuickFuzz.Gen.Base.String where import Test.QuickCheck import qualified Data.Text as TS import qualified Data.Text.Lazy as TL import Test.QuickFuzz.Gen.Base.Value -- String instance Arbitrary String where arbitrary = genStrValue "String" -- Te...
elopez/QuickFuzz
src/Test/QuickFuzz/Gen/Base/String.hs
gpl-3.0
740
0
10
124
198
110
88
18
0
{-| Module : Matchers License : GPL Maintainer : [email protected] Stability : experimental Portability : portable Matching expressions (directives based on "Scripting the Type Inference Process", ICFP 2003) -} module Helium.StaticAnalysis.Directives.Matchers where import Helium...
roberth/uu-helium
src/Helium/StaticAnalysis/Directives/Matchers.hs
gpl-3.0
5,432
0
11
1,562
1,321
672
649
114
2
main :: Bool -> Bool -> () main True = const ()
roberth/uu-helium
test/staticwarnings/Missing7.hs
gpl-3.0
49
0
7
13
29
14
15
2
1
{-# 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-sns/gen/Network/AWS/SNS/Subscribe.hs
mpl-2.0
5,859
0
13
1,277
730
448
282
89
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude, MagicHash, ImplicitParams #-} {-# LANGUAGE RankNTypes #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Err -- Copyright : (c) The University of Glasgow, 1994-2002 -- ...
rahulmutt/ghcvm
libraries/base/GHC/Err.hs
bsd-3-clause
3,497
0
7
630
214
149
65
19
1
{-# LANGUAGE Haskell2010 #-} {-# LINE 1 "Network/HPACK/Huffman/Tree.hs" #-} {-# LANGUAGE BangPatterns #-} module Network.HPACK.Huffman.Tree ( -- * Huffman decoding HTree(..) , eosInfo , toHTree , showTree , printTree , flatten ) where import Control.Arrow (second) import Data.List (partition) import...
phischu/fragnix
tests/packages/scotty/Network.HPACK.Huffman.Tree.hs
bsd-3-clause
2,516
0
13
753
849
453
396
64
1
module PackageTests.TestStanza.Check where import Test.HUnit import System.FilePath import PackageTests.PackageTester import Distribution.Version import Distribution.PackageDescription.Parse (readPackageDescription) import Distribution.PackageDescription.Configuration (finalizePackageDescription) import Distributi...
jwiegley/ghc-release
libraries/Cabal/cabal/tests/PackageTests/TestStanza/Check.hs
gpl-3.0
2,025
0
20
529
483
267
216
40
2
{-# LANGUAGE GADTs #-} {-# LANGUAGE ImpredicativeTypes #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ViewPatterns #-} -- | -- Module : Data.Array.Accelerate.CUDA.CodeGen.Inde...
mwu-tow/accelerate-cuda
Data/Array/Accelerate/CUDA/CodeGen/IndexSpace.hs
bsd-3-clause
10,838
0
15
3,776
1,351
794
557
83
2
-------------------------------------------------------------------- -- | -- Module : Text.DublinCore.Types -- Copyright : (c) Galois, Inc. 2008, -- (c) Sigbjorn Finne 2009- -- License : BSD3 -- -- Maintainer: Sigbjorn Finne <[email protected]> -- Stability : provisional -- -- Representing the DublinCore ...
danfran/feed
src/Text/DublinCore/Types.hs
bsd-3-clause
2,905
0
8
736
314
195
119
60
16
{- | Module : StringUtils Description : Utilities for string operations. Copyright : (c) 2014—2015 The F2J Project Developers (given in AUTHORS.txt) License : BSD3 Maintainer : Zhiyuan Shi <[email protected]> Stability : experimental Portability : portable -} module StringUtils ( capitalize...
bixuanzju/fcore
lib/StringUtils.hs
bsd-2-clause
470
0
7
94
64
37
27
6
1
-- (c) The University of Glasgow 2006 {-# LANGUAGE CPP, FlexibleInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- instance MonadThings is necessarily an orphan module TcEnv( TyThing(..), TcTyThing(..), TcId, -- Instance environment, and InstInfo type InstInfo(..), iDFunId, pprInstInfoDe...
forked-upstream-packages-for-ghcjs/ghc
compiler/typecheck/TcEnv.hs
bsd-3-clause
37,248
6
18
10,523
6,392
3,367
3,025
482
6
module Type5 where data Data = C1 Int Char | C2 Int | C3 Float errorData field dat function = errorData ("the binding for " ++ field ++ " in a pattern binding involving " ++ dat ++ " has been removed in function " ++ function) f :: Data -> Data -> a f (C1 b c) (C1 b1 b2) = errorData "a1" "C1" "f"...
kmate/HaRe
old/testing/removeField/Type5_TokOut.hs
bsd-3-clause
404
0
11
125
174
90
84
-1
-1
{-# LANGUAGE TypeFamilies, ExplicitForAll #-} module T15828 where class C a where type T a b instance C (Maybe a) where type forall a b. T (Maybe a) b = b
sdiehl/ghc
testsuite/tests/rename/should_fail/T15828.hs
bsd-3-clause
162
1
10
38
63
32
31
-1
-1
----------------------------------------------------------------------------- -- | -- Module : XMonad.Actions.ConstrainedResize -- Copyright : (c) Dougal Stanton -- License : BSD3-style (see LICENSE) -- -- Maintainer : <[email protected]> -- Stability : stable -- Portability : unportable -- -...
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Actions/ConstrainedResize.hs
bsd-2-clause
2,112
0
20
491
321
179
142
16
2
{-# LANGUAGE OverloadedStrings #-} module BadWarning where data MyString = MyString String f1 (MyString "a") = undefined f1 (MyString "bb") = undefined f1 _ = undefined f2 (MyString "aa") = undefined f2 (MyString "bb") = undefined f2 _ = undefined -- Genuine overlap here! f3(MyString ('a':_)) = undefi...
urbanslug/ghc
testsuite/tests/deSugar/should_compile/T5117.hs
bsd-3-clause
374
0
9
78
130
68
62
12
1
{-# LANGUAGE TypeFamilies, ScopedTypeVariables#-} module T3220 where class Foo m where type Bar m :: * action :: m -> Bar m -> m right x m = action m (Right x) right' :: (Either a b ~ Bar m, Foo m) => b -> m -> m right' x m = action m (Right x) instance Foo Int where type Bar Int = Either Int Int a...
urbanslug/ghc
testsuite/tests/indexed-types/should_compile/T3220.hs
bsd-3-clause
537
0
9
144
259
138
121
16
1
module GitHub.Gists where import GitHub.Internal gists = "/gists" public = gists <> "/public" starred = gists <> "/starred" gist i = gists <> "/" <> i star i = gists i <> "/star" forks i = gists i <> "/forks" --| GET /users/:user/gists listUserGists :: UserName -> GitHub GistsData listUserGists u = ghGet (user u <>...
SaneApp/github-api
src/GitHub/Gists.hs
mit
1,358
44
9
239
606
301
305
-1
-1
module Shadowing where bindExp1 :: Integer -> String bindExp1 x = let z = 10; y = 5 in "the integer was: " ++ show x ++ " and y was: " ++ show y bindExp2 :: Integer -> String bindExp2 x = let x = 10; y = 5 in "the integer was: " ++ show x ++ " and y was: "...
Lyapunov/haskell-programming-from-first-principles
chapter_7/shadowing.hs
mit
462
0
11
167
161
81
80
13
1
{-# LANGUAGE DeriveGeneric #-} module Player (Player(White, Black), next) where import Data.Aeson import GHC.Generics -- Player & Related Functions-- data Player = White | Black deriving (Eq, Show, Read, Ord, Bounded, Enum, Generic) instance FromJSON Player instance ToJSON Player next :: Player -> Player next ...
danmane/abalone
unsupported/hs/src/player.hs
mit
352
2
6
60
113
63
50
14
1
{-# LANGUAGE DeriveDataTypeable #-} module Haskakafka.InternalTypes where import Control.Exception import Data.Int import Data.Typeable import Haskakafka.InternalRdKafka import Haskakafka.InternalRdKafkaEnum import qualified Data.ByteString as BS -- ...
cosbynator/haskakafka
src/Haskakafka/InternalTypes.hs
mit
5,497
0
10
1,318
745
447
298
99
0