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 Foo where bar = 0 {-@ assume (Prelude.++) :: [a] -> [a] -> [a] @-}
ssaavedra/liquidhaskell
tests/pos/Foo.hs
bsd-3-clause
77
0
4
19
10
7
3
2
1
{-# LANGUAGE CPP, RecordWildCards, FlexibleInstances, MultiParamTypeClasses #-} -- | -- Package configuration information: essentially the interface to Cabal, with -- some utilities -- -- (c) The University of Glasgow, 2004 -- module PackageConfig ( -- $package_naming -- * UnitId packageConfig...
shlevy/ghc
compiler/main/PackageConfig.hs
bsd-3-clause
5,640
0
11
1,347
1,083
571
512
96
2
module Main where import System.Directory import System.Environment main :: IO () main = do (source:target:_) <- getArgs copyFile source target
mydaum/cabal
cabal-testsuite/PackageTests/CustomPreProcess/MyCustomPreprocessor.hs
bsd-3-clause
150
0
10
26
55
29
26
7
1
{-# LANGUAGE Unsafe #-} {-# LANGUAGE ExistentialQuantification, NoImplicitPrelude #-} module GHC.Event.Internal ( -- * Event back end Backend , backend , delete , poll , modifyFd , modifyFdOnce -- * Event type , Event , evtRead , evtWrite , evtClose , eventIs ...
tolysz/prepare-ghcjs
spec-lts8/base/GHC/Event/Internal.hs
bsd-3-clause
6,288
0
16
1,779
1,392
773
619
138
3
{-# LANGUAGE BangPatterns, FlexibleContexts #-} module Main where import Data.Array.Base (unsafeRead, unsafeWrite) import Data.Array.ST import Data.Array.Unboxed import Control.Monad.ST main = print (divisorCounts 1000000 ! 342) isqrt :: Int -> Int isqrt n = floor (sqrt $ fromIntegral n) divisorCounts :: Int -> UAr...
urbanslug/ghc
testsuite/tests/perf/should_run/T5113.hs
bsd-3-clause
841
4
17
289
281
151
130
27
1
sumList :: [Integer]-> Integer sumList []=0 sumList (x:xs) = x+ sum xs main=print(sumList [1,2,3,9])
manuchandel/Academics
Principles-Of-Programming-Languages/sumList.hs
mit
102
0
8
15
71
38
33
4
1
module Main where import System.Environment import qualified Language.Haskell.Exts.Annotated.Syntax import qualified Language.Haskell.Exts.Syntax import DeriveTemplate import Control.Arrow import Control.Applicative import Data.Functor import Data.Monoid $(deriveDesugarTemplate "genNormal" "Language.Haskell.Exts.Synt...
CindyLinz/Haskell.js
trans/desugar-template-src/Main.hs
mit
813
0
18
113
182
98
84
-1
-1
module MemoryManager.Util where import MemoryManager.Types checkAddress :: [MemorySource] -> Int -> MemorySource checkAddress sources addr = case (filter containsAddr sources) of [] -> error ("address unknown: " ++ show addr) (x:_) -> x where containsAddr (MemorySource base sc _) = base <= addr...
christiaanb/SoOSiM
examples/MemoryManager/Util.hs
mit
334
0
11
72
115
60
55
10
2
-- Haskell version of https://gcc.gnu.org/onlinedocs/jit/intro/tutorial02.html {-# LANGUAGE OverloadedStrings #-} module Main where import Compiler.GCC.JIT import Foreign.Ptr import Foreign.C.Types import Control.Monad.IO.Class (liftIO) type FnType = CInt -> IO CInt foreign import ccall "dynamic" mkFun :: FunPt...
Slowki/hgccjit
example/Tutorial2.hs
mit
926
0
16
215
268
131
137
27
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.TrackEvent (js_getTrack, getTrack, TrackEvent, castToTrackEvent, gTypeTrackEvent) where import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral,...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/TrackEvent.hs
mit
1,313
6
10
151
371
236
135
22
1
module Map where import Data.Char square :: [Double] -> [Double] square (x:xs) = x * x : square xs square [] = [] square' :: [Double] -> [Double] square' xs = map squareOne xs where squareOne x = x * x upperCase :: String -> String upperCase (x:xs) = toUpper x : upperCase xs upperCase [] ...
bionikspoon/playing-with-haskell---oreilly
ch04/Map.hs
mit
417
0
7
128
217
114
103
14
1
{-| Agda main module. -} module Agda.Main where import Control.Monad.State import Data.Maybe import System.Environment import System.Console.GetOpt import Agda.Interaction.CommandLine import Agda.Interaction.ExitCode (AgdaError(..), exitSuccess, exitAgdaWith) import Agda.Interaction.Options import Agda.Interaction....
kucherenko/jscpd
fixtures/haskell/file2.hs
mit
6,894
0
25
1,778
1,684
865
819
132
6
module ProjectEuler.Problem144 ( problem ) where import Data.List import Petbox import ProjectEuler.Types problem :: Problem problem = pureProblem 144 Solved result {- Idea: Let's first work out some formulas that might become necessary. - Given a point (x_0, y_0) on the ellipse, we should be able to fi...
Javran/Project-Euler
src/ProjectEuler/Problem144.hs
mit
5,997
0
16
1,305
758
429
329
47
2
{-# LANGUAGE DeriveDataTypeable #-} {- | Module : ./OWL2/MS.hs Copyright : (c) Felix Gabriel Mance License : GPLv2 or higher, see LICENSE.txt Maintainer : f.mance@jacobs-university.de Stability : provisional Portability : portable Datatypes specific to the Manchester Syntax of OWL 2 References :...
spechub/Hets
OWL2/MS.hs
gpl-2.0
8,327
0
15
1,356
2,471
1,245
1,226
161
11
module Network.Gitit2.Handler.Diff ( getDiffR ) where import Control.Exception (catch, throw) import Data.FileStore (diff, RevisionId) import qualified Data.FileStore as FS import Data.List (intercalate) import Network.Gitit2.Import import Network.Gitit2.Page (path...
thkoch2001/gitit2
Network/Gitit2/Handler/Diff.hs
gpl-2.0
1,322
0
15
468
276
148
128
-1
-1
module Language.Haskell.HsColour.ColourHighlight ( Colour(..) , Highlight(..) , base256, unbase , rgb24bit_to_xterm256 , projectToBasicColour8 , hlProjectToBasicColour8 ) where {-@ LIQUID "--totality" @-} import Data.Word -- | Colours supported by ANSI codes. data Colour = Black | Red | Green | Yello...
nikivazou/hscolour
Language/Haskell/HsColour/ColourHighlight.hs
gpl-2.0
3,704
0
12
989
836
447
389
66
1
{- | Module : $Header$ Description : Interface to the CspCASLProver (Isabelle based) theorem prover Copyright : (c) Liam O'Reilly and Markus Roggenbach, Swansea University 2009 License : GPLv2 or higher, see LICENSE.txt Maintainer : csliam@swansea.ac.uk Stability : provisional Portability : portab...
nevrenato/HetsAlloy
CspCASLProver/CspCASLProver.hs
gpl-2.0
9,414
0
17
2,421
1,378
725
653
116
3
------------------------------------------------------------------------------ -- A simple banner program: Mark P Jones, 1992 -- -- Many years ago, I was helping out on a stand at a computer show. -- Or at least, I would have been if anyone had been interested in -- what we had on the stand....
gennady-em/haskel
src/D_Say.hs
gpl-2.0
5,046
0
12
1,907
1,209
766
443
61
1
{-# LANGUAGE CPP, OverloadedStrings #-} module Buildsome.Chart ( make ) where import Buildsome.Stats (Stats(..)) import Data.ByteString (ByteString) import Data.Map (Map) import Data.Monoid ((<>)) import Lib.FilePath (FilePath) import Prelude hiding (FilePath) import qualified Buildsome.BuildMaps as BuildMaps impo...
nadavshemer/buildsome
src/Buildsome/Chart.hs
gpl-2.0
3,203
0
16
667
941
508
433
60
1
module H.Data where import Control.Applicative import qualified Data.List as L import qualified Data.Text as T import qualified Data.Text.Lazy as LT import Data.Text.Lazy.Builder (toLazyText) import Data.Text.Format (left) import Data.Text.Buildable (Buildable) import Data.Time import Test.QuickCheck data Task = Task...
josuf107/H
H/Data.hs
gpl-2.0
3,737
0
17
952
1,412
762
650
104
1
{-#LANGUAGE BangPatterns #-} {- Enumerate all closed Knight's Tours in an arbitrarity sized chessboard. Multi-threaded version. Usage: KnightTours m n +RTS -N Compile with: ghc -O3 -threaded -rtsopts -fllvm --make KnightTours Examples: A small example is the 3x12 board Author: Jyotirmoy Bhattacharya (...
jmoy/knights_tours
haskell/KnightTours.hs
gpl-3.0
4,283
0
21
1,236
1,492
789
703
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} module IniParser where import Control.Applicative import Data.ByteString (ByteString) import Data.Map (Map) import qualified Data.Map as M import Text.RawString.QQ import Text.Trifecta -- INI File Format -- # comment -- ; comment -- [section] -- host=w...
nirvinm/Solving-Exercises-in-Haskell-Programming-From-First-Principles
ParserCombinators/src/IniParser.hs
gpl-3.0
2,434
0
11
515
636
334
302
79
1
module ClanFetcher( Clan(..), TagExpr, ClanID, matchTagExpr, prettyTagExpr, tagExprGet, getClanList, clanListFromCache , matchClanByID ) where import Prelude as P import Control.Applicative import Control.Exception import Control.Monad import Data.ByteString.Char8 as B import Data.ByteString.Lazy.Char8 as L import D...
Cadynum/Apelsin
src/ClanFetcher.hs
gpl-3.0
3,774
65
18
757
1,617
824
793
-1
-1
{-# LANGUAGE OverloadedStrings #-} module System.DevUtils.Base.Cloud.Amazon.RDS ( RDS (..), RDSRoot (..), RDSConfig (..), RDSRegion (..), RDSTypes (..), RDSTiers (..) ) where import System.DevUtils.Base.Cloud.Amazon.Misc import System.DevUtils.Base.Currency import Data.Aeson import Control.Applicative import Co...
adarqui/DevUtils-Base
src/System/DevUtils/Base/Cloud/Amazon/RDS.hs
gpl-3.0
1,403
1
9
266
482
275
207
55
0
{- - Copyright (c) 2010, Terrence Cole. - - This file is part of Trash, Terrence's Re-Bourne Again SHell. - - Trash is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or -...
terrence2/trash
src/JobControl.hs
gpl-3.0
5,715
0
15
1,381
1,243
618
625
86
6
module Main where okVal :: Int okVal = 23 main :: IO () main = putStrLn "I have {okVal} apples."
scvalex/interpol
Test/One.hs
gpl-3.0
99
0
6
22
32
18
14
5
1
{- | Functions for exporting Jammit audio (as WAV) and sheet music (as PDF). -} module Sound.Jammit.Export ( Library , fuzzySearchBy , exactSearchBy , loadLibrary , getAudioParts , getSheetParts , audioSource , runAudio , runSheet ) where import Control.Applicative (liftA2) import Control.Monad (forM) import Data.Char...
michelshalom/jammittools
src/Sound/Jammit/Export.hs
gpl-3.0
4,827
0
19
1,063
1,507
814
693
97
7
-- Author: Stefan Eng -- License: GPL v3 -- File: xmonad.hs -- Description: -- Xmonad window manager configuration file. import XMonad import XMonad.Hooks.ManageDocks import XMonad.Hooks.DynamicLog import XMonad.Util.Run (spawnPipe, hPutStrLn) import XMonad.Util.Cursor (setDefaultCursor, xC_left_ptr) main = d...
stefaneng/dotfiles
haskell/xmonad/xmonad.hs
gpl-3.0
1,519
0
13
354
217
131
86
26
1
module Language.SMTLib2.Composite.Lens where import Language.SMTLib2 import Language.SMTLib2.Internals.Embed import qualified Data.Traversable as T import Control.Monad import Data.Functor.Constant import Control.Lens import Data.GADT.Compare import Control.Applicative import Data.Functor.Identity type LensM m s t ...
hguenther/smtlib2
extras/composite/Language/SMTLib2/Composite/Lens.hs
gpl-3.0
2,443
0
12
769
1,230
627
603
-1
-1
module TM.Formatter ( paint, srnd, formatTask, printTaskTree ) where import TM.Task import TM.Time (timeAgoUTC) import TM.Util (splitBy) import Data.Time.Clock.POSIX (POSIXTime) colors :: [(String, String)] colors = [ ("red", "\x1b[1;91m") , ("green", "\x1B[1;92m") , ("yellow", "\x1b[...
evgenim/tm
src/TM/Formatter.hs
gpl-3.0
3,080
0
13
871
1,252
670
582
75
2
{-# OPTIONS_GHC -F -pgmF htfpp #-} module Test.HTCF.ArrowXml where import Test.Framework import Text.XML.HXT.Core import HTCF.ArrowXml fileA = "testsuite/Test/HTCF/file-a.xml" test_nameIn = do results <- runX (readDocument [withValidate no] fileA >>> getChildren >>> isElem ...
lueck/htcf
testsuite/Test/HTCF/ArrowXml.hs
gpl-3.0
5,165
0
24
2,033
843
431
412
135
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-maps-engine/gen/Network/Google/Resource/MapsEngine/Rasters/Process.hs
mpl-2.0
2,611
0
13
619
303
186
117
48
1
module Fibonacci where fibonacci :: Int -> [Int] fibonacci 0 = [0, 0] fibonacci 1 = [1, 0] fibonacci 2 = [1, 1] fibonacci 3 = [2, 1] fibonacci n = [sum m, m !! 0] where m = fibonacci (n - 1) -- fib :: Int -> Int fib n|n >= 0 || (mod n 2) == 0 = fibonacci n !! 0 |otherwise = 0 - (fibonacc...
ice1000/OI-codes
codewars/101-200/fibonacci.hs
agpl-3.0
339
0
11
107
192
103
89
11
1
{-# LANGUAGE TypeFamilies #-} module Math.Topology.KnotTh.Invariants.HomflyPolynomial ( homflyPolynomial , minimalHomflyPolynomial ) where import Math.Topology.KnotTh.Invariants.Util.Poly import Math.Topology.KnotTh.Tangle class (Knotted k) => KnottedWithHomflyPolynomial k where type HomflyPolynomial...
mishun/tangles
src/Math/Topology/KnotTh/Invariants/HomflyPolynomial.hs
lgpl-3.0
680
0
8
109
122
70
52
14
0
module Main where import Lib import Text.Printf (printf) main :: IO () main = do putStr "Verifying Sum is a valid Functor and Applicative" verifySumIsFunctor verifySumIsApplicative putStr "\nVerifying Validation is a valid Functor and Applicative" verifyValidationIsFunctor verifyValidationIsApplicative
dmp1ce/Haskell-Programming-Exercises
Chapter 17/VariationsOnEither/app/Main.hs
unlicense
319
0
7
52
56
27
29
11
1
{- Data types exported by CCS -} module Language.CCS.Data where import Data.Hashable import qualified Data.HashSet as HS import qualified Data.HashMap.Strict as HM newtype CLib = CLib String deriving (Ord, Eq, Show) newtype CInclude = CInclude String deriving (Ord, Eq, Show) data Comp...
kapilash/ccs2cs
src/Language/CCS/Data.hs
apache-2.0
3,313
0
9
1,177
924
515
409
84
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Openshift.V1.GlusterfsVolumeSource where import GHC.Generics import Data.Text import qualified Data.Aeson -- | GlusterfsVolumeSource represent...
minhdoboi/deprecated-openshift-haskell-api
openshift/lib/Openshift/V1/GlusterfsVolumeSource.hs
apache-2.0
1,104
0
9
141
97
60
37
16
0
module Problem068 where import Data.List main = print $ join $ maximum $ filter (\s -> length (join s) == 16) $ filter check cs where cs = map (6:) $ permutations $ [1..5] ++ [7..10] join as = let (os, ps) = halve as in concat $ zipWith3 (\a b c -> show a ++ show b ++ show c) os ps (tail (cycle ps)) c...
vasily-kartashov/playground
euler/problem-068.hs
apache-2.0
540
0
13
154
330
168
162
12
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoMonomorphismRestriction, FlexibleInstances #-} -- * Demonstrating `non-compositional', context-sensitive processing -- * The final style module PushNegF where import Intro2 hiding (main) -- When I first mentioned the initial and final styles in passing -- in July 20...
egaburov/funstuff
Haskell/tytag/codes/PushNegF.hs
apache-2.0
2,792
0
9
594
380
207
173
32
4
{- Copyright 2014 Matthew Gordon. 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 writing, softwar...
matthewscottgordon/funk
src/Funk/Module.hs
apache-2.0
3,853
0
12
805
776
412
364
45
2
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QAbstractFileEngine.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:36 Warning : this file is machine generate...
uduki/hsQt
Qtc/Enums/Core/QAbstractFileEngine.hs
bsd-2-clause
15,097
0
18
3,213
4,102
2,092
2,010
432
1
-- Code for reading and writing reference counts. module Database.VCache.Refct ( readRefctBytes , toRefctBytes , writeRefctBytes , Refct ) where import Control.Exception import Data.Word import Data.Bits import Foreign.Ptr import Foreign.Storable import Database.LMDB.Raw type Refct = Int -- simp...
dmbarbour/haskell-vcache
hsrc_lib/Database/VCache/Refct.hs
bsd-2-clause
1,409
0
14
324
428
231
197
28
2
module Language.Drasil.HTML.Helpers where import Prelude hiding ((<>)) import Text.PrettyPrint (Doc, text, empty, ($$), (<>), (<+>), vcat, hcat, nest, cat, hcat) import Data.List (intersperse, foldl1) import Language.Drasil hiding (Expr) --import Language.Drasil.Document (Document, MaxWidthPercent) import Language...
JacquesCarette/literate-scientific-software
code/drasil-printers/Language/Drasil/HTML/Helpers.hs
bsd-2-clause
5,232
0
15
1,319
1,711
936
775
93
1
module ProjectEuler.Problem004 (solution004) where import Data.Digits import Data.List import Util solution004 :: Integer solution004 = last $ filter (isPalindrome . digits 10) $ sort [ x * y | x <- [100..999], y <- [x..999]]
guillaume-nargeot/project-euler-haskell
src/ProjectEuler/Problem004.hs
bsd-3-clause
228
0
10
37
91
50
41
6
1
{-# LANGUAGE OverloadedStrings #-} module Website.Template ( TemplateToken(..), wrapTemplate, PartialToken ) where import Text.Blaze.Html5 hiding (map) import Text.Blaze.Html5.Attributes hiding (id) import qualified Text.Blaze.Html5 as H import qualified Text.Blaze.Html5.Attributes as A import GameData import D...
TheGreenMachine/Scouting-Backend
src/Website/Template.hs
bsd-3-clause
2,147
0
9
509
183
127
56
23
1
{-| Module : Cache Description : Caching library used by AriaDB License : BSD3 Maintainer : abhi.iitk16@gmail.com Stability : experimental This cache library exports 3 functions get, upsert and delete that is used by AriaDB for faster reads. This library uses LRU cache library which handles all these three...
proneetv/ariaDB
src/Service/Cache.hs
bsd-3-clause
4,368
0
19
1,069
775
389
386
57
3
-- 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. module Duckling.V...
rfranek/duckling
tests/Duckling/Volume/ES/Tests.hs
bsd-3-clause
597
0
9
96
80
51
29
11
1
module Data.Geo.GPX.Lens.MaxlonL where import Data.Geo.GPX.Type.Longitude import Data.Lens.Common class MaxlonL a where maxlonL :: Lens a Longitude
tonymorris/geo-gpx
src/Data/Geo/GPX/Lens/MaxlonL.hs
bsd-3-clause
153
0
7
21
42
26
16
5
0
{-# LANGUAGE CPP #-} module SAWScript.AutoMatch.ArgMapping ( ArgMapping , typeBins , nameLocs , makeArgMapping , removeName , lookupName , lookupType , emptyArgMapping , isEmptyArgMapping ) where import qualified Data.Map as Map import Data.Map (Map) import qualified Data.Set as Set impo...
GaloisInc/saw-script
src/SAWScript/AutoMatch/ArgMapping.hs
bsd-3-clause
2,381
0
18
542
651
360
291
51
1
data LL a = Nil | Cons (LL a) a instance Show a => Show (LL a) where showsPrec _ (Cons lst x) = ("Cons (" ++) . showsPrec 11 lst . (") " ++) . showsPrec 11 x showsPrec _ Nil = ("Nil" ++)
YoshikuniJujo/funpaala
samples/27_basic_type_classes/leftList1.hs
bsd-3-clause
192
2
9
50
107
56
51
5
0
module BrownPLT.JavaScript.Environment ( env , localVars , EnvTree (..) ) where import Data.List import Data.Maybe import qualified Data.Map as M import Data.Map (Map) import qualified Data.Set as S import Data.Set (Set) import Text.ParserCombinators.Parsec.Pos (SourcePos) import BrownPLT.JavaScript.Syntax -...
ducis/flapjax-fixed
WebBits-1.0/src/BrownPLT/JavaScript/Environment.hs
bsd-3-clause
5,472
0
14
1,179
2,091
1,033
1,058
117
22
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - USAGE: hooty (-1|-4)? (-n <number to make>)? The `hooty` program generates any number of UUIDs (one by default), using either the version 1 (time and MAC) or version 4 (random) algorithm (version 1 is the default). On all platforms,...
solidsnack/system-uuid
Main.hs
bsd-3-clause
3,529
1
12
1,492
780
393
387
77
3
module Main where import qualified EFA.Application.Plot as PlotIO import qualified EFA.IO.TableParser as Table import qualified EFA.Signal.Signal as S import qualified EFA.Signal.ConvertTable as CT import EFA.Utility.Map (checkedLookup) import qualified Graphics.Gnuplot.Terminal.Default as Def import qualified Dat...
energyflowanalysis/efa-2.1
demo/tables/Main.hs
bsd-3-clause
1,578
0
16
347
479
252
227
43
1
{-# OPTIONS -XDeriveDataTypeable -XUndecidableInstances -XExistentialQuantification -XMultiParamTypeClasses -XTypeSynonymInstances -XFlexibleInstances -XScopedTypeVariables -XFunctionalDependencies -XFlexibleContext...
agocorona/MFlow
src/MFlow/Forms.hs
bsd-3-clause
64,421
33
31
16,998
12,931
6,766
6,165
-1
-1
{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-} module Github.Data.Definitions where import Data.Time import Data.Data import qualified Control.Exception as E import qualified Data.Map as M -- | Errors have been tagged according to their source, so you can more easily -- dispatch and handle them. data Error ...
thoughtbot/github
Github/Data/Definitions.hs
bsd-3-clause
19,049
0
10
3,388
4,515
2,687
1,828
534
0
{-# LANGUAGE OverloadedStrings #-} module Main where import Data.Set import qualified Data.Map as Map import qualified Test.Framework as TF import qualified Test.Framework.Providers.HUnit as TFH import qualified Test.HUnit as TH import Syntax import Id import Type import SSA import SSALiveness main :: IO () main = TF...
koba-e964/hayashii-mcc
test/LivenessTest.hs
bsd-3-clause
2,557
0
17
527
1,161
628
533
65
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Heed ( main ) where import qualified Control.Concurrent.BroadcastChan as BChan import Control.Concurrent.STM.TVar (newTVarIO) import Control.Lens ((&), (.~), (^..)) import Control.Monad (forM, forM_) import qualified Data.Ini as Ini im...
Arguggi/heed
heed-backend/src/Heed.hs
bsd-3-clause
3,477
0
23
746
928
504
424
-1
-1
{-# LANGUAGE TemplateHaskell, TypeFamilies, ExistentialQuantification, TypeOperators, ScopedTypeVariables, TupleSections #-} module Data.Bitmap.StringRGB24A4VR.Internal ( BitmapImageString(..) , BitmapStringRGB24A4VR(..), bmps_dimensions, bmps_data , bytesPerRow , bitmapStringBytesPerRow , widthPad...
bairyn/bitmaps
src/Data/Bitmap/StringRGB24A4VR/Internal.hs
bsd-3-clause
8,772
5
24
2,748
2,176
1,175
1,001
143
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ConstraintKinds #-} module Futhark.Representation.SOACS.SOAC ( SOAC(..) , StreamForm(..) , typeCheckSOAC ...
mrakgr/futhark
src/Futhark/Representation/SOACS/SOAC.hs
bsd-3-clause
28,171
19
26
7,549
8,603
4,275
4,328
542
8
{-# OPTIONS -XCPP #-} module PreventGoingBack ( preventBack) where import System.IO.Unsafe import Control.Concurrent.MVar -- #define ALONE -- to execute it alone, uncomment this #ifdef ALONE import MFlow.Wai.Blaze.Html.All main= runNavigation "" $ transientNav preventBack #else import MFlow.Wai.Blaze.Html.All hiding(...
agocorona/MFlow
Demos/PreventGoingBack.hs
bsd-3-clause
1,191
0
14
327
228
117
111
20
1
{-# LINE 1 "Data.Int.hs" #-} {-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Int -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/base/LICENS...
phischu/fragnix
builtins/base/Data.Int.hs
bsd-3-clause
1,746
0
5
367
73
54
19
8
0
{-- snippet all --} divBy :: Integral a => a -> [a] -> Maybe [a] divBy numerator denominators = mapM (numerator `safeDiv`) denominators where safeDiv _ 0 = Nothing safeDiv x y = x `div` y {-- /snippet all --}
binesiyu/ifl
examples/ch19/divby2m.hs
mit
228
0
9
59
81
44
37
5
2
{-# LANGUAGE OverloadedStrings #-} module Network.Google.Drive.SearchSpec ( main , spec ) where import SpecHelper import Data.Text (Text) main :: IO () main = hspec spec spec :: Spec spec = describe "Network.Google.Drive.Search" $ do it "can list files based on a query" $ do runApiSpec $ \fo...
pbrisbin/google-drive
test/Network/Google/Drive/SearchSpec.hs
mit
952
0
21
327
233
122
111
23
1
----------------------------------------------------------------------------- -- -- Module : Transient.Move.Internals -- Copyright : -- License : MIT -- -- Maintainer : agocorona@gmail.com -- Stability : -- Portability : -- -- | -- -----------------------------------------------------------------------...
transient-haskell/transient-universe
src/Transient/Move/Internals.loggedmodified.hs
mit
79,528
1,056
34
27,565
12,402
7,344
5,058
1,021
12
module Sing where fstString :: [Char] -> [Char] fstString x = x ++ " in the rain" sndString :: [Char] -> [Char] sndString x = x ++ " over the rainbow" -- sing = if (x > y) then fstString x else sndString y -- where x = "Singin" -- y = "Somewhere" -- 2 sing = if (x < y) then fstString x else sndString ...
ashnikel/haskellbook
ch05/ch05fixit.hs
mit
371
0
7
106
100
58
42
8
2
{-# OPTIONS_GHC -XFlexibleInstances #-} ----------------------------------------------------------------------- -- -- Haskell: The Craft of Functional Programming, 3e -- Simon Thompson -- (c) Addison-Wesley, 1996-2011. -- -- Chapter 13 -- ----------------------------------------------------------------------- modu...
Numberartificial/workflow
snipets/src/Craft/Chapter13.hs
mit
6,894
7
15
1,674
1,902
1,080
822
-1
-1
-- -- -- ----------------- -- Exercise 6.62. ----------------- -- -- -- module E'6'62 where import E'6'53 ( Suit ) import E'6'55 ( Player ( North , South ) ) import E'6'56 ( TrickType ( Trick ) ) import E'6'57 ( winNT ) import E'6'58 ( winT ) data Team = NorthSouth | EastWest ...
pascal-knodel/haskell-craft
_/links/E'6'62.hs
mit
1,901
0
10
554
425
232
193
37
1
module Wash.Persistent (T (), init, get, set, add, current) where import Wash.Config {- glossary A persistent entity (PE) is a named global value that evolves over time. The current value of a PE is the value that the PE has now. A handle gives access to a snapshot of a persistent entity at a particular time. -- i...
Erdwolf/autotool-bonn
src/Wash/Persistent.hs
gpl-2.0
3,571
6
16
952
1,130
558
572
76
2
data A = A deriving (Show, Show)
roberth/uu-helium
test/parser/DerivingShowShow.hs
gpl-3.0
32
0
6
6
19
10
9
1
0
{- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[RnNames]{Extracting imported and top-level names in scope} -} {-# LANGUAGE CPP, NondecreasingIndentation #-} module RnNames ( rnImports, getLocalNonValBinders, newRecordSelector, rnExports, extendGlobalRdrEnvRn, gresFromAva...
AlexanderPankiv/ghc
compiler/rename/RnNames.hs
bsd-3-clause
82,670
8
31
25,621
15,590
8,049
7,541
-1
-1
{-# LANGUAGE DeriveGeneric #-} module ModifiersSpec where import Data.List import Test.Hspec import System.Console.GetOpt.Generics import System.Console.GetOpt.GenericsSpec import Util spec :: Spec spec = do describe "AddShortOption" $ do it "allows modifiers ...
kosmikus/getopt-generics
test/ModifiersSpec.hs
bsd-3-clause
2,638
0
19
644
666
316
350
53
1
{- | Module : $Header$ Description : OWL reserved keywords and printing Copyright : (c) Christian Maeder DFKI Bremen 2008, Felix Mance, 2011 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : portable String constants for keywo...
keithodulaigh/Hets
OWL2/Keywords.hs
gpl-2.0
6,036
0
7
1,025
1,344
820
524
227
11
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-elasticache/gen/Network/AWS/ElastiCache/CreateCacheSubnetGroup.hs
mpl-2.0
5,178
0
10
1,053
568
347
221
71
1
module Trace.Hpc.Coveralls.Config where import Trace.Hpc.Coveralls.Types (CoverageMode) data Config = Config { excludedDirs :: ![FilePath], coverageMode :: !CoverageMode, cabalFile :: !(Maybe FilePath), serviceName :: !(Maybe String), repoToken :: !(Maybe String), testSuites :: ![Stri...
jdnavarro/hpc-coveralls
src/Trace/Hpc/Coveralls/Config.hs
bsd-3-clause
330
0
11
72
95
56
39
21
0
-- | Saves the version module Version where import Data.Version {-# noinline nikkiVersion #-} nikkiVersion :: Version nikkiVersion = Version version tags where version = 999 : [] tags = ["fakeFuture"]
geocurnoff/nikki
src/FakeFutureVersion.hs
lgpl-3.0
216
0
8
46
47
28
19
7
1
module VersionTest where import Data.Int import Data.Vector import Test.QuickCheck import Thrift.Protocol.Binary import Thrift.Protocol.Compact import Thrift.Protocol.JSON import Thrift.Protocol.SimpleJSON import Thrift.Transport import Thrift.Transport.Empty import Version_Types import Util prop_roundtrip :: (Tran...
getyourguide/fbthrift
thrift/lib/hs/tests/VersionTest.hs
apache-2.0
762
0
11
129
206
111
95
20
1
module D2 where {- generalise function 'f' on the sub-expression '(y+1)' with a new parameter 'z'. This refactoring only affects the current module -} y=0 f z x =x + z f_gen = (y + 1) sumFun xs = sum $ map (f (y + 1)) xs
kmate/HaRe
old/testing/generaliseDef/D2_TokOut.hs
bsd-3-clause
231
0
10
57
66
36
30
5
1
-- -- Adapted from the program "infer", believed to have been originally -- authored by Philip Wadler, and used in the nofib benchmark suite -- since at least the late 90s. -- module InferMonad (Infer, returnI, eachI, thenI, guardI, useI, getSubI, substituteI, unifyI, freshI, freshesI) ...
jasonzoladz/parconc-examples
parinfer/InferMonad.hs
bsd-3-clause
3,090
2
16
1,338
982
525
457
60
2
module Tests.Unit ( runTests ) where import System.Directory import Test.HUnit import Control.Monad import Control.Applicative ((<$>)) import Control.Exception import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as L import Data.Certificate.X509 import Data.List (isPrefixOf) -- FIXME : make ...
theeternalsw0rd/ports-2012
dev-haskell/certificate/files/certificate-1.3.6/Tests/Unit.hs
gpl-2.0
1,401
12
15
307
456
240
216
35
5
module Oops where main = print ((f 1) 2, gaga True) where f x y = g + y where g = x gaga h = ("g: " ++) (show h)
kmate/HaRe
old/testing/introNewDef/Oops_AstOut.hs
bsd-3-clause
132
0
9
50
74
39
35
5
1
module Main where main :: IO () main = putStrLn "This is foo from has-exe-foo"
AndreasPK/stack
test/integration/tests/1198-multiple-exes-with-same-name/files/app/Main.hs
bsd-3-clause
80
0
6
16
22
12
10
3
1
-- Test for trac #322 module ShouldCompile where instance (Num a) => Num (Maybe a) where (Just a) + (Just b) = Just (a + b) _ + _ = Nothing (Just a) - (Just b) = Just (a - b) _ - _ = Nothing (Just a) * (Just b) = Just (a * b) _ * _ = Nothing negate (Just a) = Just (negate a) negate _ ...
urbanslug/ghc
testsuite/tests/deSugar/should_compile/ds060.hs
bsd-3-clause
593
0
8
181
299
148
151
19
1
module Main where import Data.Text (Text) import qualified Data.Text as T import Graphics.QML factorial :: Integer -> Integer factorial n = product [1..n] main :: IO () main = do clazz <- newClass [ defMethod' "factorial" (\_ txt -> let n = r...
fredmorcos/attic
snippets/haskell/QML/Main_2.hs
isc
637
0
19
238
190
99
91
15
1
module Morph.Phonology ( phonologicalChange ) where import ClassyPrelude hiding ((\\)) import Data.RVar import Data.Random.Extras import Data.List (nub, (\\)) import Data.Language import Data.Word import Data.Phoneme import Data.Inflection import Data.Soundchange import Constants import HelperFunctions -- Given a ...
Brightgalrs/con-lang-gen
src/Morph/Phonology.hs
mit
24,898
0
16
5,462
8,049
4,097
3,952
309
2
{- HAAP: Haskell Automated Assessment Platform This module provides the @CmdArgs@ plugin (<https://hackage.haskell.org/package/cmdargs>) for command-line argument support. -} {-# LANGUAGE DeriveDataTypeable, TypeOperators, FlexibleInstances, UndecidableInstances, FlexibleContexts, TypeFamilies, MultiParamTypeClasses,...
hpacheco/HAAP
src/HAAP/CmdArgs.hs
mit
1,905
0
14
328
607
319
288
37
1
module Data.List.Util ( deletions, splits, shuffle ) where import Control.Arrow (second) import Control.Monad (forM) import Data.Array.IO.Safe (IOArray, newListArray, readArray, writeArray) import System.Random (randomRIO) deletions :: [a] -> [(a, [a])] deletions [] = [] deletions (x:xs) = (x, xs) : map (second (...
YellPika/Hannel
src/Data/List/Util.hs
mit
793
0
13
199
435
238
197
24
1
module Tamien.Core (module X) where import Tamien.Core.Language as X import Tamien.Core.Parser as X import Tamien.Core.Printer as X
cpettitt/tamien
Tamien/Core.hs
mit
133
0
4
18
36
26
10
4
0
-- Church Numbers - Add, Multiply, Exponents -- http://www.codewars.com/kata/55c0c452de0056d7d800004d/ module Haskell.Codewars.Church where type Lambda a = (a -> a) type Cnum a = Lambda a -> Lambda a churchAdd :: Cnum a -> Cnum a -> Cnum a churchAdd c1 c2 f = c1 f . c2 f churchMul :: Cnum a -> Cnum a -> Cnum a chur...
gafiatulin/codewars
src/3 kyu/Church.hs
mit
419
0
9
89
165
83
82
9
1
{- H-99 Problems Copyright 2015 (c) Adrian Nwankwo (Arcaed0x) Problem : 8 Description : Eliminate consecutive duplicates of list elements. License : MIT (See LICENSE file) -} unique :: (Eq a) => [a] -> [a] unique [] = [] unique (x:xs) = reverse $ foldl uniqueFilter [x] xs where unique...
Arcaed0x/H-99-Solutions
src/prob8.hs
mit
432
0
10
155
101
54
47
6
2
sum [1..10] take (double 2) [1, 2, 3, 4, 5, 6] head [1,2,3,4,5] tail [1,2,3,4,5] [1,2,3,4,5] !! 2 //Not a constant time operation take 3 [1,2,3,4,5] drop 3 [1,2,3,4,5] length [1,2,3,4,5] [1,2,3] ++ [4,5] sum [1,2,3,4,5] product [1,2,3,4,5] reverse [1,2,3,4,5] /*f [] = [] f (x:xs) = f ys ++ [x] + f zs ...
jugalps/edX
FP101x/week1/week1.hs
mit
407
3
8
119
370
205
165
-1
-1
module DataModels( Queue, Stack, createQueue, createStack, queuePush, stackPush, queuePop, stackPop, queueSize, stackSize, getQueueList ) where -- Defining a generic queue data structure -- Can be a queue of any type -- This isn't performance focused data Queue a = Queue [a] deriving(Show) dat...
MFire30/haskellPresidentCardgame
app/src/DataModels.hs
mit
1,230
0
8
236
427
228
199
34
1
{-# LANGUAGE TemplateHaskell, NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Mezzo.Compose.Chords -- Description : Harmonic composition units -- Copyright : (c) Dima Szamozvancev -- License : MIT -- -- Maintainer : ds709@cam.ac.uk -...
DimaSamoz/mezzo
src/Mezzo/Compose/Chords.hs
mit
1,719
0
10
312
308
166
142
28
1
coins = [1,2,5,10,20,50,100,200] coinMaxCombo = map (\x -> 200 `div` x) coins coin_vals = zip coins coinMaxCombo --coins = [(1,200),(2,100),(5,40),(10,20),(20,10),(50,4),(100,2),(200,1)] effective (c,n) = c*n is_valid xs = sum xs == 200 coin_func (c,n) = [effective (c,n) | n <- [0..n]] ec = m...
stefan-j/ProjectEuler
q31.hs
mit
881
4
14
218
479
261
218
15
1
module Worksheet where data DayOfWeek = Mon | Tue | Weds | Thu | Fri | Sat | Sun deriving(Show, Eq) -- deriving (Ord, Show, Eq) -- If you need to automatically implement Ord, this is the way to go. instance Ord DayOfWeek where compare Fri Fri = EQ compare Fri _ = GT compare _ Fri = LT compare _ _...
raventid/coursera_learning
haskell/chapter6/ord_worksheet.hs
mit
331
0
6
92
90
51
39
9
0
{-# LANGUAGE DeriveGeneric #-} module Abalone ( Game(..) , Outcome(..) , Board(Board) , Player(White, Black) , Position , gameOver , winner , numPieces , futures , isValid , Direction , Segment , segments , adjacent , start ) where import Data.Ord import Data.List import Data.Maybe imp...
danmane/abalone
unsupported/hs/src/abalone.hs
mit
7,930
0
16
2,114
2,491
1,318
1,173
165
3
module Hanoi where type Peg = String type Move = (Peg, Peg) hanoi :: Integer -> Peg -> Peg -> Peg -> [Move] hanoi 0 _ _ _ = [] hanoi n t1 t2 t3 = hanoi (n-1) t1 t3 t2 ++ [(t1, t2)] ++ hanoi (n-1) t3 t2 t1
tomwadeson/cis194
week1/Hanoi.hs
mit
210
0
9
55
125
69
56
6
1
-- Haskell Anagram Library -- Copyright (c) Ryan Kadwell <ryan@riaka.ca> -- -- For the full copyright and license information, please view the LICENSE -- file that was distributed with this source code. -- -- Author: Ryan Kadwell <ryan@riaka.ca> module Main (main) where import Control.Monad (when) import Data.Char (t...
ryakad/hanagram
main.hs
mit
4,737
0
16
1,132
1,224
661
563
99
5
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafregional-bytematchset-fieldtomatch.html module Stratosphere.ResourceProperties.WAFRegionalByteMatchSetFiel...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/WAFRegionalByteMatchSetFieldToMatch.hs
mit
2,203
0
13
212
265
151
114
28
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesisanalytics-application-recordformat.html module Stratosphere.ResourceProperties.KinesisAnalyticsApplica...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/KinesisAnalyticsApplicationRecordFormat.hs
mit
2,709
0
13
212
260
150
110
29
1
-- GenI surface realiser -- Copyright (C) 2005 Carlos Areces and Eric Kow -- -- This program is free software; you can redistribute it and/or -- modify it under the terms of the GNU General Public License -- as published by the Free Software Foundation; either version 2 -- of the License, or (at your option) any later ...
kowey/GenI
src/NLP/GenI/General.hs
gpl-2.0
14,629
1
13
3,538
3,997
2,196
1,801
239
4