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
data Tree a = Leaf a | Branch (Tree a) (Tree a) fringe :: Tree a -> [a] fringe (Leaf x) = [x] fringe (Branch left right) = fringe left ++ fringe right -- fringe (Branch (Leaf 1) (Branch (Leaf 2) (Branch (Leaf 3) (Leaf 4))))
maxtangli/sonico
language/haskell/tree.hs
mit
226
0
8
48
89
46
43
4
1
{-# LANGUAGE CPP,GeneralizedNewtypeDeriving,RankNTypes #-} {-| Module : Graphics.Rendering.Cairo.Canvas Copyright : Copyright (c) 2015 Anton Pirogov License : MIT Maintainer : anton.pirogov@gmail.com This module defines the 'Canvas' monad, which is a convenience wrapper around the underlying Cairo renderin...
apirogov/cairo-canvas
src/Graphics/Rendering/Cairo/Canvas.hs
mit
19,376
0
16
4,297
6,151
3,169
2,982
-1
-1
localMaxima :: [Integer] -> [Integer] localMaxima list | length list > 2 = map (\(_,b,_) -> b) (filter (\(a,b,c) -> a < b && b > c)(neighborList list)) | otherwise = [] neighborList :: [Integer] -> [(Integer, Integer, Integer)] neighborList (a:b:c:xs) = (a,b,c) : (neighborList (b:c:xs)) neighborList list = []
julitopower/HaskellLearning
localmaxima.hs
mit
315
1
13
54
199
109
90
7
1
{-# LANGUAGE MultiParamTypeClasses #-} module Text.Documentalist.Writer ( module Text.Documentalist.Types.DocBlock , module Text.Documentalist.Types.Package , Writer(..) ) where import Control.Monad.IO.Class import Text....
jspahrsummers/documentalist
Text/Documentalist/Writer.hs
mit
691
0
10
188
97
61
36
9
0
{-# LANGUAGE DeriveDataTypeable #-} module JSDOM.Custom.XMLHttpRequest ( module Generated , XHRError(..) , send , sendString , sendArrayBuffer , sendBlob , sendDocument , sendFormData ) where import Prelude () import Prelude.Compat import Data.Typeable (Typeable) import Control.Concurrent.MVar (takeM...
ghcjs/jsaddle-dom
src/JSDOM/Custom/XMLHttpRequest.hs
mit
3,450
0
17
638
937
500
437
58
2
{-# LANGUAGE OverloadedStrings #-} module Views.Index (render) where import Text.Blaze.Html5 import qualified Text.Blaze.Html5 as H import Text.Blaze.Html5.Attributes import Text.Blaze.Html.Renderer.Text render = do html $ do body $ do h1 "wow, such puppy" ul $ do li "much wag" li "...
Pholey/place-puppy
Placepuppy/Views/Index.hs
mit
369
0
16
90
103
55
48
14
1
{- (*) Modified run-length encoding. Modify the result of problem 10 in such a way that if an element has no duplicates it is simply copied into the result list. Only elements with duplicates are transferred as (N E) lists. Example in Haskell: ghci> encodeModified "aaaabccaadeeee" [Multip...
gaoce/haskell_99
11.hs
mit
638
0
12
147
119
64
55
4
2
-- (c) The University of Glasgow 2006 {-# LANGUAGE CPP, ScopedTypeVariables #-} -- For Functor SCC. ToDo: Remove me when 7.10 is released {-# OPTIONS_GHC -fno-warn-orphans #-} module Gen2.GHC.Digraph( Graph, graphFromEdgedVertices, graphFromVerticesAndAdjacency, SCC(..), Node, flattenSCC, fla...
ghcjs/ghcjs
src/Gen2/GHC/Digraph.hs
mit
16,860
0
17
4,754
3,594
1,923
1,671
219
3
-- List length. Tail Recursion with "foldl". module Length where import Prelude hiding (length) import Data.List (foldl) length :: [t] -> Integer length = foldl (\lengthAccumulator item -> lengthAccumulator + 1) 0 {- GHCi> length "" length "1" length "12" -} -- 0 -- 1 -- 2 -- foldl :: (b -> a -> b) -> ...
pascal-knodel/haskell-craft
Examples/· Folds/length/foldl/Length.hs
mit
3,389
0
11
1,180
286
191
95
14
1
import Data.List import Data.Numbers.Primes import System.IO sum' n = n*(n+1) `div`2 nbFactors n = map (\x -> length x + 1) $ group $ primeFactors n triangleNbs = head [n | n <- [5000000..], product (nbFactors n) > 500] main = putStrLn $ show triangleNbs
t00n/ProjectEuler
triangleNbs.hs
epl-1.0
258
0
11
48
130
68
62
7
1
{- Copyright (C) 2017 WATANABE Yuki <magicant@wonderwand.net> 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 version. This program is ...
magicant/flesh
src/Flesh/Source/Position.hs
gpl-2.0
4,800
2
12
981
814
467
347
89
1
-- moviendo_un_circulo.hs -- Moviendo un círculo. -- José A. Alonso Jiménez <jalonso@us.es> -- Sevilla, 21 de Mayo de 2013 -- --------------------------------------------------------------------- import Graphics.Gloss main :: IO () main = animate (InWindow "Moviendo un circulo" (1800,820) (90,90)) green animacion an...
jaalonso/I1M-Cod-Temas
src/Tema_27/moviendo_un_circulo.hs
gpl-2.0
561
0
9
83
106
59
47
5
1
#!/usr/bin/env runghc import WJR.Application main :: IO () main = defaultMain
drpowell/Prokka-web
prokka-web.hs
gpl-3.0
80
0
6
13
22
12
10
3
1
{-| Module : Lipid.Parsers.CombinedRadyl.GlycerophospholipidSpec Description : Copyright : Michael Thomas License : GPL-3 Maintainer : Michael Thomas <Michaelt293@gmail.com> Stability : Experimental -} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TypeApplications #-} module Lipid.Parsers.CombinedRadyl.Glyce...
Michaelt293/Lipid-Haskell
test/Lipid/Parsers/CombinedRadyl/GlycerophospholipidSpec.hs
gpl-3.0
8,898
0
17
1,649
1,948
1,079
869
143
1
-- Check whether a given term represents a binary tree -- Typechecker does it. data Tree a = Empty | Node a (Tree a) (Tree a) istree :: Tree a -> Bool istree x = True
dannywillems/99-problems
haskell/p54.hs
gpl-3.0
170
0
8
39
52
28
24
3
1
{-# LANGUAGE PatternSynonyms #-} {-| Module : ASCII Description : ASCII Control codes Copyright : (c) Frédéric BISSON, 2015 License : GPL-3 Maintainer : zigazou@free.fr Stability : experimental Portability : POSIX ASCII control codes. -} module Minitel.Constants.ASCII where import Minitel.Type.MNatural ...
Zigazou/HaMinitel
src/Minitel/Constants/ASCII.hs
gpl-3.0
4,536
0
5
1,526
1,084
564
520
132
0
{-| Este modulo contiene la declaracion de los posibles tipos para los términos de las (pre-)expresiones. Como en las pre-expresiones, declaramos un tipo de datos general que nos permite utilizar muchas funciones e idiomas estándares de Haskell. -} {-# Language TypeSynonymInstances,FlexibleInstances #-} module Equ.Ty...
miguelpagano/equ
Equ/Types.hs
gpl-3.0
6,385
0
12
1,745
1,987
1,025
962
-1
-1
{-# LANGUAGE CPP, PackageImports #-} #if __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Safe #-} #endif module Data.List ( -- * Basic functions (++) -- :: [a] -> [a] -> [a] , head -- :: [a] -> a , last -- :: [a] -> a , tail -- :: [a] -> [a] , init ...
jwiegley/ghc-release
libraries/haskell2010/Data/List.hs
gpl-3.0
6,771
0
5
2,708
493
375
118
105
0
module Chap03.Data.TaggedBinaryTree where import Data.Foldable import Prelude hiding (foldr) data TaggedBinaryTree m a = E | T m a (TaggedBinaryTree m a) (TaggedBinaryTree m a) deriving (Eq) instance (Show m, Show a) => Show (TaggedBinaryTree m a) where show E = ...
stappit/okasaki-pfds
src/Chap03/Data/TaggedBinaryTree.hs
gpl-3.0
728
0
10
233
359
184
175
18
1
{-# LANGUAGE NoMonomorphismRestriction #-} -- | Parse and process phylogeny data module Bio.PhylogenyTools ( module Bio.PhylogenyData, drawPhylogeneticGraph, pathLengths, pathLengthsIndexed, ...
eggzilla/Phylogeny
src/Bio/PhylogenyTools.hs
gpl-3.0
5,506
0
20
1,161
1,386
786
600
88
1
module Assembler.Instruction ( Instruction(..) , Symbol(getSymbol) , Value(getValue) , ValueOrSymbol , symbol , value ) where import Data.Char (isDigit) import Data.Either import Data.List as List import Data.Maybe -- You should newtype Symbol = Symbol { getSymbol::String } deriving (Eq, Ord, Show) newtype Value = V...
rifung/nand2tetris
projects/compiler/src/Assembler/Instruction.hs
gpl-3.0
1,754
0
20
620
545
300
245
46
2
{-# 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/Maps/Patch.hs
mpl-2.0
2,736
0
13
684
386
232
154
59
1
func = case lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd of False -> False True -> True
lspitzner/brittany
data/Test115.hs
agpl-3.0
168
0
7
45
25
12
13
6
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Api.Core where ------------------------------------------------------------------------------ import Control.Lens import Snap.Core import Snap.Snaplet import qualified Data.ByteString.Char8 as B import Api.Services.LokaService --------------...
jakespringer/loka
Server/src/api/Core.hs
lgpl-3.0
1,051
0
9
110
199
109
90
20
1
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, TypeFamilies, EmptyDataDecls, ScopedTypeVariables #-} module Arithm where -- Start Zero Succ data Zero data Succ n -- Stop Zero Succ -- Start Nat class Nat n where toInt :: n -> Int instance Nat Zero where toInt _ = 0 instance (Nat n) => Nat (Succ n) where ...
egaburov/funstuff
Haskell/fun-with-types/codes/Arithm.hs
apache-2.0
2,055
0
9
468
899
482
417
-1
-1
-- This file is part of "Loopless Functional Algorithms". -- Copyright (c) 2005 Jamie Snape, Oxford University Computing Laboratory. -- -- 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 -- -- ...
snape/LooplessFunctionalAlgorithms
Traversals.hs
apache-2.0
907
0
8
167
128
73
55
5
1
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QIconEngineV2.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:15 Warning : this file is machine generated - do...
uduki/hsQt
Qtc/Gui/QIconEngineV2.hs
bsd-2-clause
13,356
0
16
2,193
4,389
2,274
2,115
-1
-1
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.ARB.PointSprite -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portability ...
haskell-opengl/OpenGLRaw
src/Graphics/GL/ARB/PointSprite.hs
bsd-3-clause
674
0
5
95
52
39
13
8
0
{- ****************************************************************************** * I N V A D E R S * * * * Module: ObjectBehavior * *...
ivanperez-keera/SpaceInvaders
src/ObjectBehavior.hs
bsd-3-clause
10,453
6
27
3,634
1,733
953
780
-1
-1
{-# language CPP #-} -- | = Name -- -- VK_EXT_conditional_rendering - device extension -- -- == VK_EXT_conditional_rendering -- -- [__Name String__] -- @VK_EXT_conditional_rendering@ -- -- [__Extension Type__] -- Device extension -- -- [__Registered Extension Number__] -- 82 -- -- [__Revision__] -- 2 --...
expipiplus1/vulkan
src/Vulkan/Extensions/VK_EXT_conditional_rendering.hs
bsd-3-clause
34,838
1
17
6,620
3,595
2,163
1,432
-1
-1
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell [lq| isEven :: n:Nat -> Bool / [n, 0]|] [lq| isOdd :: m:Nat -> Bool / [m, 1] |] isEven, isOdd :: Int -> Bool isEven 0 = True isEven n = isOdd $ n - 1 isOdd k = not $ isEven k
spinda/liquidhaskell
tests/gsoc15/unknown/pos/Even0.hs
bsd-3-clause
239
0
6
64
69
39
30
8
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} module Servant.ContentType.PlainHtml where import Data.Typeable (Typeable) import Network.HTTP.Media ((//), (/:)) import Servant.API (Accept (....
notcome/liu-ms-adult
src/Servant/ContentType/PlainHtml.hs
bsd-3-clause
693
0
7
131
153
95
58
-1
-1
module Spec.CSRFile where import Spec.CSRField import Utility.Utility import Data.Bits import Data.List import qualified Data.Map.Strict as M import Data.Maybe type CSRFile = M.Map CSRField MachineInt encodeExtensions :: String -> MachineInt encodeExtensions extensions = foldr (.|.) 0 (map encode extensions) where ...
mit-plv/riscv-semantics
src/Spec/CSRFile.hs
bsd-3-clause
773
0
12
109
268
149
119
19
1
{- | Module : Network.Silver.Proto Description : Bittorrent peer protocol. Copyright : (c) Eric Izoita 2017 License : BSD3 Maintainer : ericizoita@gmail.com Stability : experimental Portability : portable This module handles the bittorrent peer protocol. -} {-# LANGUAGE OverloadedStrings #-} mod...
nytopop/silver
src/Network/Silver/Proto.hs
bsd-3-clause
3,972
0
24
1,186
1,192
607
585
109
0
{-# Language PatternGuards #-} module Blub ( blub , foo , bar ) where import Control.Applicative hiding (t) import Ugah.Blub ( a , b , c ) f :: Int -> Int f = (+ 3) r :: Int -> Int r =
dan-t/hsimport
tests/goldenFiles/SymbolTest41.hs
bsd-3-clause
210
1
6
68
73
46
27
-1
-1
{-# LANGUAGE TypeFamilies, FlexibleContexts #-} module Network.XmlPush.HttpPull.Server (HttpPullSv, HttpPullSvArgs(..)) where import Network.XmlPush.HttpPull.Server.Body
YoshikuniJujo/xml-push
src/Network/XmlPush/HttpPull/Server.hs
bsd-3-clause
172
0
5
14
29
21
8
3
0
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE ImpredicativeTypes #-} {-# OPTIONS_GHC -Wall #-} module ConstMath.PrimRules.V704 ( unaryPrimRules , binaryPrimRules ) where unaryPrimRules :: [(String, (forall a. RealFloat a => a -> a))] unaryPrimRules = [ ("GHC.Prim.expDouble#" , exp) , ("GHC.Prim.logDouble#" ...
kfish/const-math-ghc-plugin
ConstMath/PrimRules/V704.hs
bsd-3-clause
1,417
0
11
359
338
221
117
36
1
module AddLocalDecl1 where -- |This is a function foo = x -- comment1 -- |Another fun x = a -- comment2 where a = 3
mpickering/ghc-exactprint
tests/examples/transform/AddLocalDecl1.hs
bsd-3-clause
124
0
6
33
25
17
8
4
1
{-# LANGUAGE TemplateHaskell #-} module Data.API.Tools.Lens ( lensTool , binary ) where import Data.API.Tools.Combinators import Data.API.Tools.Datatypes import Data.API.Types import Control.Lens -- | Tool to make lenses for fields in generated types. l...
adinapoli/api-tools
src/Data/API/Tools/Lens.hs
bsd-3-clause
431
0
8
114
77
47
30
11
1
module Main (main) where import qualified Test.Attoparsec import qualified Test.Tasty as Tasty main :: IO () main = Tasty.defaultMain tests tests :: Tasty.TestTree tests = Tasty.testGroup "root" [ Tasty.testGroup "Attoparsec." Test.Attoparsec.tests ]
k0001/pipes-attoparsec
tests/Main.hs
bsd-3-clause
266
0
8
47
75
43
32
8
1
{-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-} -- | Perform a build module Stack.Build.Execute...
vigoo/stack
src/Stack/Build/Execute.hs
bsd-3-clause
65,581
0
32
25,458
13,909
6,959
6,950
-1
-1
{-# LANGUAGE NoMonoLocalBinds #-} {-# LANGUAGE FlexibleContexts #-} ----------------------------------------------------------------------------- -- | -- Module : System.Taffybar.Information.MPRIS2 -- Copyright : (c) Ivan A. Malison -- License : BSD3-style (see LICENSE) -- -- Maintainer : Ivan A. Malison --...
teleshoes/taffybar
src/System/Taffybar/Information/MPRIS2.hs
bsd-3-clause
2,799
0
20
720
616
333
283
56
1
module Day15 where import Prelude hiding (length, map, reverse, take) import Data.Bool import Data.Foldable (toList) import Data.Sequence maxLength = 35651584 showSeq :: Seq Bool -> String showSeq = toList . fmap (bool '0' '1') readSeq :: String -> Seq Bool readSeq = fmap (== '1') . fromList gener...
ulyssesp/AoC
src/day15.hs
bsd-3-clause
1,108
0
11
245
427
219
208
-1
-1
{-# LANGUAGE TemplateHaskell #-} module AWS.RDS.Types.DBSecurityGroup ( DBSecurityGroup(..) , EC2SecurityGroup(..) , EC2SecurityGroupStatus(..) , IPRange(..) , IPRangeStatus(..) ) where import AWS.Lib.FromText (deriveFromText, AddrRange, IPv4, Text) data DBSecurityGroup = DBSecurityGroup ...
IanConnolly/aws-sdk-fork
AWS/RDS/Types/DBSecurityGroup.hs
bsd-3-clause
1,530
0
9
282
318
193
125
42
0
{-# LANGUAGE TemplateHaskell #-} -- | <http://strava.github.io/api/v3/segments/> module Strive.Types.Segments ( SegmentDetailed (..) , SegmentSummary (..) , SegmentLeaderboardResponse (..) , SegmentLeaderboardEntry (..) , SegmentExplorerResponse (..) , SegmentExplorerEntry (..) ) where import Data.Aeson...
liskin/strive
library/Strive/Types/Segments.hs
mit
5,669
0
9
1,140
813
517
296
112
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-ecs/gen/Network/AWS/ECS/StartTask.hs
mpl-2.0
6,639
0
13
1,495
844
512
332
89
1
module Main where import Control.Exception import Control.Monad import System.Mem import Control.Monad.ST import Data.Array import Data.Array.ST import qualified Data.Array.Unboxed as U import Control.DeepSeq import Data.Compact import Data.Compact.Internal assertFail :: String -> IO () assertFail msg = throwIO $ A...
olsner/ghc
libraries/compact/tests/compact_simple_array.hs
bsd-3-clause
1,628
0
16
375
574
295
279
46
2
module Tandoori.Typing.InstanceDecl where import Tandoori.Typing import Tandoori.Typing.Monad import Tandoori.GHC.Internals import Tandoori.Typing.Repr import Tandoori.Typing.Error instDecl :: InstDecl Name -> Typing ((Cls, TyCon), PolyTy) instDecl (InstDecl lty binds lsigs _) = withLSrc lty $ do (cls, σ) <- ca...
bitemyapp/tandoori
src/Tandoori/Typing/InstanceDecl.hs
bsd-3-clause
996
0
19
418
297
151
146
18
4
module Scion.Types.Note ( -- * Locations Location, LocSource(..), mkLocation, mkNoLoc, locSource, isValidLoc, noLocText, viewLoc, locStartCol, locEndCol, locStartLine, locEndLine, -- ** Absolute FilePaths AbsFilePath(toFilePath), mkAbsFilePath, -- * Notes Note(..), NoteKind(..), Notes, has...
CristhianMotoche/scion
src/Scion/Types/Note.hs
bsd-3-clause
7,480
0
15
1,816
1,742
960
782
145
2
{-# LANGUAGE DeriveDataTypeable #-} -- http://tools.ietf.org/html/rfc2109 module Happstack.Server.Internal.Cookie ( Cookie(..) , CookieLife(..) , calcLife , mkCookie , mkCookieHeader , getCookies , getCookie , getCookies' , getCookie' , parseCookies , cookiesParser ) ...
erantapaa/happstack-server
src/Happstack/Server/Internal/Cookie.hs
bsd-3-clause
7,573
0
17
2,142
1,822
970
852
129
4
{-# LANGUAGE NamedFieldPuns, RecordWildCards #-} module Distribution.Server ( -- * Server control Server(..), ServerEnv(..), initialise, run, shutdown, checkpoint, reloadDatafiles, -- * Server configuration ListenOn(..), ServerConfig(..), defaultServerConfig, hasSave...
edsko/hackage-server
Distribution/Server.hs
bsd-3-clause
13,424
0
18
3,256
2,462
1,350
1,112
234
3
{-# language ViewPatterns, ScopedTypeVariables #-} module Base.Score ( Scores, HighScoreFile(..), Record(..), saveScore, getScores, setScores, getHighScores, mkScoreString, showScore, timeFormat, batteryFormat, sumOfEpisodeBatteries, ) where import Data.Map as Map (...
geocurnoff/nikki
src/Base/Score.hs
lgpl-3.0
6,939
0
17
1,731
1,719
874
845
160
9
{- Copyright 2017 The CodeWorld Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicab...
three/codeworld
codeworld-prediction/src/Data/MultiMap.hs
apache-2.0
2,426
0
13
471
716
383
333
27
1
{-# LANGUAGE OverloadedStrings #-} import Text.LaTeX import Text.LaTeX.Packages.Inputenc import Text.LaTeX.Packages.TikZ main :: IO () main = execLaTeXT tikztest >>= renderFile "tikz.tex" tikztest :: LaTeXT IO () tikztest = do thePreamble document theBody thePreamble :: LaTeXT IO () thePreamble = do documentcla...
dmcclean/HaTeX
Examples/tikz.hs
bsd-3-clause
1,384
0
16
322
559
267
292
40
1
module Compiler.OptimiseHs(optimiseHs) where import Compiler.Hs import Compiler.Util optimiseHs :: Program -> Program optimiseHs = error . ("\n"++) . show . simpleLet simpleLet :: Program -> Program simpleLet = transformBi f where f (Let [] x) = x f (Let [(x,y)] z) | show x == show z = y ...
ndmitchell/tagsoup
dead/parser/Compiler/OptimiseHs.hs
bsd-3-clause
331
0
11
87
137
73
64
10
3
module Helper where import qualified Data.ByteString.Lazy as BS import Data.Aeson import System.IO.Unsafe defaultInput :: FromJSON a => a {-# NOINLINE defaultInput #-} defaultInput = case unsafePerformIO $ fmap eitherDecode' $ BS.readFile "input.json" of Left e -> error (show e) Right a -> a
NCrashed/pdf-slave
examples/template06/dep1/Helper.hs
bsd-3-clause
298
0
10
48
89
48
41
9
2
<?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="el-GR"> <title>Front-End Scanner | ZAP Extension</title> <maps> <homeID>top</homeID> <m...
thc202/zap-extensions
addOns/frontendscanner/src/main/javahelp/org/zaproxy/zap/extension/frontendscanner/resources/help_el_GR/helpset_el_GR.hs
apache-2.0
978
78
67
159
417
211
206
-1
-1
{-# OPTIONS -XNoMonoLocalBinds #-} module Grin.DeadCode(deadCode) where import Control.Monad import Control.Monad.Trans (MonadIO) import Data.Monoid import qualified Data.Set as Set import Fixer.Fixer import Fixer.Supply import Grin.Grin import Grin.Noodle import Grin.Whiz import Stats hiding(print, singleton) import...
m-alvarez/jhc
src/Grin/DeadCode.hs
mit
11,386
1
26
3,518
4,463
2,234
2,229
-1
-1
{-# LANGUAGE DeriveFunctor, StandaloneDeriving, FlexibleInstances, TypeFamilies, GeneralizedNewtypeDeriving #-} module T4185 where import Data.Kind (Type) data family Foo k :: Type -> Type ------------- Generalised newtype deriving of user class ----------- class Bar f where bar :: f a -> Int woo :: ...
sdiehl/ghc
testsuite/tests/indexed-types/should_compile/T4185.hs
bsd-3-clause
1,184
0
8
272
230
126
104
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Lamdu.GUI.ExpressionEdit.LiteralEdit ( makeInt ) where import Control.Lens.Operators import Control.MonadA (MonadA) import Data.Monoid (Monoid(..)) import Data.Store.Guid (Guid) import Lamdu.GUI.ExpressionEdit.HoleEdit.State (HoleState(..), setHoleStateAndJump) import Lamd...
schell/lamdu
Lamdu/GUI/ExpressionEdit/LiteralEdit.hs
gpl-3.0
1,887
0
14
254
522
297
225
-1
-1
main = do [1,2] <- return [1,2] putStrLn "OK."
philderbeast/ghcjs
test/fay/doAssignPatterMatch.hs
mit
54
0
9
16
34
17
17
3
1
{-# LANGUAGE PatternSynonyms #-} module Foo (A(P)) where data A = A data B = B pattern P :: () => (f ~ B) => f pattern P = B
ezyang/ghc
testsuite/tests/patsyn/should_fail/poly-export-fail2.hs
bsd-3-clause
128
0
9
33
58
35
23
9
0
{-# OPTIONS -XMultiParamTypeClasses -XFunctionalDependencies -XFlexibleInstances #-} module HaskellBug where data Relation c -- The basic Relation = Rel { relnm :: String -- The name of the relation , relsrc :: c -- Source concept , reltrg :: c -- ^Target concept ...
urbanslug/ghc
testsuite/tests/typecheck/should_fail/T4875.hs
bsd-3-clause
998
0
8
290
231
131
100
-1
-1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} module Language.Futhark.TypeChecker.TypesTests (tests) where import Data.Bifunctor (first) import qualified Data.Map as M import Futhark.FreshNames import Futhark.Util.Pretty (prettyOneLine) import Language.Futhark import Language.Futhark.Seman...
HIPERFIT/futhark
unittests/Language/Futhark/TypeChecker/TypesTests.hs
isc
4,838
0
15
1,483
990
550
440
126
2
module Update where import Config import File import Nemo import UpdateApi update :: Nemo FilePath File -> Nemo FilePath File update = Nemo.update (moveToConfigDir makeClone) moveToConfigDir :: (Nemo String File -> String -> (String, File)) -> Nemo String File...
larioj/nemo
src/Update.hs
mit
467
0
9
136
143
77
66
12
1
{-- - Problem 56 (**) Symmetric binary trees Let us call a binary tree symmetric if you can draw a vertical line through the root node and then the right subtree is the mirror image of the left subtree. Write a predicate symmetric/1 to check whether a given binary tree is symmetric. Hint: Writ...
sighingnow/Functional-99-Problems
Haskell/56.hs
mit
1,015
0
9
258
157
80
77
7
3
module StarStats.Parsers.ZNC where import Control.Applicative((<*>), (<$>), (*>), (<*)) import Text.Parsec import Text.Parsec.String import qualified Text.Parsec.Token as P import Text.Parsec.Language (emptyDef) import Data.Functor.Identity import Data.Time.LocalTime import Data.Maybe import Data.List(inters...
deweyvm/starstats
src/StarStats/Parsers/ZNC.hs
mit
4,970
0
15
1,596
1,466
753
713
128
2
-- arith4.hs module Arith4 where -- id :: a -> a -- id x = x roundTrip :: ( Show a, Read a ) => a -> a roundTrip a = read (show a) -- point free roundTripPF :: ( Show a, Read a ) => a -> a roundTripPF = read . show -- point free general roundTripPFG :: ( Show a, Read b ) => a -> b roundTripPFG = read . show main =...
Lyapunov/haskell-programming-from-first-principles
chapter_7/arith4.hs
mit
424
0
10
107
175
92
83
12
1
------------------------------------------------------------------------------ -- Error: monad for representing errors in the Apollo language ------------------------------------------------------------------------------ module Error ( ApolloError (..) , ThrowsError , trapError , extractValue ) where import Contro...
apollo-lang/apollo
src/Error.hs
mit
2,413
0
12
519
675
353
322
44
1
------------------------------------------------------------------------------ -- | Defined to allow the constructor of 'MediaType' to be exposed to tests. module Network.HTTP.Media.MediaType.Internal ( MediaType (..) , Parameters ) where import qualified Data.ByteString.Char8 as BS import qualif...
zmthy/http-media
src/Network/HTTP/Media/MediaType/Internal.hs
mit
3,292
0
17
1,030
946
502
444
58
0
{-| Module : Emit Maintainer : Dominick DiRenzo Emit C intermediate representation given AST -} module Emit ( compileAST, emitModule, emitAST ) where import Lexer import Parser import Control.Monad import Control.Monad.State import Text.Printf (printf) import qualified Data.Foldable as Fold import qualified Da...
ddirenzo/clrs
haskell/Emit.hs
mit
7,425
0
23
2,278
2,337
1,253
1,084
146
5
{-# LANGUAGE ViewPatterns #-} module Tinc.GhcPkg ( PackageDb , GhcPkg(..) , listGlobalPackages ) where import System.Process import Tinc.Package import Tinc.Types data PackageDb class (Functor m, Applicative m, Monad m) => GhcPkg m where readGhcPkg :: [Path PackageDb] -> [String] -...
robbinch/tinc
src/Tinc/GhcPkg.hs
mit
862
0
12
163
256
138
118
-1
-1
{-# LANGUAGE OverloadedStrings #-} module System.Directory.Watchman.Fields ( FileField(..) , FileFieldLabel(..) , renderFieldLabels , parseFileFields ) where import Control.Monad (forM) import System.Directory.Watchman.WFilePath import Data.ByteString (ByteString) import qualified Data.ByteString....
bitc/hs-watchman
src/System/Directory/Watchman/Fields.hs
mit
8,486
0
14
1,575
1,896
998
898
138
16
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE InstanceSigs #-} ----------------------------------------------------------------------------- ...
VictorCMiraldo/mmm
MMM/Core/Distributive.hs
mit
5,835
0
12
1,292
1,572
837
735
83
1
{-# LANGUAGE OverloadedStrings #-} module Partials.KeywordList (KeywordList(..)) where import Control.Monad (forM_) import GHC.Exts (fromString) import Internal.FileDB import Internal.Partial import Text.Blaze.Html5 ((!)) imp...
mayeranalytics/nanoPage
src/Partials/KeywordList.hs
mit
933
0
11
233
227
130
97
19
1
module Tasks where seqA :: Integer -> Integer seqA 0 = 1 seqA 1 = 2 seqA n = helper 1 2 3 n where helper x y z 0 = x helper x y z n = helper y z (z + y - 2 * x) (n - 1) sum'n'count :: Integer -> (Integer, Integer) sum'n'count x = (sum 0 (abs x), count 0 (abs x)) where sum s 0 = s sum s x = sum (s + mod x 1...
FeodorM/some_code
haskell/stuff_from_stepic/tasks.hs
mit
4,888
82
25
1,485
2,556
1,306
1,250
-1
-1
-- Watermelon -- http://www.codewars.com/kata/55192f4ecd82ff826900089e module Codewars.Kata.Watermelon where divide :: Integer -> Bool divide w | w <= 2 = False | otherwise = even w
gafiatulin/codewars
src/8 kyu/Watermelon.hs
mit
193
0
8
36
48
25
23
4
1
module Main where import Carter import System.Environment main :: IO () main = do (file:_) <- getArgs summed <- getAtBatsSum file putStrLn $ "Total atBats was: " ++ (show summed)
mjamesruggiero/carter
src/Main.hs
mit
193
0
9
44
68
35
33
8
1
import Criterion.Main import Data.Monoid import Data.Text as T import Melvin.Damn.Tablumps import Prelude main :: IO () main = defaultMain [ bgroup "test" [ bench "100" $ nf delump ("&b\t" <> T.replicate 10 "&amp;" <> "&/b\t") , bench "300" $ nf delump ("&b\t" <> T.replicate 30 "&amp;"...
pikajude/melvin
benchmarks/parser.hs
mit
519
0
15
148
185
94
91
12
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE UnicodeSyntax #-} -- | This is a demonstration of using open recursion to imple...
jonsterling/hs-monad-open
src/Control/Monad/Trans/Open/Example.hs
mit
4,277
0
16
928
875
493
382
-1
-1
{-| Module describing a node group. -} {- Copyright (C) 2010 Google Inc. 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 version. Th...
ganeti/htools
Ganeti/HTools/Group.hs
gpl-2.0
2,335
0
9
599
322
198
124
32
1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE DefaultSignatures, DeriveFunctor, DeriveFoldable, DeriveTraversable, OverloadedStrings #-} module Lib.Cmp ( ComparisonResult(..), Reasons , Cmp(..) , eqShow, eq , cmpGetter, cmpGetterBy ) where import Prelude.Compat hiding (show) import Data.ByteString (ByteSt...
sinelaw/buildsome
src/Lib/Cmp.hs
gpl-2.0
1,452
0
11
294
556
291
265
39
1
-- -*-haskell-*- -- Vision (for the Voice): an XMMS2 client. -- -- Author: Oleg Belozeorov -- Created: 4 Mar. 2009 -- -- Copyright (C) 2009-2010 Oleg Belozeorov -- -- 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 t...
upwawet/vision
src/Properties/Model.hs
gpl-3.0
3,403
0
17
725
853
444
409
-1
-1
module BackS ( backS , backSpublic ) -- check local rewrite closure: -- for any state that produces reduct x z(y z) -- check that it also produces redex S x y z. -- if not, return empty automaton where import Set import FiniteMap import Stuff import Options import TA import FAtypes import Ids import Reuse im...
jwaldmann/rx
src/BackS.hs
gpl-3.0
1,987
7
18
635
546
279
267
42
2
{-# LANGUAGE TemplateHaskell #-} {-| Module : DeadlinkDatabase Description : Deadlink database management Copyright : (c) Frédéric BISSON, 2016 License : GPL-3 Maintainer : zigazou@free.fr Stability : experimental Portability : POSIX Functions dealing with Deadlink database management -} module Database....
Zigazou/deadlink
src/Database/DeadlinkDatabase.hs
gpl-3.0
611
0
10
100
97
51
46
10
1
module Main where import Control.DeepSeq import Control.Exception import Control.Monad import Data.ByteString as BS import Jason import System.Environment main :: IO () main = do args <- getArgs let times = read (Prelude.head args) :: Int bs <- BS.readFile "../fixtures/sample1.json" replicateM_ times $ do ...
TOSPIO/jason
benchmark/Sample1.hs
gpl-3.0
381
0
14
73
134
67
67
15
1
-------------------------------------------------------------------------------- -- | -- Module : Dhek.Utils -- -------------------------------------------------------------------------------- module Dhek.Utils where -------------------------------------------------------------------------------- import Data.Functor.F...
cchantep/dhek
Dhek/Utils.hs
gpl-3.0
868
0
12
155
164
93
71
9
2
{- Copyright (C) 2017-2018 defanor <defanor@uberspace.net> 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 3 of the License, or (at your option) any later version. This program is dis...
defanor/pancake
Text/Pandoc/Readers/Plain.hs
gpl-3.0
1,655
0
14
353
221
122
99
15
1
-- This Source Code Form is subject to the terms of the Mozilla Public -- License, v. 2.0. If a copy of the MPL was not distributed with this -- file, You can obtain one at http://mozilla.org/MPL/2.0/. {-# LANGUAGE TypeOperators #-} module Data.Predicate.Product where infixr 5 ::: -- | A data-type for combining res...
twittner/wai-predicates
src/Data/Predicate/Product.hs
mpl-2.0
2,314
0
14
628
881
484
397
66
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/Types.hs
mpl-2.0
140,506
0
43
31,060
16,841
10,092
6,749
-1
-1
-- -- Copyright 2017-2018 Azad Bolour -- Licensed under GNU Affero General Public License v3.0 - -- https://github.com/azadbolour/boardgame/blob/master/LICENSE.md -- {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE ScopedTypeVariables #-} module Bolour.Util.FrequencyDistribution ( FrequencyDistribution(..) , mkFr...
azadbolour/boardgame
haskell-server/src/Bolour/Util/FrequencyDistribution.hs
agpl-3.0
2,500
0
13
425
639
341
298
47
3
{-# LANGUAGE UnicodeSyntax #-} -- | -- Module : Math.Dozenal -- Copyright : (C) 2014 Siddhanathan Shanmugam -- License : LGPL (see LICENSE) -- Maintainer : siddhanathan@gmail.com -- Portability : very -- -- Dozenal (Duodecimal) number system, promoting the use of base 12. -- module Dozenal ( decimalT...
siddhanathan/dozenal
Dozenal.hs
lgpl-3.0
2,424
4
8
684
454
248
206
41
5
{-#LANGUAGE DeriveDataTypeable#-} module Data.P440.Domain.TRG where import Data.P440.Domain.SimpleTypes import Data.P440.Domain.ComplexTypes import Data.P440.Domain.ComplexTypesZS hiding (СвПл) import Data.Typeable (Typeable) import Data.Text (Text) -- 2.8 Требование по банковской гарантии data Файл = Файл { ...
Macil-dev/440P-old
src/Data/P440/Domain/TRG.hs
unlicense
1,481
71
8
362
637
346
291
39
0
-- xor [False, True, False] == True -- xor [False, True, False, False, True] == False xor :: [Bool] -> Bool xor = odd . foldr (\x acc -> if x then acc + 1 else acc) (0 :: Integer) -- map' odd [1, 2, 3, 4] == [True, False, True, False] map' :: (a -> b) -> [a] -> [b] map' f = foldr (\x acc -> f x : acc) []
beloglazov/haskell-course
hw4.hs
apache-2.0
307
0
10
74
116
65
51
4
2
{-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------- {-| Module : QWhatsThis.hs Copyright : (c) David Harley 2010 Project : qtHaskell Version : 1.1.4 Modified : 2010-09-02 17:02:15 Warning : this file is machine generated - do no...
keera-studios/hsQt
Qtc/Gui/QWhatsThis.hs
bsd-2-clause
4,006
0
12
567
965
515
450
78
1
{-# LANGUAGE FlexibleContexts #-} module Parse.Comment where import Text.Parsec (Stream, ParsecT, many, try, (<|>)) import Text.Parsec.Char (char, string) import Text.Parsec.Combinator (count, manyTill, between, notFollowedBy, many1, lookAhead) import Parse.SourceCharacter (sourceCharacter) import Parse.Whitespace (l...
michaelbjames/ecma6-parser
Parse/Comment.hs
bsd-2-clause
790
0
10
133
268
142
126
20
1
import Control.Monad(foldM_) import qualified System.Random as R import qualified Bingo as B import qualified Lottery as Lot main = test test = do (card1, card2, card3, ss) <- prepareBingo 25 foldM_ (\acc i -> doBingo i card1 card2 card3 acc) ss [1..20] prepareBingo :: Int -> IO (B.Card,B.Card,B.Card,B.Stat...
mitsuji/bingo
app/Console.hs
bsd-3-clause
1,564
0
12
425
768
382
386
42
2
module ExternChecks (exitPermissions) where import System.Exit (ExitCode (ExitFailure), exitWith) exitPermissions :: FilePath -> IO () exitPermissions path = do putStrLn $ "Bad permissions on file: " ++ path exitWith (ExitFailure 1)
qfjp/csce_dfa_project_test
src/ExternChecks.hs
bsd-3-clause
259
0
9
57
71
38
33
7
1
module Syntax where import Control.Monad.Reader import Control.Monad.State.Lazy import Data.Char import qualified Data.Set as S import Data.List hiding (partition) import Debug.Trace import Text.Parsec.Pos type Name = String -- Variable convention: word begins with upper-case represents constant and -- lower-case re...
Fermat/higher-rank
src/Syntax.hs
bsd-3-clause
8,154
0
17
2,416
4,261
2,164
2,097
212
6
module Main where import Options.Applicative main :: IO () main = getOpts >>= printArg printArg :: String -> IO () printArg "" = printArg "y" printArg arg = putStrLn arg >> printArg arg getOpts :: IO String getOpts = execParser $ info (helper <*> args) (fullDesc <> header "yes - output a strin...
DavidTruby/haskell-coreutils
src/yes.hs
bsd-3-clause
514
0
10
117
151
76
75
15
1