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
-- © 2002 Peter Thiemann module WASH.CGI.StateItem where import Data.Char -- -- |type of handles to a PE of type @a@ data T a = T String Int | Tvirtual { tvirtual :: a } instance Show (T a) where showsPrec _ (T s i) = showChar 'T' . shows s . shows i showsPrec _ (Tvirtual _) = showChar 'V' instance Read (T a) wh...
nh2/WashNGo
WASH/CGI/StateItem.hs
bsd-3-clause
574
0
13
154
233
123
110
14
0
-- | -- Module: $Header$ -- Description: Implementation of internal command named version -- Copyright: (c) 2018-2020 Peter Trško -- License: BSD3 -- -- Maintainer: peter.trsko@gmail.com -- Stability: experimental -- Portability: GHC specific language extensions. -- -- Implementation of internal command n...
trskop/command-wrapper
command-wrapper/src/CommandWrapper/Toolset/InternalSubcommand/Version.hs
bsd-3-clause
11,390
0
21
2,759
2,729
1,528
1,201
-1
-1
module Main (main) where import Cudd import Prop import Control.Monad (guard) import Data.List (sort) import System.Mem (performGC) import Text.Printf (printf) isPermutationOf :: [Int] -> [Int] -> Bool isPermutationOf vs vs' = sort vs == sort vs' implies :: Prop -> Prop -> Prop implies p q = PNot p `POr` q conjoi...
bradlarsen/hs-cudd
test/SlidingTile.hs
bsd-3-clause
2,917
0
16
808
1,011
523
488
63
3
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE TemplateHaskell #-} module Mapnik.Color ( Color(..) , parse , toText , colorParser ) where import Mapnik.Imports import Mapnik.Util import Data.Monoid import Data.Word import Data.Text (Text) import Data.T...
albertov/hs-mapnik
pure/src/Mapnik/Color.hs
bsd-3-clause
7,184
0
18
1,991
3,247
2,081
1,166
204
1
{-# LANGUAGE CPP #-} module Options.Applicative.Help.Chunk ( mappendWith , Chunk(..) , chunked , listToChunk , (<<+>>) , (<</>>) , vcatChunks , vsepChunks , isEmpty , stringChunk , paragraph , extractChunk , tabulate ) where import Control.Applicative import Control.Monad import Data.Maybe ...
thielema/optparse-applicative
Options/Applicative/Help/Chunk.hs
bsd-3-clause
3,939
0
11
820
978
534
444
73
1
{-- --- Day 4: The Ideal Stocking Stuffer --- Santa needs help mining some AdventCoins (very similar to bitcoins) to use as gifts for all the economically forward-thinking little girls and boys. To do this, he needs to find MD5 hashes which, in hexadecimal, start with at least five zeroes. The input to the MD5 hash i...
hlmerscher/advent-of-code-2015
src/Day4.hs
bsd-3-clause
1,766
0
13
481
241
128
113
20
2
{-# LANGUAGE OverloadedStrings #-} module Trello.Request ( getBoardById , getCardById , getListById , getMemberById , getCardsByBoardId , getListsByBoardId , getMembersByBoardId ) where import Trello.Data import Control.Applicative ((<$>), (<*>)) import Control.Monad ...
vamega/haskell-trello
src/Trello/Request.hs
bsd-3-clause
3,115
0
11
580
1,010
552
458
59
1
module FindFlowCover where import Control.Monad.ST import Control.Monad.ST.Unsafe import Data.Array.MArray (getElems) import Grid (initG, updateCoord, Coord, Direction) import FindTrails -- | Solve the Grid used depth wise back tracking search searchForTrails :: Grid -> [FTrail] searchForTrails (Grid size endpoints...
habbler/GridFlowCover
src/FindFlowCover.hs
bsd-3-clause
2,416
0
18
763
511
273
238
33
3
-------------------------------------------------------------------------------- -- | Pretty print LLVM IR Code. -- module Llvm.PpLlvm ( -- * Top level LLVM objects. ppLlvmModule, ppLlvmComments, ppLlvmComment, ppLlvmGlobals, ppLlvmGlobal, ppLlvmAliases, ppLlvmAlias, ppLlvmMetas, ...
lukexi/ghc-7.8-arm64
compiler/llvmGen/Llvm/PpLlvm.hs
bsd-3-clause
16,501
0
18
4,684
4,515
2,205
2,310
302
14
c2n :: Num a => Char -> a c2n x = case x of '0' -> 0 '1' -> 1 '2' -> 2 '3' -> 3 '4' -> 4 '5' -> 5 '6' -> 6 '7' -> 7 '8' -> 8 '9' -> 9 main :: IO () main = print . sum [c2n x | x <- show (2 ^ 1000)]
tricorder42/project-euler
16_sum_digits_power/16_sum_digits_power.hs
bsd-3-clause
277
0
12
141
135
67
68
14
10
module CVSU.Edges ( Orientation(..) , Edge(..) , EdgeImage(..) , allocEdgeImage , createEdgeImage ) where import CVSU.Bindings.Types import CVSU.Bindings.PixelImage import CVSU.Bindings.Edges import CVSU.PixelImage import Foreign.Ptr import Foreign.ForeignPtr import Foreign.C.Types import Foreign.Marshal.Array import...
amnipar/hs-cvsu
CVSU/Edges.hs
bsd-3-clause
3,993
0
22
1,007
1,340
729
611
124
4
import Cookbook.Essential.IO import Cookbook.Project.Preprocess.Preprocess import Cookbook.Recipes.Sanitize import Cookbook.Ingredients.Tupples.Look import Cookbook.Essential.Continuous import Cookbook.Ingredients.Lists.Modify import Cookbook.Ingredients.Lists.Replace import System.IO import System.Environment import ...
natepisarski/WriteUtils
preprocess.hs
bsd-3-clause
856
0
17
118
281
146
135
22
1
{-# LANGUAGE RankNTypes, TypeOperators, DefaultSignatures #-} -- | Compare to indexed.Control.Comonad.Indexed (IxComonad) module MHask.Indexed.Comonad where import MHask.Arrow import qualified MHask.Indexed.Functor as MHask import qualified MHask.Indexed.Duplicate as MHask import qualified MHask.Indexed.Copointe...
DanBurton/MHask
MHask/Indexed/Comonad.hs
bsd-3-clause
1,470
0
13
316
461
249
212
21
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE Safe #-} module Data.Hexagon.LineDraw (lineDraw) where import Control.Lens.Review import Control.Lens.Getter import Data.Hexagon.Distance import Data.Hexagon.Types import qualified Data.Sequence as Seq import ...
alios/hexagon
src/Data/Hexagon/LineDraw.hs
bsd-3-clause
2,463
0
15
779
795
426
369
41
3
import qualified Data.ByteString.Char8 as BLC import System.Environment (getArgs, getExecutablePath) import qualified System.Log.Logger as L import Control.Distributed.Task.TaskSpawning.DeployFullBinary import Control.Distributed.Task.Types.TaskTypes import Control.Distributed.Task.Util.Configuration import Control.Di...
michaxm/task-distribution
object-code-app/RemoteExecutor.hs
bsd-3-clause
946
0
12
133
228
125
103
26
2
{-# LANGUAGE CPP #-} -- | Prelude replacement -- Remember to import Prelude () if using this module Util.Prelewd ( module Prelude , module Control.Applicative , module Control.Monad , module Data.Bool , module Data.Eq , ...
cgaebel/GPG-Chat
src/Util/Prelewd.hs
bsd-3-clause
9,213
4
12
3,763
2,554
1,460
1,094
233
3
{-# OPTIONS -Wall -Werror -cpp #-} -- | POSIX time, if you need to deal with timestamps and the like. -- Most people won't need this module. module Data.Time.Clock.POSIX ( posixDayLength,POSIXTime,posixSecondsToUTCTime,utcTimeToPOSIXSeconds,getPOSIXTime ) where import Data.Time.Clock.UTC import Data.Time.Calendar.Da...
FranklinChen/hugs98-plus-Sep2006
packages/time/Data/Time/Clock/POSIX.hs
bsd-3-clause
1,904
4
12
272
291
167
124
25
1
{-# LANGUAGE TemplateHaskell, OverloadedStrings #-} ----------------------------------------------------------------------------- -- -- Module : Tests -- Copyright : (c) Juergen Nicklisch-Franken, Hamish Mackenzie -- License : GNU-GPL -- -- Maintainer : <maintainer at leksah.org> -- Stability : provi...
JPMoresmau/leksah
tests/Tests.hs
gpl-2.0
3,023
0
13
588
536
308
228
44
1
-- Module : Network.AWS.RDS -- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com> -- License : This Source Code Form is subject to the terms of -- the Mozilla Public License, v. 2.0. -- A copy of the MPL can be found in the LICENSE file or -- you can obt...
kim/amazonka
amazonka-rds/gen/Network/AWS/RDS.hs
mpl-2.0
6,839
0
5
740
925
682
243
121
0
{- Copyright 2014 Google Inc. 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 applicable law or agreed to in ...
chpatrick/clang-lens
src/Language/C/Clang/Location.hs
apache-2.0
943
0
5
148
78
52
26
-1
-1
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="es-ES"> <title>Customizable HTML Report</title> <maps> <homeID>top</homeID> <mapref lo...
veggiespam/zap-extensions
addOns/customreport/src/main/javahelp/org/zaproxy/zap/extension/customreport/resources/help_es_ES/helpset_es_ES.hs
apache-2.0
970
79
66
158
411
208
203
-1
-1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Package -- Copyright : Isaac Jones 2003-2004 -- License : BSD3 -- -- Maintainer : ca...
edsko/cabal
Cabal/src/Distribution/Package.hs
bsd-3-clause
7,999
0
13
1,568
1,501
835
666
129
1
module Servant.Swagger.Internal.TypeLevel ( module Servant.Swagger.Internal.TypeLevel.API, module Servant.Swagger.Internal.TypeLevel.Every, module Servant.Swagger.Internal.TypeLevel.TMap, ) where import Servant.Swagger.Internal.TypeLevel.API import Servant.Swagger.Internal.TypeLevel.Every imp...
dmjio/servant-swagger
src/Servant/Swagger/Internal/TypeLevel.hs
bsd-3-clause
374
0
5
54
62
47
15
7
0
{-# LANGUAGE ScopedTypeVariables, TemplateHaskell #-} module Main where -------------------------------------------------------------------------- -- imports import Test.QuickCheck import Text.Show.Functions import Data.List ( sort , group , nub , (\\) ) import Control.Monad ( liftM , liftM2 ) impo...
nh2/quickcheck
examples/Set.hs
bsd-3-clause
5,702
0
18
1,666
2,330
1,183
1,147
139
6
-- -- (c) The University of Glasgow -- {-# LANGUAGE DeriveDataTypeable #-} module Avail ( Avails, AvailInfo(..), availsToNameSet, availsToNameSetWithSelectors, availsToNameEnv, availName, availNames, availNonFldNames, availNamesWithSelectors, availFlds, stableAvailCmp ) where im...
AlexanderPankiv/ghc
compiler/basicTypes/Avail.hs
bsd-3-clause
6,603
0
15
1,918
1,045
555
490
81
1
{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE OverloadedStrings #-} module TcRnExports (tcRnExports) where import HsSyn import PrelNames import RdrName import TcRnMonad import TcEnv import TcMType import TcType import RnNames import RnEnv import ErrUtils import Id import IdInfo import Module...
olsner/ghc
compiler/typecheck/TcRnExports.hs
bsd-3-clause
33,896
1
21
10,496
6,438
3,282
3,156
478
16
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.LHC -- Copyright : Isaac Jones 2003-2007 -- License : BSD3 -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- This is a fairly large module. It...
enolan/cabal
Cabal/Distribution/Simple/LHC.hs
bsd-3-clause
33,686
0
25
9,551
7,524
3,925
3,599
597
6
{-| Module : CSH.Eval.Frontend.Data Description : Yesod data declarations for the EvalFrontend site Copyright : Stephen Demos, Matt Gambogi, Travis Whitaker, Computer Science House 2015 License : MIT Maintainer : pvals@csh.rit.edu Stability : Provisional Portability : POSIX Defines the web application la...
robgssp/csh-eval
src/CSH/Eval/Frontend/Data.hs
mit
3,013
0
14
724
441
236
205
53
1
{-# LANGUAGE StandaloneDeriving, DeriveGeneric #-} module SizedSeq ( SizedSeq(..) , emptySS , addToSS , addListToSS , ssElts , sizeSS ) where import Prelude -- See note [Why do we import Prelude here?] import Control.DeepSeq import Data.Binary import Data.List import GHC.Generics data SizedSeq a = Sized...
sdiehl/ghc
libraries/ghci/SizedSeq.hs
bsd-3-clause
1,176
0
9
237
464
238
226
35
1
module C4 where import D4 instance SameOrNot Double where isSameOrNot a b = a ==b isNotSame a b = a /=b myFringe:: Tree a -> [a] myFringe (Leaf x ) = [x] myFringe (Branch left right) = myFringe left
kmate/HaRe
old/testing/renaming/C4_TokOut.hs
bsd-3-clause
216
0
7
56
94
49
45
8
1
module A1 where import C1 import D1 sumSq xs = ((sum (map (sq sq_f) xs)) + (sumSquares xs)) + (sumSquares1 xs) main = sumSq [1 .. 4]
kmate/HaRe
old/testing/addOneParameter/A1_AstOut.hs
bsd-3-clause
147
2
13
41
77
42
35
7
1
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="en-GB"> <title>Form Handler | ZAP Extension</title> <maps> <homeID>top</homeID> ...
veggiespam/zap-extensions
addOns/formhandler/src/main/javahelp/org/zaproxy/zap/extension/formhandler/resources/help/helpset.hs
apache-2.0
986
82
67
172
423
216
207
-1
-1
{-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wall #-} -- | Bug(?) in Coercible constraint solving module T13083 where import Data.Kind import GHC.Generics (Par1(..),(:*:)(..)) import GHC.Exts (coerce) -- Representation as free vector space type...
sdiehl/ghc
testsuite/tests/typecheck/should_compile/T13083.hs
bsd-3-clause
1,966
0
9
494
271
167
104
-1
-1
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} {-# LANGUAGE TypeFamilies, FlexibleInstances, UndecidableInstances, FlexibleContexts #-} class A a class B a where b :: a -> () instance A a => B a where b = undefined newtype Y a = Y (a -> ()) okIn701 :: B a => Y a okIn701 = wrap $ const () . b okIn702 :: B a => ...
ghc-android/ghc
testsuite/tests/indexed-types/should_compile/T5002.hs
bsd-3-clause
661
0
11
160
298
156
142
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} -- | C code generator. This module can convert a correct ImpCode -- program to an equivalent C program. module Futhark.CodeGen.Backends.MulticoreC ( compileProg, generateContext, GC.CParts (..), GC.asLibrary...
HIPERFIT/futhark
src/Futhark/CodeGen/Backends/MulticoreC.hs
isc
27,204
0
21
7,733
5,231
2,883
2,348
432
3
{-# LANGUAGE DeriveFunctor #-} module Game.TurnCounter ( TurnCounter (..) , newTurnCounter , nextTurn, nextTurnWith , previousTurn, previousTurnWith , currentPlayer , nextPlayer , previousPlayer , currentRound ) where import Data.List (find) data TurnCounter p = TurnCounter { tcPlayers :: [p] ...
timjb/halma
halma/src/Game/TurnCounter.hs
mit
1,466
0
11
275
511
270
241
43
1
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE OverloadedStrings #-} import Text.Hamlet (HtmlUrl, hamlet) import Text.Blaze.Html.Renderer.String (renderHtml) import Data.Text (Text) import Yesod data MyRoute = Home render :: MyRoute -> [(Text, Text)] -> Text render Home _ = "/home" footer :: HtmlUrl MyRoute footer = [ham...
cirquit/quizlearner
resources/html/footer.hs
mit
497
0
8
94
128
77
51
14
1
module Grammar.Common.Pretty where import Data.Text (Text) import qualified Data.Text as Text import Grammar.Common.Types textShow :: Show a => a -> Text textShow = Text.pack . show prettyMilestone :: Maybe Division :* Maybe Paragraph -> Text prettyMilestone (Nothing, _) = "" prettyMilestone (Just (Division b c v s ...
ancientlanguage/haskell-analysis
grammar/src/Grammar/Common/Pretty.hs
mit
1,199
0
12
265
499
269
230
-1
-1
module Hahet.Targets.Services where import Hahet.Targets import Hahet.Imports type Started = Maybe Bool data Service = Service Text Started deriving (Typeable, Show) instance Typeable c => Target c Service where targetDesc _ (Service service _) = service targetApply (Service _ Nothing) = return R...
SimSaladin/hahet
src/Hahet/Targets/Services.hs
mit
495
0
10
99
160
82
78
-1
-1
import Network import System.IO import Control.Exception import Control.Concurrent import Control.Concurrent.MVar import Control.Monad import Control.Monad.Fix (fix) type Msg = (Int, String) filename = "primes.log" main :: IO () main = do chan <- newEmptyMVar -- sock <- socket AF_INET Stream 0 -- setSocketOpt...
Joss-Steward/Primality
logger.hs
mit
1,132
0
14
269
399
198
201
33
1
{-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeSynonymInstances #-} import Prelude hiding ((.), id) -- Morphisms type (a ~> b) c = c a b class Category (c :: k -> k -> *) where id :: (a ~> a) c (.) :: (y ~> z) c -> (x ~> y) c -> (x ~> z) c type Hask = (->) instance Category Hask whe...
riwsky/wiwinwlh
src/categories.hs
mit
356
3
11
93
166
94
72
12
0
main= return()
geraldus/transient-universe
app/client/Transient/Move/Services/MonitorService.hs
mit
15
0
6
2
11
5
6
1
1
module Selection where
fatuhoku/haskell-ball-mosaic
src/Selection.hs
mit
24
0
2
4
4
3
1
1
0
module Board where import Data.List (intercalate, unfoldr) data Cell = O | X | E deriving (Read, Show, Eq) data Board = Board [Cell] deriving Eq type Index = Int instance Show Board where show (Board cs) = "\n" ++ intercalate "\n" (map unwords [topRow,midRow,botRow]) ++ "\n" where lst = map show cs ...
mrkgnao/tictactoe-minimax
Board.hs
mit
1,742
0
13
449
675
368
307
-1
-1
{-| Copyright: (c) Guilherme Azzi, 2014 License: MIT Maintainer: ggazzi@inf.ufrgs.br Stability: experimental A 'Monitor' for the CPU activity. This module is meant to be imported qualified, e.g.: > import qualified Reactive.Banana.Monitors.Cpu as Cpu -} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-name-...
ggazzi/hzen
src/Reactive/Banana/Monitors/Cpu.hs
mit
4,494
0
16
1,574
823
452
371
78
2
-- chaper3.hs safetail_1 :: [a] -> [a] safetail_1 xs = if null xs then [] else tail xs safetail_2 :: [a] -> [a] safetail_2 xs | null xs = [] | otherwise = tail xs safetail_3 :: [a] -> [a] safetail_3 [] = [] safetail_3 (_:xs) = xs
hnfmr/fp101x
playground/chapter3.hs
mit
279
0
8
97
129
67
62
10
2
-- | Core functionality of the package. Import from either "System.Console.Ansigraph" or -- "System.Console.Ansigraph.Core". module System.Console.Ansigraph.Internal.Core where import System.Console.ANSI import System.IO (hFlush, stdout) import Control.Monad.IO.Class (MonadIO, liftIO) -- for GHC <= 7.8 import Contro...
BlackBrane/ansigraph
src/System/Console/Ansigraph/Internal/Core.hs
mit
5,951
0
10
1,149
1,080
572
508
79
1
module DevelMain where import Control.Concurrent import Control.Exception (finally) import Control.Monad ((>=>)) import Data.IORef import Data.Time.Clock import Foreign.Store import GHC.Word import Main import N...
yamadapc/git-issues
src/DevelMain.hs
mit
2,358
0
16
739
530
261
269
49
2
module PerfectNumbers (classify, Classification(..)) where data Classification = Deficient | Perfect | Abundant deriving (Eq, Show) classify :: Int -> Maybe Classification classify = error "You need to implement this function."
exercism/xhaskell
exercises/practice/perfect-numbers/src/PerfectNumbers.hs
mit
230
0
6
33
60
35
25
4
1
{-# LANGUAGE OverloadedStrings #-} -- Copyright (C) 2009-2011 John Millikin <jmillikin@gmail.com> -- -- 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 -- a...
tmishima/haskell-dbus
examples/introspect.hs
gpl-3.0
3,638
10
17
723
1,099
529
570
78
3
{- This is the bootstrapping compiler for the Bzo programming language. Copyright (C) 2020 Charles Rosenbauer 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 y...
charlesrosenbauer/Bzo-Compiler
src/BzoChecker.hs
gpl-3.0
24,237
0
21
6,661
9,377
4,845
4,532
396
16
{-# LANGUAGE NoImplicitPrelude, FlexibleContexts, OverloadedStrings, TypeFamilies, Rank2Types, PatternGuards, RecordWildCards #-} module Lamdu.Sugar.Convert.Binder ( convertBinder, convertLam ) where import Prelude.Compat import Control.Lens (Lens') import qualified Control.Lens as Lens im...
rvion/lamdu
Lamdu/Sugar/Convert/Binder.hs
gpl-3.0
32,381
0
24
10,650
8,702
4,397
4,305
-1
-1
{-# LANGUAGE RankNTypes #-} module Dep.Ui.Utils.Boxes ( Boxes(),hBoxes,vBoxes,setBoxesSpacing, getBoxChildSizePolicy,setBoxChildSizePolicy, withBoxesSpacing,switchOrientation,Orientation(..) ) where import Control.Exception(throw) import Control.Monad(liftM,filterM) import Data.List(inter...
KommuSoft/dep-software
Dep.Ui.Utils.Boxes.hs
gpl-3.0
7,654
0
18
1,791
2,703
1,411
1,292
148
3
-- 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/Game/Memory/Output/Fancy.hs
gpl-3.0
4,665
0
14
1,032
1,068
555
513
98
1
module Test.RSCoin.Full.Arbitrary ( ) where import Data.Time.Units (TimeUnit, convertUnit, fromMicroseconds) import Test.QuickCheck (Arbitrary (arbitrary), choose) import System.Random ...
input-output-hk/rscoin-haskell
test/Test/RSCoin/Full/Arbitrary.hs
gpl-3.0
971
0
10
277
202
117
85
19
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} -- | -- Module : Network.Google.AdExchangeBuyer -- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozi...
rueshyna/gogol
gogol-adexchange-buyer/gen/Network/Google/AdExchangeBuyer.hs
mpl-2.0
26,009
0
41
5,500
2,687
1,905
782
667
0
{-# LANGUAGE ViewPatterns #-} import qualified Data.Sequence as S enqueue d x (S.viewl -> S.EmptyL) = S.singleton (x, 1) enqueue d x q@(S.viewl -> (top, n) S.:< ss) = let need = top + d in case compare need x of LT -> enqueue d x ss EQ -> ss S.|> (need, n + 1) GT -> q S.|> ...
itsbruce/hackerrank
alg/implementation/beautiful.hs
unlicense
694
3
12
230
380
188
192
20
3
-- Sample Haskell code for a functional approach to the expression problem. -- -- Eli Bendersky [http://eli.thegreenplace.net] -- This code is in the public domain. module Expressions where data Expr = Constant Double | BinaryPlus Expr Expr stringify :: Expr -> String stringify (Constant c) = show c string...
eliben/code-for-blog
2016/expression-problem/haskell/functional.hs
unlicense
864
0
7
218
140
78
62
11
1
import Data.List parts :: [Integer] -> [[(Integer, Integer)]] parts ps = foldl' f [] (reverse ps) where f [] price = [(price, price)] : [] f result@(cur@((price', maxprice) : _) : rest') price | price > maxprice = [(price, price)] : result ...
pbl64k/CodeSprints
CodeSprint-2012-02-25-Systems/StockTrading/st.accepted.hs
bsd-2-clause
753
7
13
224
400
205
195
11
3
{-# LANGUAGE OverloadedStrings #-} module Handler.TimesGallery where import Import import qualified Data.Map as M import Andon.Types import Andon.ClassData import Andon.Gallery getTimesGalleryR :: OrdInt -> Handler RepHtml getTimesGalleryR times = defaultLayout $ do setTitle $ toHtml $ "Gallery " ++ show times ...
amutake/andon-yesod
Handler/TimesGallery.hs
bsd-2-clause
416
0
10
69
108
59
49
12
1
{-# LANGUAGE FlexibleInstances #-} import Test.Framework (defaultMain) import Data.Object.Json import Data.Object import Test.Framework.Providers.HUnit import Test.Framework.Providers.QuickCheck2 (testProperty) import Test.HUnit hiding (Test) import Test.QuickCheck (Arbitrary (..), oneof) import Control.Applicative im...
snoyberg/data-object-json
runtests.hs
bsd-2-clause
2,098
2
15
770
524
274
250
54
1
module Main (main) where import Control.Monad (when) import Bankotrav.Formatting import Bankotrav.Random import Bankotrav.Compression main :: IO () main = do putStrLn "Generating random board..." board <- randomBoardIO putStr $ formatBoard board putStrLn "Compressing board..." let idx = compressBoard boar...
Athas/banko
bankotrav/src/bankotrav.hs
bsd-2-clause
556
0
12
98
165
77
88
17
1
module Hint.GHC ( module GHC, module Outputable, module ErrUtils, Message, module Pretty, module DriverPhases, module StringBuffer, module Lexer, module Parser, module DynFlags, module FastString, #if __GLASGOW_HASKELL__ >= 610 module Control.Monad.Ghc, module HscTypes, ...
flowbox-public/hint
src/Hint/GHC.hs
bsd-3-clause
2,033
0
6
441
340
238
102
26
0
-- 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. {-# LANGUAGE GADT...
facebookincubator/duckling
Duckling/Numeral/FA/Rules.hs
bsd-3-clause
6,842
0
18
1,649
2,031
1,184
847
206
6
{- ----------------------------------------------------------------------------- -- -- (c) The University of Glasgow 2001-2003 -- -- Access to system tools: gcc, cp, rm etc -- ----------------------------------------------------------------------------- -} {-# LANGUAGE CPP, ScopedTypeVariables #-} module SysTools ( ...
bitemyapp/ghc
compiler/main/SysTools.hs
bsd-3-clause
63,869
66
22
21,351
11,339
5,780
5,559
920
13
{-# LANGUAGE GeneralizedNewtypeDeriving,FlexibleInstances,MultiParamTypeClasses,UndecidableInstances #-} module Counter (CounterT(CounterT), runCounterT, getAndInc) where import Control.Applicative import Control.Monad.Trans import Control.Monad.Reader import Control.Monad.Writer import Control.Monad.State newtype C...
olsner/m3
Counter.hs
bsd-3-clause
1,122
0
10
193
425
222
203
-1
-1
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE LambdaCase #-} module Data.Type.Product.Quote ( qP ) where import Data.Type.Quote import Data.Type.Product import Language.Haskell.TH import Language.Haskell.TH.Quote qP :...
kylcarte/type-combinators-quote
src/Data/Type/Product/Quote.hs
bsd-3-clause
889
0
10
198
281
161
120
28
2
module Playground08 where import qualified Data.Text.All as T -- Using map 8.1 reverseMyDogs :: [[a]] -> [[a]] reverseMyDogs dogs = map reverse dogs filterMyDogs :: [String] -> [String] filterMyDogs dogs = filter (\ x -> (T.toLower (T.pack x)) == (T.toLower ( T.pack "Axel")) ) dogs -- Folding a list 8.4 foldMy...
stefanocerruti/haskell-primer-alpha
src/Playground08.hs
bsd-3-clause
490
0
13
102
220
119
101
11
1
{-# LANGUAGE TypeFamilies, MultiParamTypeClasses, FlexibleInstances, UndecidableInstances, FlexibleContexts, RankNTypes, GADTs #-} module QueryArrow.DBMap where import QueryArrow.DB.DB import QueryArrow.Syntax.Type import QueryArrow.Semantics.TypeChecker import QueryArrow.Config import QueryArrow.Translation i...
xu-hao/QueryArrow
QueryArrow-plugins/src/QueryArrow/DBMap.hs
bsd-3-clause
2,554
0
12
354
486
289
197
46
2
-- | Dyck paths, lattice paths, etc -- -- For example, the following figure represents a Dyck path of height 5 with 3 zero-touches (not counting the starting point, -- but counting the endpoint) and 7 peaks: -- -- <<svg/dyck_path.svg>> -- {-# LANGUAGE BangPatterns #-} module Math.Combinat.LatticePaths where...
chadbrewbaker/combinat
Math/Combinat/LatticePaths.hs
bsd-3-clause
13,782
0
15
3,718
3,311
1,773
1,538
191
4
{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} module Data.Gogol.DatastoreEntity ( EntityTransform(..) , DatastoreEntity(..) , _ToDatast...
jamesthompson/nosql-generic
src/Data/Gogol/DatastoreEntity.hs
bsd-3-clause
8,885
0
17
2,751
2,923
1,510
1,413
-1
-1
{-# LANGUAGE OverloadedStrings, LambdaCase, RankNTypes #-} module Main where import Criterion import Criterion.Main import Data.RDF import qualified Data.Text as T -- The `bills.102.rdf` XML file is needed to run this benchmark suite -- -- $ wget https://www.govtrack.us/data/rdf/bills.102.rdf.gz -- $ gzip -d bills.1...
jutaro/rdf4h
bench/MainCriterion.hs
bsd-3-clause
5,204
0
18
992
1,805
951
854
84
2
-- | Context-free grammars. {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} module Data.Cfg.Cfg( -- * Class Cfg(..), -- * Vocabulary V(..), Vs, isNT, isT, vocabulary, usedVocabulary, undeclaredVocabulary, isFully...
nedervold/context-free-grammar
src/Data/Cfg/Cfg.hs
bsd-3-clause
5,238
0
11
1,313
1,366
728
638
88
1
module Passman.Engine.KeyDerivationSpec where import Test.Hspec (Spec, describe, it) import Test.Hspec.Expectations.Pretty import qualified Passman.Engine.ByteString as B import Passman.Engine.KeyDerivation k :: String -> Key k = Key . B.fromString pbkdf2Salt :...
chwthewke/passman-hs
test/Passman/Engine/KeyDerivationSpec.hs
bsd-3-clause
6,604
0
12
2,022
1,920
1,162
758
106
1
module Day10 where import Data.List repeatLookAndSay :: Int -> String -> String repeatLookAndSay n = (!! n) . iterate lookAndSay lookAndSay :: String -> String lookAndSay = (>>= say) . group where say g = show (length g) ++ take 1 g
patrickherrmann/advent
src/Day10.hs
bsd-3-clause
237
0
10
46
91
49
42
7
1
{-# LANGUAGE DeriveDataTypeable #-} -- | The central type in TagSoup module Text.HTML.TagSoup.Type( -- * Data structures and parsing StringLike, Tag(..), Attribute, Row, Column, -- * Position manipulation Position(..), tagPosition, nullPosition, positionChar, positionString, -- * Tag identificati...
ndmitchell/tagsoup
src/Text/HTML/TagSoup/Type.hs
bsd-3-clause
4,929
0
13
1,054
1,284
688
596
85
3
{-# LANGUAGE MagicHash #-} -- | -- Module: $HEADER$ -- Description: Splitting numbers in to digits and vice versa. -- Copyright: (c) 2009, 2013, 2014 Peter Trsko -- License: BSD3 -- -- Maintainer: peter.trsko@gmail.com -- Stability: experimental -- Portability: non-portable (MagicHash, uses GHC int...
trskop/hs-not-found
not-found-digits/src/Data/Digits.hs
bsd-3-clause
8,996
0
13
1,741
1,047
619
428
116
3
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS -fno-warn-unused-imports #-} module Main where import Control.Monad (unless) import qualified Data.ByteString.Lazy.Char8 as L import Data.Config.Parser import Data.Config.Types (Config) import Data.Config.Pretty (pretty) import Data.Text (Text) import qualified Data.Text...
afcowie/konvig
tests/RoundTrip.hs
bsd-3-clause
778
0
13
184
226
122
104
25
3
module Ivory.Tower.AST.Init where data Init = Init deriving (Eq, Show, Ord)
GaloisInc/tower
tower/src/Ivory/Tower/AST/Init.hs
bsd-3-clause
80
0
6
15
30
18
12
3
0
{-# LANGUAGE BangPatterns #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Real.CBOR (serialise, deserialise, deserialiseNull) where import Real.Types import Data.Binary.Serialise.CBOR.Class import Data.Binary.Serialise.CBOR.Encoding hiding (Tokens(..)) import Data.Binary.Serialise.CBOR.Decoding import Data.Binary.Se...
thoughtpolice/binary-serialise-cbor
bench/Real/CBOR.hs
bsd-3-clause
18,142
0
36
4,973
6,071
2,919
3,152
441
5
{-# LANGUAGE OverloadedStrings #-} module Site ( app ) where ------------------------------------------------------------------------------ import Control.Applicative import Control.Monad.Trans import Data.ByteString (ByteString) import qualified Data.Text...
faylang/snaplet-fay
example/src/Site.hs
bsd-3-clause
2,933
0
14
742
680
360
320
54
2
{-# Language ScopedTypeVariables #-} module Symmetry.IL.Deadlock where import Data.List import Data.Maybe import Data.Generics import Symmetry.IL.AST as AST import Symmetry.IL.Model import Symmetry.IL.ConfigInfo {- A configuration is deadlocked if 1. Al...
gokhankici/symmetry
checker/src/Symmetry/IL/Deadlock.hs
mit
3,198
0
17
1,070
1,117
589
528
48
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-kms/gen/Network/AWS/KMS/Decrypt.hs
mpl-2.0
5,498
0
11
1,183
683
413
270
76
1
{-# LANGUAGE LambdaCase #-} foo = f >>= \case Just h -> loadTestDB (h ++ "/.testdb") Nothing -> fmap S.Right initTestDB {-| Is the alarm set - i.e. will it go off at some point in the future even if `setAlarm` is not called? -} isAlarmSetSTM :: AlarmClock -> STM Bool isAlarmSetSTM AlarmClock{..} = rea...
mpickering/ghc-exactprint
tests/examples/ghc710/LambdaCase.hs
bsd-3-clause
405
2
11
88
104
52
52
-1
-1
{-# LANGUAGE DeriveDataTypeable, ScopedTypeVariables #-} -- | -- Module : Scion.Configure -- Copyright : (c) Thomas Schilling 2008 -- License : BSD-style -- -- Maintainer : nominolo@googlemail.com -- Stability : experimental -- Portability : portable -- module Scion.Configure where import Scion.Types imp...
CristhianMotoche/scion
lib/Scion/Configure.hs
bsd-3-clause
6,450
0
20
1,567
1,246
666
580
113
3
module Data.Binary.Strict.BitUtil ( topNBits , bottomNBits , leftShift , rightShift , leftTruncateBits , rightTruncateBits ) where import Data.Word (Word8) import qualified Data.ByteString as B import Data.Bits (shiftL, shiftR, (.|.), (.&.)) -- | This is used for masking the last byte of a ByteString so...
KrzyStar/binary-low-level
src/Data/Binary/Strict/BitUtil.hs
bsd-3-clause
2,221
0
13
505
755
407
348
50
1
{-# LANGUAGE OverloadedStrings #-} module Server.Protocol where import Data.Aeson import Language.Parser.Errors ( ImprovizCodeError(..) ) data ImprovizResponse = ImprovizOKResponse String | ImprovizErrorResponse String | ImprovizCodeErrorResponse [ImprovizCodeError] deriving (Sho...
rumblesan/improviz
src/Server/Protocol.hs
bsd-3-clause
666
0
8
121
167
95
72
16
0
{-# LANGUAGE CPP, LambdaCase, BangPatterns, MagicHash, TupleSections, ScopedTypeVariables #-} {-# OPTIONS_GHC -w #-} -- Suppress warnings for unimplemented methods ------------- WARNING --------------------- -- -- This program is utterly bogus. It takes a value of type () -- and unsafe-coerces it to a function, and a...
mcschroeder/ghc
testsuite/tests/stranal/should_compile/T9208.hs
bsd-3-clause
3,414
0
15
821
967
517
450
65
4
module HList ( H , repH , absH ) where type H a = [a] -> [a] -- {-# INLINE repH #-} repH :: [a] -> H a repH xs = (xs ++) -- {-# INLINE absH #-} absH :: H a -> [a] absH f = f [] -- -- Should be in a "List" module -- {-# RULES "++ []" forall xs . xs ++ [] = xs #-} -- {-# RULES "++ strict...
ku-fpg/hermit
examples/reverse/HList.hs
bsd-2-clause
633
0
6
228
96
59
37
9
1
{-# LANGUAGE PatternSynonyms #-} {- | Copyright : Copyright (C) 2006-2018 Bjorn Buckwalter License : BSD3 Maintainer : bjorn@buckwalter.se Stability : Stable Portability: GHC only This module provides types and functions for manipulating unit names. Please note that the details of the name repre...
bjornbm/dimensional
src/Numeric/Units/Dimensional/UnitNames.hs
bsd-3-clause
1,146
4
5
193
145
105
40
13
0
{-# LANGUAGE Rank2Types #-} module Main where -- order of imports analogous to cabal build-depends -- base import System.Environment(getArgs) import Data.IORef import Control.Monad ((=<<)) -- gtk import Graphics.UI.Gtk hiding (get) -- hint import Language.Haskell.Interpreter hiding ((:=),set,get) -- astview-util...
RefactoringTools/HaRe
hareview/src/Main.hs
bsd-3-clause
1,281
0
14
220
282
156
126
27
4
----------------------------------------------------------------------------- -- | -- Module : RefacUnfoldAsPatterns -- Copyright : (c) Christopher Brown 2007 -- -- Maintainer : cmb21@kent.ac.uk -- Stability : provisional -- Portability : portable -- -- This module contains a transformation for HaRe. -- ...
kmate/HaRe
old/refactorer/RefacUnfoldAsPatterns.hs
bsd-3-clause
17,830
0
21
6,553
5,677
2,907
2,770
-1
-1
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_HADDOCK show-extensions #-} -- | -- Module : Yi.Mode.IReader -- License : GPL-2 -- Maintainer : yi-devel@googlegroups.com -- Stability : experimental -- Portability : portable -- -- A simple text mode; it does very little besides define a comment -- synta...
siddhanathan/yi
yi-ireader/src/Yi/Mode/IReader.hs
gpl-2.0
1,427
0
14
299
296
173
123
26
1
{-# LANGUAGE TemplateHaskell, DeriveDataTypeable, DeriveGeneric #-} {-# LANGUAGE RecordWildCards #-} import Control.Distributed.Process hiding (Message, mask, finally, handleMessage, proxy) import Control.Distributed.Process.Closure import Control.Concurrent.Async import Control.Monad.IO.Class import Control.Monad im...
prt2121/haskell-practice
parconc/distrib-chat/chat.hs
apache-2.0
10,981
24
18
2,956
3,228
1,599
1,629
248
8
module Data.Foo where foo :: Int foo = undefined fibonacci :: Int -> Integer fibonacci n = fib 1 0 1 where fib m x y | n == m = y | otherwise = fib (m+1) y (x + y)
yuga/ghc-mod
test/data/ghc-mod-check/Data/Foo.hs
bsd-3-clause
187
0
10
64
94
48
46
8
1
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts, GADTs #-} module FDsFromGivens where class C a b | a -> b where cop :: a -> b -> () data KCC where KCC :: C Char Char => () -> KCC {- Failing, as it righteously should! g1 :: (C Char [a], C Char Bool) => a -> () g1 x = () -} ...
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/typecheck/should_fail/FDsFromGivens.hs
bsd-3-clause
385
0
9
104
102
56
46
9
1
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-} -- Tests the special case of -- non-recursive, function binding, -- with no type signature module ShouldCompile where f = \ (x :: forall a. a->a) -> (x True, x 'c') g (x :: forall a. a->a) = x
wxwxwwxxx/ghc
testsuite/tests/typecheck/should_compile/tc194.hs
bsd-3-clause
247
0
9
49
70
41
29
4
1
{-source: http://overtond.blogspot.sg/2008/07/pre.html-} runTest = runFD test test = do x <- newVar [0..3] y <- newVar [0..3] ((x .<. y) `mplus` (x `same` y)) x `hasValue` 2 labelling [x, y]
calvinchengx/learnhaskell
constraints/constraint.hs
mit
214
0
10
53
94
50
44
7
1
{-# LANGUAGE ExtendedDefaultRules #-} {-# LANGUAGE OverloadedStrings #-} module View where import Lucid index :: Html () -> Html () index bd = head_ $ do head_ hd body_ bd hd :: Html () hd = do meta_ [charset_ "utf-8"] meta_ [name_ "viewport", content_ "width=device-width, initial-scale=1"] t...
muhbaasu/pfennig-server
src/Pfennig/View.hs
mit
4,510
0
18
1,282
1,029
473
556
106
1
module Glob (namesMatching) where import System.Directory (doesDirectoryExist, doesFileExist, getCurrentDirectory, getDirectoryContents) import System.FilePath (dropTrailingPathSeparator, splitFileName, (</>)) import Control.Exception (handle) import Control.Monad (forM) import GlobRegex (matchesGlob, matchesGlobCs) ...
cirquit/Personal-Repository
Haskell/RWH/Regex/Glob.hs
mit
3,249
0
21
1,439
627
330
297
51
5