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 Main (main) where import Morte.Core import Morte.Import (load) import Morte.Parser (ParseError, exprFromText) import Control.Monad (foldM) import Criterion.Main (Benchmark, defaultMain, env, bgroup, bench, nf) import Data.Text.Lazy (Text) import qualified Data.Text.Lazy as T import Data.Text.Lazy.IO ...
bitemyapp/Haskell-Morte-Library
benchmarks/Bench.hs
bsd-3-clause
1,721
0
13
377
650
358
292
47
2
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TemplateHaskell #-} module Bots ( buildSlackBot , defaultPlugins , getBot , getStatuses , mkConf , reportErrors , registerBot , registerUser , savedBots , startBot , stopBot , startCli , startSavedBots , userFromToken , welcomeUser ) where import Base impo...
jamesdabbs/leeloo
src/Bots.hs
bsd-3-clause
4,910
0
15
1,184
1,549
792
757
-1
-1
module Text.Highlighting.Illuminate.Types ( Token , Tokens , TokenType(..) , Scanner , Lexer(..) ) where impor...
jgm/illuminate
Text/Highlighting/Illuminate/Types.hs
bsd-3-clause
1,004
0
9
459
222
142
80
42
0
module WorkModule(WorkModuleI(..),Ent(..),ExpRel, analyzeModules, -- obsolete mkWM,inscpList,analyzeSCM,readRel,showRel ) where import Modules import Maybe(fromMaybe,fromJust) --import Names import Ents import DefinedNames import Relations import CheckModules import SCMs import ModSysAST import AST4ModSys...
forste/haReFork
tools/base/Modules/WorkModule.hs
bsd-3-clause
3,344
6
15
1,018
988
536
452
68
1
module System.Hardware.VellemanK8055 where import Control.Concurrent import Control.Monad (void) import Data.Bits (testBit) import qualified Data.ByteString as B import Data.Serialize import Data.Word import System.USB data AnalogChannel = ...
jputcu/VellemanK8055
System/Hardware/VellemanK8055.hs
bsd-3-clause
4,168
0
13
1,166
1,355
679
676
115
5
module Markov.Chain where import qualified Data.Map as M import Data.Maybe (fromMaybe) import Data.Monoid import Control.Arrow (second) -- Markov Chain: DAG with probabilities on arcs -- also, a dictionary that associates a -- probability to each successor type Distribution a = M.Map a Int newtype Chain a = Chain { u...
spyked/writer-monkey
src/Markov/Chain.hs
bsd-3-clause
1,834
0
10
343
627
332
295
37
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE IncoherentInstances #-} {-# LANGUAGE OverlappingInstances #-} module Annot where import qualified Prelude as P import Feldspar import Feldspar.Vector import Feldspar.Matrix ((***)) import Feldspar.Core.Constructs.SourceInfo (SourceInfo1(..)) class Annot a where a...
emwap/annotations
src/Annot.hs
bsd-3-clause
3,619
0
14
1,088
1,734
898
836
94
1
-- generated by derive.hs module Prose.Internal.Numeric where numeric = [ ['\x0030'..'\x0039'], ['\x0660'..'\x0669'], ['\x066B'], ['\x06F0'..'\x06F9'], ['\x07C0'..'\x07C9'], ['\x0966'..'\x096F'], ['\x09E6'..'\x09EF'], ['\x0A66'..'\x0A6F'], ['\x0AE6'..'\x0AEF'], ['\x0B66'..'\x0B6F...
llelf/prose
Prose/Internal/Numeric.hs
bsd-3-clause
1,391
0
6
261
313
209
104
52
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DeriveGeneric #-} ----------------------------------------------------------------------------- -- | -- Module : Con...
qnikst/distributed-process-task
src/Control/Distributed/Process/Task/Queue/BlockingQueue.hs
bsd-3-clause
7,654
0
17
1,863
2,051
1,102
949
149
6
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-} module Network.DNS.StateBinary ( PState(..) , initialState , SPut , runSPut , put8 , put16 , put32 , putInt8 , putInt16 , putInt32 , putB...
kazu-yamamoto/dns
internal/Network/DNS/StateBinary.hs
bsd-3-clause
14,350
0
15
3,598
3,973
2,063
1,910
304
4
module Data.Kicad.Util where import Data.Maybe maybeHead :: [a] -> Maybe a maybeHead [] = Nothing maybeHead (x:_) = Just x headOr :: a -> [a] -> a headOr d xs = fromMaybe d (maybeHead xs) maybeLast :: [a] -> Maybe a maybeLast [] = Nothing maybeLast xs = Just $ last xs
kasbah/haskell-kicad-data
Data/Kicad/Util.hs
mit
273
0
7
56
132
69
63
10
1
{-# LANGUAGE CPP #-} #if MIN_VERSION_base(4,7,0) {-# LANGUAGE OverloadedLists #-} #endif module Data.Version.OrphansSpec (main, spec) where import Test.Hspec import Data.Data import Data.Orphans () import Data.Version main :: IO () main = hspec spec spec :: Spec spec = do describe "Data Version instance" $ it...
phadej/base-orphans
test/Data/Version/OrphansSpec.hs
mit
616
0
14
109
171
97
74
13
1
{-# LANGUAGE TemplateHaskell #-} module HTorrent.Types ( Env(..) , Config(..) , Peer(..) , Hist(..) , Status(..) -- Set-like channel , TShan , readTShan , writeTShan , rmvTShan -- Operations , opHas , setChoked , setInteresting , addUp , addDown ) whe...
nickspinale/htorrent
src/HTorrent/State.hs
mit
3,660
0
13
1,044
1,165
657
508
102
2
module X ( -- foo foo, -- bar bar ) where
itchyny/vim-haskell-indent
test/comment/module_comments.in.hs
mit
43
0
4
12
14
10
4
4
0
{- | Module : $Header$ - Description : Implementation of logic instance CK+CEM - Copyright : (c) Daniel Hausmann & Georgel Calin & Lutz Schroeder, DFKI Lab Bremen, - Rob Myers & Dirk Pattinson, Department of Computing, ICL - License : GPLv2 or higher, see LICENSE.txt - Maintainer : h...
nevrenato/Hets_Fork
GMP/versioning/gmp-coloss-0.0.3/GMP/Logics/Con.hs
gpl-2.0
4,174
0
21
1,157
909
489
420
-1
-1
-- Copyright 2016 TensorFlow authors. -- -- 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 agree...
tensorflow/haskell
tensorflow/src/TensorFlow/Output.hs
apache-2.0
4,248
0
15
882
926
546
380
86
1
-- {-# OPTIONS_GHC -fno-warn-redundant-constraints #-} {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances #-} -- UndecidableInstances because (L a b) is no smaller than (C a b) -- This one shows up another rather subtle functional-dependecy -- case. The er...
rahulmutt/ghcvm
tests/suite/typecheck/compile/tcfail138.hs
bsd-3-clause
1,584
0
7
330
137
79
58
-1
-1
-- | Server and client game state types and operations. module Game.LambdaHack.Common.State ( -- * Basic game state, local or global State -- * State components , sdungeon, stotalDepth, sactorD, sitemD, sfactionD, stime, scops, shigh, sgameModeId -- * State operations , defStateGlobal, emptyState, loc...
Concomitant/LambdaHack
Game/LambdaHack/Common/State.hs
bsd-3-clause
6,736
0
15
1,706
1,609
908
701
-1
-1
{-# LANGUAGE GADTs, RankNTypes #-} ----------------------------------------------------------------------------- -- Copyright 2017, GRACeFUL project team. This file is distributed under the -- terms of the Apache License 2.0. For more information, see the files -- "LICENSE.txt" and "NOTICE.txt", which are included in t...
GRACeFUL-project/GRACe
RestAPI/Service.hs
bsd-3-clause
2,081
0
16
558
521
265
256
37
5
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-cloudfront/gen/Network/AWS/CloudFront/ListInvalidations.hs
mpl-2.0
5,136
0
12
1,124
669
394
275
-1
-1
{-# LANGUAGE ScopedTypeVariables, FlexibleInstances #-} {- Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu> 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, ...
royopa/pandoc
src/Text/Pandoc.hs
gpl-2.0
15,842
0
17
4,784
2,917
1,668
1,249
288
5
import "hint" HLint.Default import "hint" HLint.Dollar ignore "Eta reduce"
mightymoose/liquidhaskell
HLint.hs
bsd-3-clause
76
0
5
10
19
10
9
-1
-1
import StackTest main :: IO () main = do stack ["build", "async"] stackErr ["build", "zlib-bindings"] stack ["build", "--stack-yaml", "stack-modify-lts.yaml", "async"] stack ["build", "--stack-yaml", "stack-local-snapshot.yaml", "async"] stack ["build", "--stack-yaml", "stack-remote-snaps...
juhp/stack
test/integration/tests/1265-extensible-snapshots/Main.hs
bsd-3-clause
421
0
8
70
115
62
53
9
1
main = do print $ exp 0 print $ sqrt 4 print $ log (exp 3) print $ 2 ** 2 print $ logBase 10 100 print $ sin (pi/2) print $ cos pi
beni55/ghcjs
test/fay/floating.hs
mit
145
0
10
48
92
40
52
8
1
{-# LANGUAGE MagicHash, UnboxedTuples #-} module T12115 where import GHC.Prim import GHC.Types f :: (# Void#, (# #) #) -> String f = f
ezyang/ghc
testsuite/tests/codeGen/should_compile/T12115.hs
bsd-3-clause
138
0
6
27
34
21
13
6
1
{-# LANGUAGE DeriveFunctor, DeriveFoldable #-} module Main where import Prelude hiding (sum) import Data.Foldable -- Derive Foldable for a simple data type data List a = Nil | Cons a (List a) deriving (Functor,Foldable,Show) someList = Cons 1 (Cons 1 (Cons 2 (Cons 3 Nil))) main = print (sum someList)
urbanslug/ghc
testsuite/tests/deriving/should_run/drvrun-foldable1.hs
bsd-3-clause
312
0
11
60
104
58
46
8
1
module CIS194.Week01.Luhn where -- | Exercise 01 toDigits :: Int -> [Int] toDigits = reverse . toDigitsRev toDigitsRev :: Int -> [Int] toDigitsRev n | n <= 0 = [] | otherwise = mod n 10 : toDigitsRev (div n 10) -- | Exercise 02 doubleEveryOther :: [Int] -> [Int] doubleEveryOther [] = [] doubleEveryO...
acamino/cis-194-2013
src/CIS194/Week01/Luhn.hs
mit
598
0
10
135
246
131
115
15
1
{- -------------------------------------------------------------------------------------------------------------- Program : fact.hs Professor : Richard Riehle Programmer : Jigar Gosalia (89753) Description : Learn functions in Haskell. Usage : Load file in WinGHCi and run "fact n" where n ...
gosaliajigar/Languages
Haskell/fact.hs
mit
526
0
8
90
41
21
20
3
1
{-# LANGUAGE CPP, NoImplicitPrelude #-} module Debug.Trace.Compat ( module Base , traceId , traceShowId , traceM , traceShowM ) where #if !(MIN_VERSION_base(4,7,0)) || MIN_VERSION_base(4,9,0) import Debug.Trace as Base #else import Debug.Trace as Base hiding ( traceM , traceShowM ) #endif #if !(MIN_VERSION_...
haskell-compat/base-compat
base-compat/src/Debug/Trace/Compat.hs
mit
1,748
0
8
342
191
110
81
17
1
-- longest_palindrome -- https://www.codewars.com/kata/54bb6f887e5a80180900046b module Codewars.Kata.LongestPalindrome (longestPalindrome) where import Data.Maybe (listToMaybe) import Data.Ord (Down(..)) import Data.List (sortOn) import Data.Array (assocs, listArray, (!)) longestPalindrome :: Eq a => [a] -> Int long...
gafiatulin/codewars
src/6 kyu/LongestPalindrome.hs
mit
1,188
0
17
428
624
340
284
23
3
data Vector = V Double Double data Matrix = M Double Double Double Double innerProd :: Vector -> Vector -> Double innerProd (V a1 a2) (V b1 b2) = a1 * b1 + a2 * b2 prodVM :: Vector -> Matrix -> Vector prodVM (V a1 a2) (M b11 b12 b21 b22) = (V (innerProd (V a1 a2) (V b11 b21)) ...
mrk21/study_haskell
linear_algebra/Main.hs
mit
630
0
11
232
304
152
152
16
1
{-| Module: Flaw.Graphics.OpenGL.Win32 Description: OpenGL graphics implementation for Windows. License: MIT -} {-# LANGUAGE MultiParamTypeClasses, TypeFamilies #-} module Flaw.Graphics.OpenGL.Win32 ( OpenGLWin32System() , OpenGLWin32Device , OpenGLWin32Context , OpenGLWin32Presenter() , createOpenGLWin32Sy...
quyse/flaw
flaw-gl-win32/Flaw/Graphics/OpenGL/Win32.hs
mit
4,968
0
21
848
1,130
595
535
106
2
module Main (main) where import Control.Concurrent import qualified Data.Array as A import Data.StateVar import qualified Graphics.UI.GLFW as GLFW import qualified Graphics.Rendering.OpenGL as GL import System.Exit data ProgramState = ProgramState { programStatePolygonModel :: MVar PolygonModel } data ...
IreneKnapp/Origami
Main.hs
mit
3,761
0
20
1,060
1,370
699
671
102
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-} {-# LANGUAGE ScopedTypeVariables #-} module Build ( getDeps , touchDeps , touch , recompDeps , isNewerThan ) where -- FIXME there's a bug when getFileStatus applies to a file -- temporary deleted (e.g., Vim saving a file) import ...
piyush-kurur/yesod
yesod/Build.hs
mit
10,120
0
30
3,116
3,233
1,675
1,558
-1
-1
module Day11Spec (spec) where import Day11 import Test.Hspec main :: IO () main = hspec spec sampleInput :: [String] sampleInput = [ "The first floor contains a hydrogen-compatible microchip and a lithium-compatible microchip." , "The second floor contains a hydrogen generator." , "The third floor contai...
brianshourd/adventOfCode2016
test/Day11Spec.hs
mit
1,633
0
18
445
384
185
199
39
1
module TwelveDays ( recite ) where import Data.List (intercalate) import Text.Printf (printf) day :: Int -> (String, String) day n = days !! (n - 1) where days = [ ("first", "a Partridge in a Pear Tree") , ("second", "two Turtle Doves") , ("third", "three French Hens") , ("fourth", "...
enolive/exercism
haskell/twelve-days/src/TwelveDays.hs
mit
1,202
0
9
295
359
207
152
31
1
import Control.Monad.Writer type MyWriter = Writer [Int] String example :: MyWriter example = do tell [1..5] tell [5..10] return "foo" output :: (String, [Int]) output = runWriter example
riwsky/wiwinwlh
src/writer.hs
mit
198
0
8
38
81
43
38
9
1
-- Write a function that builds two-tuples with all possible combinations of two -- of the colors black, white, blue, yellow, and red. Note that you should include -- only one of `(black, blue)` and `(blue, black)` module Main (colorCombinations) where colors = ["black", "white", "blue", "yellow", "red"] colorComb...
ryanplusplus/seven-languages-in-seven-weeks
haskell/day1/color_combinations.hs
mit
380
0
7
67
70
43
27
3
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NoMonomorphismRestriction #-} import Control.Monad.IO.Class import Control.Monad.Trans.Class import Control.Monad.Trans.Resource import Data.Aeson import Data.Text ...
AndrewRademacher/hs-paypal-rest
repl/Main.hs
mit
1,077
0
13
364
230
120
110
29
2
{- | module: Main description: Fibonacci numbers - testing license: MIT maintainer: Joe Leslie-Hurd <joe@gilith.com> stability: provisional portability: portable -} module Main ( main ) where import qualified OpenTheory.Natural.Fibonacci as Fibonacci import qualified OpenTheory.Primitive.Natural as Natural import q...
gilith/opentheory
data/haskell/opentheory-fibonacci/src/Test.hs
mit
1,220
0
13
221
273
143
130
22
1
{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE TypeSynonymInstances #-} module Database.SqlDelta.Ast (AttributeDef(..), Statement(..), Substatement(..), (<=>), defaultParseFlags, ...
johnbender/sql-delta
src/Database/SqlDelta/Ast.hs
mit
3,455
1
12
950
1,188
625
563
78
1
{- | Module : $Header$ Description : xml output of Hets development graphs Copyright : (c) Ewaryst Schulz, Uni Bremen 2009 License : GPLv2 or higher, see LICENSE.txt Maintainer : Ewaryst.Schulz@dfki.de Stability : provisional Portability : non-portable(Grothendieck) Xml of Hets DGs -} module Stat...
nevrenato/Hets_Fork
Static/ToXml.hs
gpl-2.0
7,735
0
24
2,286
2,532
1,258
1,274
176
7
{- | Module : $Header$ Copyright : (c) Heng Jiang and Till Mossakowski, Uni Bremen 2002-2006 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : provisional Portability : non-portable (Logic) display the logic graph -} module GUI.ShowLogicGraph (showLogicG...
nevrenato/Hets_Fork
GUI/ShowLogicGraph.hs
gpl-2.0
15,819
9
25
6,167
3,237
1,606
1,631
304
8
-- -*- mode: haskell -*- {-# LANGUAGE TemplateHaskell, DeriveDataTypeable #-} module Baum.Config where import Baum.Order import Autolib.ToDoc import Autolib.Reader import Data.Typeable data Config = Config { nodes :: Int , orders :: [ Order ] } deriving ( Eq, Ord, Typeable ) $(derives [make...
Erdwolf/autotool-bonn
src/Baum/Config.hs
gpl-2.0
544
6
13
137
188
106
82
19
1
-- Types module -- By Gregory W. Schwartz {- | Collects all types used in the program -} module Math.Clumpiness.Types where -- Built-in import qualified Data.Sequence as Seq -- Algebraic data Pinpoint a b = Pinpoint { pinpointLabel :: a , pinpointClumpiness :: Seq.Seq (b, b, Double...
GregorySchwartz/clumpiness
src/Math/Clumpiness/Types.hs
gpl-3.0
465
0
10
163
88
59
29
6
0
-- Author: Viacheslav Lotsmanov -- License: GPLv3 https://raw.githubusercontent.com/unclechu/xlib-keys-hack/master/LICENSE {-# LANGUAGE ScopedTypeVariables, DataKinds #-} module Process.KeysActions ( processKeysActions ) where import "base" Data.Proxy (Proxy (Proxy)) import "base" Control.Concurrent.Chan (readC...
unclechu/xlib-keys-hack
src/Process/KeysActions.hs
gpl-3.0
2,217
0
16
530
564
315
249
-1
-1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} ------------------------------------------------------------------------------- -- | -- Module : OpenSandbox.Data.Entity -- Copyright : (c) 2016 Michael Carpenter -- Lice...
oldmanmike/opensandbox
src/OpenSandbox/Data/Entity.hs
gpl-3.0
3,823
0
21
958
886
473
413
108
1
module Language.SMTLib2.Internals.Embed where import Language.SMTLib2.Internals.Expression import Language.SMTLib2.Internals.Type hiding (Constr,Field) import Language.SMTLib2.Internals.Type.List (List(..)) import qualified Language.SMTLib2.Internals.Type.List as List import Language.SMTLib2.Internals.Monad import Lan...
hguenther/smtlib2
Language/SMTLib2/Internals/Embed.hs
gpl-3.0
11,789
1
21
3,289
4,526
2,312
2,214
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveTraversable #-} module Type.Parser where import Control.Applicative import Control.Monad import Control.Monad.State import Data.List (elemIndex) import Data.Attoparsec.ByteString import Data.Att...
gallais/typing-with-leftovers
src/linear/Type/Parser.hs
gpl-3.0
2,103
0
16
494
729
388
341
61
2
module DL3041 (tests) where import Helpers import Test.Hspec tests :: SpecWith () tests = do let ?rulesConfig = mempty describe "DL3041 - Specify version with `dnf install -y <package>-<version>`" $ do it "not ok without dnf version pinning" $ do ruleCatches "DL3041" "RUN dnf install -y tomcat && dnf c...
lukasmartinelli/hadolint
test/DL3041.hs
gpl-3.0
743
0
13
155
119
53
66
-1
-1
{-# OPTIONS -Wall #-} {-# LANGUAGE OverloadedStrings #-} module Graphics.UI.Bottle.Widgets.FocusDelegator(IsDelegating(..), Keys(..), make, defaultKeys) where import Data.Maybe(fromMaybe) import Data.Monoid(mappend) import Data.Vector.Vector2(Vector2(..)) import Graphics.UI.Bottle.Widget(Widget(..)) import qualified G...
alonho/bottle
src/Graphics/UI/Bottle/Widgets/FocusDelegator.hs
gpl-3.0
2,621
0
13
457
618
339
279
55
2
module Main where import Control.Applicative ((<$>)) import Control.Monad.IO.Class (liftIO) import Web.CampBX main :: IO () main = do cfg <- defaultCampBXConfig _ <- runCampBX cfg $ do d <- getDepth liftIO $ print d totalAskVolume <- calculateAskVolume <$> ge...
prikhi/campbx-haskell
bin/CampBXMain.hs
gpl-3.0
575
0
13
168
166
83
83
16
1
{-# LANGUAGE BangPatterns #-} module NodeEditor.CLI where import NodeEditor import qualified Data.Map as M import Data import Data.Maybe import Parser import Writer loadTree :: IO Tree loadTree = loadFile "sandbox" printIds :: IO () printIds = do tree <- loadTree putStrLn $ show (M.keys $ nodes tree) m...
rickardlindberg/node-editor-2
src/NodeEditor/CLI.hs
gpl-3.0
611
0
11
138
210
105
105
23
1
module Language.Mulang.Parsers.Python ( py, py2, py3, parsePython, parsePython2, parsePython3) where import qualified Language.Mulang.Ast as M import qualified Language.Mulang.Ast.Operator as O import Language.Mulang.Builder (compactMap) import Language.Mulang.Parsers import qualified ...
mumuki/mulang
src/Language/Mulang/Parsers/Python.hs
gpl-3.0
13,438
0
14
3,250
3,848
1,946
1,902
182
5
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleContexts #-} module BlogTest ( blogSpecs ) where import TestImport import qualified Data.Map as M import qualified Text.XML as XML import qualified Text.HTML.DOM as HTML import Database.Esqueleto hiding (get) import Network.Wai.Test (SResponse (..)) im...
Happy0/snowdrift
tests/BlogTest.hs
agpl-3.0
3,674
0
11
1,403
225
141
84
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE OverloadedStrings #-} -- snowdrift-api - Server for Snowdrift API. -- Copyright (C) 2015 Snowdrift.coop -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as -- published...
pharpend/snowdrift-api
src/Main.hs
agpl-3.0
6,070
0
27
2,120
1,099
607
492
119
5
addDigits :: Int -> Int addDigits num | num < 0 = -1 | num `elem` [0..9] = num | num >= 10 = addDigits (sum (sepa num)) where sepa num = map (\x -> read [x]::Int) (show num)
ccqpein/Arithmetic-Exercises
Add-Digits/AD.hs
apache-2.0
182
0
11
47
116
58
58
6
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module CodeGen () where import LLVM.General.AST import LLVM.General.AST.Global import qualified LLVM.General.AST as AST import Data.Map as Map import Data.Word import Control.Monad.State import Control.Applicative double :: Type double = FloatingPointType 64 IEEE type Nam...
dbyrne/arrow
CodeGen.hs
apache-2.0
1,668
0
12
616
401
233
168
36
1
{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_HADDOCK show-extensions #-} {-# LANGUAGE DeriveDataTypeable , FlexibleInstances , MultiParamTypeClasses , StandaloneDeriving , TypeFamilies #-} {-| Module : Diagrams.Backend.HsQML.DiagramObj.Renderer Description : Rendering functions and inst...
marcinmrotek/diagrams-hsqml
src/Diagrams/Backend/HsQML/Render.hs
bsd-3-clause
4,985
0
15
1,087
1,379
721
658
88
4
import Control.Monad.Trans import Control.Monad.Identity newtype MaybeT m a = MaybeT { runMaybeT :: m (Maybe a) } instance Functor m => Functor (MaybeT m) where fmap f (MaybeT ma) = MaybeT $ (fmap . fmap) f ma -- TODO: really digest it. instance Applicative m => Applicative (MaybeT m) where pure a = MaybeT $ pur...
chengzh2008/hpffp
src/ch26-MonadTransformers/maybeT.hs
bsd-3-clause
1,386
0
13
339
571
294
277
32
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeOperators #-} module Control.Remote.Monad.JSON.Client ( clientSendAPI ) where import Control.Lens ((^.)) import Control.Monad (void) import Control.Natural import Control....
ku-fpg/remote-json
remote-json-client/Control/Remote/Monad/JSON/Client.hs
bsd-3-clause
783
0
15
154
175
100
75
20
2
module Kata.AlphabetCipher ( Letter , PlainText , Key , CipherText , encode , decode , decypher ) where import Control.Arrow ((>>>)) import Data.Char as Char (ord, chr) import Data.List (isPrefixOf) import Data.Array.Unboxed (UArray, array, (!)) -- | W...
FranklinChen/wonderland-katas-haskell
src/Kata/AlphabetCipher.hs
bsd-3-clause
2,597
0
15
591
748
429
319
62
2
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-| Module : Numeric.AERN.RealArithmetic.NumericOrderRounding.Conversion Description : conversion between approximations and other types Copyright : (c) Micha...
michalkonecny/aern
aern-real/src/Numeric/AERN/RealArithmetic/NumericOrderRounding/Conversion.hs
bsd-3-clause
3,706
0
13
839
949
503
446
78
3
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} module CPD.LocalControl where import Data.List (find, intersect, nub) import Data.Maybe i...
kajigor/uKanren_transformations
src/CPD/LocalControl.hs
bsd-3-clause
8,949
0
29
2,639
3,023
1,566
1,457
153
7
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.ARB.TextureSwizzle -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portabili...
haskell-opengl/OpenGLRaw
src/Graphics/GL/ARB/TextureSwizzle.hs
bsd-3-clause
786
0
5
107
67
48
19
11
0
{-| Module : Utils Description : Utility functions Copyright : (c) Ben Selfridge, 2017 License : BSD3 Maintainer : benselfridge@gmail.com Stability : experimental -} module Utils where import Data.List appendPair :: ([a],[b]) -> ([a],[b]) -> ([a],[b]) appendPair (xs, ys) (xs', ys') = (xs ++ xs', ys ++...
benjaminselfridge/logix
src/Utils.hs
bsd-3-clause
1,504
0
10
391
841
460
381
38
2
module Data.GraphQL.XXX.Schema.AST ( Statement(..) , Argument(..) , Field(..) , InputField(..) , Relation(..) , Arguments , Fields , InputFields , EnumName(..) , FieldName(..) , TypeName(..) , Type(..) , EnumNames , TypeNames , Typed(..) , Named(..) , ...
uebayasi/haskell-graphql-schema
src/Data/GraphQL/XXX/Schema/AST.hs
bsd-3-clause
4,408
0
10
1,081
1,136
630
506
122
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE Trustworthy #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Traversable -- Copyright : Conor McBride and Ross Paterson 2005 -- License : BSD-style (see the LICENSE file in the distribution) -- -- Maint...
spacekitteh/smcghc
libraries/base/Data/Traversable.hs
bsd-3-clause
9,345
0
12
2,093
1,833
1,034
799
95
1
{-# LANGUAGE DeriveDataTypeable, CPP #-} {-# OPTIONS_GHC -fno-warn-missing-fields #-} module Kata.Config where import System.Console.CmdArgs hiding (HTML, Text) import qualified System.Console.CmdArgs as CmdArgs import System.FilePath import Data.Data import Data.Typeable kitExtension :: String kitExtension = "kit" ...
ekmett/kata
Kata/Config.hs
bsd-3-clause
5,900
17
14
1,687
1,253
688
565
-1
-1
{- (c) The University of Glasgow 2006 (c) The AQUA Project, Glasgow University, 1993-1998 \section[TcDefaults]{Typechecking \tr{default} declarations} -} {-# LANGUAGE TypeFamilies #-} module TcDefaults ( tcDefaults ) where import GhcPrelude import GHC.Hs import Class import TcRnMonad import TcEnv import TcHsType im...
sdiehl/ghc
compiler/typecheck/TcDefaults.hs
bsd-3-clause
4,107
0
12
1,195
906
468
438
72
3
module TestFlat where import Lib import Tree import TreeSimple hiding (forceBang) import TreeFlat import Parser import System.Environment import System.Clock import Formatting import Formatting.Clock import Control.DeepSeq {- instance NFData TreeS where rnf (Leaf _) = () rnf (Node lt rt) = rnf lt ...
Benzi-Junior/TreeExample
test/TestFlat.hs
bsd-3-clause
1,093
0
12
236
285
137
148
30
1
{- | Copyright : Copyright (C) 2006-2014 Bjorn Buckwalter License : BSD3 Maintainer : bjorn@buckwalter.se Stability : Stable Portability: GHC only? Define . -} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE Rank2Types #-} {-# LAN...
bjornbm/dimensional-dk-experimental
src/Numeric/Units/Dimensional/DK/UnitMap.hs
bsd-3-clause
3,313
0
28
784
679
352
327
57
1
{-# LANGUAGE ScopedTypeVariables #-} module Network.Whois ( whois ) where import Network import System.IO import Codec.Text.IConv (convert) import qualified Data.ByteString.Lazy as BSL import qualified Data.ByteString.Lazy.Char8 as BSLC import qualified Data.ByteString as BS import Control.Exception import Da...
endhrk/search-company
Network/Whois.hs
bsd-3-clause
2,114
0
15
632
586
290
296
52
2
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDer...
bheklilr/omniscient
src/Omniscient/Server/Types.hs
bsd-3-clause
4,334
0
10
870
1,122
650
472
133
1
module Main where main :: IO () main = do readLn >>= \first -> readLn >>= \second -> print (first + second)
everyevery/programming_study
hackerrank/functional/SolveMeFirstFP/solution.hs
mit
113
0
13
27
50
27
23
4
1
{-# LANGUAGE OverloadedStrings, TemplateHaskell, QuasiQuotes, TypeFamilies #-} {-# LANGUAGE EmptyDataDecls, FlexibleContexts, GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE CPP #-} module Yesod.PersistSpec where import Test.Hspec import Database.Persist.Sqlite...
tolysz/yesod
yesod-persistent/test/Yesod/PersistSpec.hs
mit
2,089
0
13
457
545
268
277
57
1
{-- snippet all --} -- The "operators" that we're going to support data Op = Plus | Minus | Mul | Div | Pow deriving (Eq, Show) {- The core symbolic manipulation type -} data SymbolicManip a = Number a -- Simple number, such as 5 | Arith Op (SymbolicManip a) (SymbolicManip a) ...
binesiyu/ifl
examples/ch13/numsimple.hs
mit
835
0
10
226
219
112
107
14
0
{-# LANGUAGE OverloadedStrings #-} module DBConnection (connectDB) where import Database.MySQL.Simple import System.Environment lookupEnvOrDefault :: String -> String -> IO String lookupEnvOrDefault key defaultValue = do valueMaybe <- lookupEnv $ "EBOSHI_API_SHOOTOUT_MYSQL_" ++ key case valueMaybe of Just str...
botandrose/eboshi_api_shootout
haskell_scotty/DBConnection.hs
mit
728
0
10
121
179
90
89
20
2
-- grid is a game written in Haskell -- Copyright (C) 2018 karamellpelle@hotmail.com -- -- This file is part of grid. -- -- grid 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...
karamellpelle/grid
source/MEnv/Sound.hs
gpl-3.0
1,016
0
5
178
61
50
11
2
0
{-# 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-directconnect/gen/Network/AWS/DirectConnect/CreatePrivateVirtualInterface.hs
mpl-2.0
4,642
0
12
991
499
304
195
82
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-ssm/gen/Network/AWS/SSM/ListDocuments.hs
mpl-2.0
5,148
0
12
1,132
707
418
289
78
1
module UnitTests.Distribution.Client.Store (tests) where --import Control.Monad --import Control.Concurrent (forkIO, threadDelay) --import Control.Concurrent.MVar import qualified Data.Set as Set import System.FilePath import System.Directory --import System.Random import Distribution.Package (UnitId, mkUnitId) impor...
themoritz/cabal
cabal-install/tests/UnitTests/Distribution/Client/Store.hs
bsd-3-clause
6,334
0
17
1,682
932
471
461
85
1
{- Copyright (C) 2009 John Goerzen <jgoerzen@complete.org> All rights reserved. For license and copyright information, see the file LICENSE -} module TestInfrastructure where import qualified Test.QuickCheck as QC import qualified Test.HUnit as HU import Test.HUnit.Tools q :: QC.Testable a => String -> a -> HU.Test ...
hdbc/convertible
testsrc/TestInfrastructure.hs
bsd-3-clause
335
0
8
53
59
36
23
6
1
-- | Support for validating server output on-the-fly. Validators can be configured on a per content-type basis. module Happstack.Server.Validation where import Control.Concurrent (forkIO) import Control.Exception (evaluate) import Control.Monad import Control.Monad.Trans ...
erantapaa/happstack-server
src/Happstack/Server/Validation.hs
bsd-3-clause
6,176
0
19
1,676
1,051
586
465
61
2
{-# LANGUAGE GADTs, Rank2Types, CPP #-} ----------------------------------------------------------------------------------------- -- | -- Module : FRP.Yampa.Random -- Copyright : (c) Antony Courtney and Henrik Nilsson, Yale University, 2003 -- License : BSD-style (see the LICENSE file in the distribution)...
ony/Yampa-core
src/FRP/Yampa/Random.hs
bsd-3-clause
4,066
0
18
1,022
584
337
247
31
3
{-# LANGUAGE CPP, FlexibleInstances, UnboxedTuples, MagicHash #-} {-# OPTIONS_GHC -fno-cse -fno-warn-orphans #-} -- -fno-cse is needed for GLOBAL_VAR's to behave properly ----------------------------------------------------------------------------- -- -- Monadery code used in InteractiveUI -- -- (c) The GHC Team 2005-...
sgillespie/ghc
ghc/GHCi/UI/Monad.hs
bsd-3-clause
15,263
0
20
4,230
3,709
1,946
1,763
309
2
{-# LANGUAGE Unsafe #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE UnboxedTuples #-} ----------------------------------------------------------------------------- -- | -- Module : Debug.Trace -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the...
siddhanathan/ghc
libraries/base/Debug/Trace.hs
bsd-3-clause
9,611
0
17
1,924
918
537
381
80
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP , NoImplicitPrelude , Rank2Types , ExistentialQuantification #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Desugar -- Copyright : (c) The University of Glasgow, 2007 -- Lic...
mightymoose/liquidhaskell
benchmarks/ghc-7.4.1/Desugar.hs
bsd-3-clause
1,493
0
10
291
199
124
75
14
1
import Data.List {- This should get a worker that takes three arguments. bad: Rec { $we_r1z8 :: (GHC.Types.Int, GHC.Types.Int) -> GHC.Prim.Int# -> (# GHC.Types.Int, GHC.Types.Int #) [GblId, Arity=2, Caf=NoCafRefs, Str=DmdType S(AA)L] $we_r1z8 = \ (w_s1yf :: (GHC.Types.Int, GHC.Types.Int)) (ww_s1yi :: GH...
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/perf/should_run/T5949.hs
bsd-3-clause
1,295
0
10
322
125
70
55
6
2
{-# LANGUAGE RoleAnnotations, StandaloneDeriving, FlexibleContexts, UndecidableInstances, GADTs, TypeFamilies #-} import Data.Coerce (Coercible, coerce) import Data.Monoid (mempty, First(First), Last()) newtype Age = Age Int deriving Show newtype Foo = Foo Age deriving Show newtype Bar = Bar Age deriving Show newtype...
ghc-android/ghc
testsuite/tests/typecheck/should_run/TcCoercible.hs
bsd-3-clause
2,890
0
16
809
895
476
419
38
1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE ImpredicativeTypes #-} module GraphClass where import Data.Monoid (mconcat) import Control.Monad (liftM2, liftM) import Data.List (find) class Eq n => Node n type LEdge n e = (n,e) target :: LEdge n e -> n target (n, _) = n ...
shouya/thinking-dumps
graph/GraphClass.hs
mit
998
0
12
243
374
201
173
-1
-1
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables, QuasiQuotes, RecordWildCards #-} module Main where import Data.Monoid import qualified Data.Map.Strict as M import Data.Text (Text) import qualified Data.Text.Encoding as T (decodeUtf8) import Data.List (intersperse) import qualified Data.List import qualified Data....
danchoi/tsvsql
Main.hs
mit
3,577
0
15
759
1,233
645
588
85
2
{-# LANGUAGE FlexibleContexts #-} {- | Implementation notes (BEA): The exported function expect that the given list of 'NtRoot's all be canonical and correspond to a collection of mutually declared non-terminals. -} module CoqLNOutputDefinitions ( processBody , processClose , processDegree , pro...
plclub/lngen
src/CoqLNOutputDefinitions.hs
mit
21,097
0
15
8,799
5,410
2,691
2,719
369
8
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE RankNTypes #-} ...
Noeda/adeonbot
terminal-emulator/src/Terminal/Emulator.hs
mit
17,428
0
22
5,037
5,769
3,053
2,716
402
48
module Main where import Ios main :: IO () main = runService
tdox/aircraft-service
app/Main.hs
mit
63
0
6
14
22
13
9
4
1
#!/usr/bin/env runhaskell module Main where import System.IO (Handle) import System.Log.Logger import System.Log.Handler.Syslog import System.Log.Handler.Simple import System.Log.Handler (setFormatter, close) import System.Log.Formatter import UI.NCurses import Autocomplete import Buffer import Proc import Palette i...
indika/hd
HD.hs
mit
3,615
0
16
904
1,220
607
613
90
2
module LetPattern where data M a = J a | N bad_let :: M a -> a bad_let xs = let (_, J x) = (xs,xs) in x bad_fun :: M a -> a bad_fun xs = let (J x) = xs in x good_match :: M a -> a good_match (J x) = x
antalsz/hs-to-coq
examples/tests/LetPattern.hs
mit
205
0
10
59
128
66
62
8
1
module FizzBuzz3 where import Control.Monad import Control.Monad.Trans.State import qualified Data.DList as DL import Data.Foldable fizzBuzz :: Integer -> String fizzBuzz n | n `mod` 15 == 0 = "FizzBuzz" | n `mod` 5 == 0 = "Fizz" | n `mod` 3 == 0 = "Buzz" | otherwise ...
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter23.hsproj/FizzBuzz3.hs
mit
650
0
10
185
247
128
119
22
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE UnicodeSyntax #-} module Main (main) where import Control.Applicative ((<$>), (<*>)) import Control.Applicative.Unicode import Control.Arrow as Arrow (first) import Con...
JustusAdam/elm-init
src/Main.hs
mit
9,168
0
23
2,667
2,126
1,130
996
203
3
{-# LANGUAGE Arrows, NoMonomorphismRestriction, RebindableSyntax #-} module System.ArrowVHDL.CRC where import Prelude import Control.Category ((>>>)) import System.ArrowVHDL.Circuit import System.ArrowVHDL.Circuit.Arrow import System.ArrowVHDL.Circuit.Auxillary import System.ArrowVHDL.Cir...
frosch03/arrowVHDL
src/System/ArrowVHDL/CRC.hs
cc0-1.0
5,204
0
18
1,604
930
563
367
95
1