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
{-# LANGUAGE RecordWildCards #-} module TextBuffer where import qualified Data.Sequence as S import qualified Data.Text as T import Data.Foldable as F import Data.Char -- import Data.Maybe -- import Debug.Trace -- import Text.Printf import Prelude as P data Cursor = Cursor { preferredCol :: Int ,...
polygonhell/textEditor
src/TextBuffer.hs
bsd-3-clause
9,418
0
19
2,099
3,906
2,093
1,813
206
4
{-# LANGUAGE NondecreasingIndentation #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE CPP #-} -- | This is the driver for the 'ghc --backpack' mode, which -- is a reimplementation of the "package manager" bits of -- Backpack directly in GHC. The basic method of operation -- i...
mettekou/ghc
compiler/backpack/DriverBkp.hs
bsd-3-clause
32,927
0
29
10,087
7,101
3,642
3,459
536
8
{-# LANGUAGE NoMonomorphismRestriction #-} --{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE RankNTypes #-} module Utils...
divipp/lensref
src/Utils.hs
bsd-3-clause
9,990
0
17
2,313
3,481
1,791
1,690
210
4
{-# LANGUAGE MultiParamTypeClasses ,FunctionalDependencies ,FlexibleInstances ,FlexibleContexts ,GeneralizedNewtypeDeriving ,TypeSynonymInstances ,TypeOperators ,ParallelListComp ,BangPatterns #-} {-# OPTIONS -cpp #-} ...
rbonifacio/funsat
src/Funsat/Solver.hs
bsd-3-clause
36,910
0
26
10,672
8,457
4,449
4,008
-1
-1
----------------------------------------------------------------------------- -- | -- Module : Control.Distributed.Process.Platform.UnsafePrimitives -- Copyright : (c) Tim Watson 2013 -- License : BSD3 (see the file LICENSE) -- -- Maintainer : Tim Watson <watson.timothy@gmail.com> -- Stability : expe...
haskell-distributed/distributed-process-platform
src/Control/Distributed/Process/Platform/UnsafePrimitives.hs
bsd-3-clause
2,083
0
11
348
366
207
159
31
2
----------------------------------------------------------------------------- -- -- Module : Language.Elm.TH.HToE -- Copyright : Copyright: (c) 2011-2013 Joey Eremondi -- License : BSD3 -- -- Maintainer : joey.eremondi@usask.ca -- Stability : experimental -- Portability : portable -- -- | -- -------...
JoeyEremondi/haskelm-old
src/Language/Elm/TH/HToE.hs
bsd-3-clause
27,478
0
17
5,576
7,687
3,820
3,867
-1
-1
module Random.IntervalSet where import Data.Interval as I import Data.IntervalSet as IS import Data.Foldable import Data.Monoid import Data.Random import Data.Random.Distribution.Exponential subintervals ::Interval ->Double ->Double ->RVar [Interval] subintervals (Interval a b) p n = do lp ::Double <-exponen...
ian-mi/interval-set
benchmarks/Random/IntervalSet.hs
bsd-3-clause
826
0
14
244
314
159
155
-1
-1
{-# OPTIONS_GHC -w #-} {-# LANGUAGE BangPatterns #-} -- required for versions of Happy before 1.18.6 {-# OPTIONS -Wwarn -w #-} -- The above warning supression flag is a temporary kludge. -- While working on this module you are encouraged to remove it and fix -- any warnings in the module. See -- http://ghc.haskell....
FranklinChen/IHaskell
ghc-parser/src-7.8.3/Language/Haskell/GHC/HappyParser.hs
mit
1,032,876
28,710
152
139,809
316,998
171,471
145,527
26,888
146
module PrimeList where data PrimeList = P2 | P3 | P5 | P7 deriving (Show, Eq, Read, Ord, Enum, Bounded) toPrime :: PrimeList -> Integer toPrime strP = read $ tail $ show $ strP :: Integer
mino2357/Hello_Haskell
vector2018-02-28.hsproj/PrimeList.hs
mit
191
0
7
40
79
44
35
5
1
{- | Module : ./CSMOF/Print.hs Description : pretty printing for CSMOF Copyright : (c) Daniel Calegari Universidad de la Republica, Uruguay 2013 License : GPLv2 or higher, see LICENSE.txt Maintainer : dcalegar@fing.edu.uy Stability : provisional Portability : portable -} module CSMOF.Print where ...
spechub/Hets
CSMOF/Print.hs
gpl-2.0
3,779
0
22
904
1,273
627
646
92
0
module Language.Haskell.GhcMod.Cradle ( findCradle , findCradleWithoutSandbox ) where import Language.Haskell.GhcMod.Types import Language.Haskell.GhcMod.GhcPkg import Control.Applicative ((<$>)) import qualified Control.Exception as E import Control.Exception.IOChoice ((||>)) import Control.Monad (filterM) i...
carlohamalainen/ghc-mod
Language/Haskell/GhcMod/Cradle.hs
bsd-3-clause
3,246
0
13
708
721
389
332
72
3
{-# LANGUAGE OverloadedStrings, TypeFamilies, QuasiQuotes #-} module Papillon (parseAtts) where import Text.Papillon import Data.ByteString.Char8 (ByteString, pack) import qualified Data.ByteString as BS -- import qualified Data.ByteString.Char8 as BSC parseAtts :: BS.ByteString -> Maybe [(BS.ByteString, BS.ByteStr...
YoshikuniJujo/forest
subprojects/xmpipe/Papillon.hs
bsd-3-clause
979
0
10
179
161
98
63
10
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE InstanceSigs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} -- | Infrastructure for KURE-based rewrites on CL expressions module Database.DSH.CL.Kure ( -- * Re-export relevant KURE modules module Language.KURE ...
ulricha/dsh
src/Database/DSH/CL/Kure.hs
bsd-3-clause
16,993
0
17
5,671
5,041
2,581
2,460
333
2
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 TcInstDecls: Typechecking instance declarations -} {-# LANGUAGE CPP #-} module TcInstDcls ( tcInstDecls1, tcInstDecls2 ) where #include "HsVersions.h" import HsSyn import TcBinds import TcTyClsDecls import TcClassDcl( ...
oldmanmike/ghc
compiler/typecheck/TcInstDcls.hs
bsd-3-clause
77,420
5
25
23,694
8,645
4,567
4,078
656
5
-- | This module defines control flow graphs over the LLVM IR. module LLVM.Analysis.CFG ( -- * Types CFG, HasCFG(..), -- * Constructors controlFlowGraph, -- * Accessors basicBlockPredecessors, basicBlockSuccessors ) where import LLVM.Analysis.CFG.Internal
wangxiayang/llvm-analysis
src/LLVM/Analysis/CFG.hs
bsd-3-clause
275
0
5
52
39
28
11
7
0
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances, FlexibleContexts, EmptyDataDecls, ScopedTypeVariables, TypeOperators, TypeSynonymInstances #-} {- In this module we define the basic building blocks -} module Records where data EmptyRecord = EmptyRecord derivi...
vs-team/Papers
Before Giuseppe's PhD/Monads/ObjectiveMonad/MonadicObjects/trunk/Src/Records.hs
mit
1,896
0
12
525
790
423
367
-1
-1
{-# LANGUAGE RecursiveDo #-} module InnerEar.Widgets.Login where import Reflex import Reflex.Dom import Control.Monad import InnerEar.Types.Request import InnerEar.Types.Response import InnerEar.Types.Handle import InnerEar.Types.Utility import InnerEar.Types.User -- | A loginWidget appears as a single line in the ...
d0kt0r0/InnerEar
src/InnerEar/Widgets/Login.hs
gpl-3.0
3,187
0
14
514
863
419
444
56
1
{-# language TypeSynonymInstances, FlexibleInstances #-} module Base.Debugging ( DebuggingCommand, resetDebugging, addDebugging, getDebugging, debugPoint, debugLine, ) where import Data.Initial import Data.IORef import Data.Abelian import System.IO.Unsafe import Graphics.Qt import Physi...
geocurnoff/nikki
src/Base/Debugging.hs
lgpl-3.0
1,717
0
14
333
495
252
243
46
1
{-# OPTIONS_GHC -fno-warn-unused-do-bind -fno-warn-missing-signatures #-} {-# LANGUAGE OverloadedStrings #-} module Main where import qualified Data.Text as T import Control.Concurrent (forkIO, threadDelay) import Control.Monad (forever) import System.Exit ( exitSuccess ) import Graphics.Vty import Graphics.Vty.Widge...
KommuSoft/vty-ui
demos/ProgressBarDemo.hs
bsd-3-clause
1,563
0
18
352
486
251
235
44
1
module Elm.Compiler.Imports (defaults) where import qualified AST.Module as Module import qualified AST.Variable as Var -- DEFAULT IMPORTS (==>) :: a -> b -> (a,b) (==>) = (,) defaults :: [Module.DefaultImport] defaults = [ ["Basics"] ==> Module.ImportMethod Nothing Var.openListing , ["Debug"] ==> Module....
5outh/Elm
src/Elm/Compiler/Imports.hs
bsd-3-clause
707
0
10
121
244
138
106
16
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="ru-RU"> <title> AJAX Паук | ZAP-расширения </title> <maps> <homeID>top</homeID> <mapref...
thc202/zap-extensions
addOns/spiderAjax/src/main/javahelp/org/zaproxy/zap/extension/spiderAjax/resources/help_ru_RU/helpset_ru_RU.hs
apache-2.0
1,019
78
67
160
496
248
248
-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="hr-HR"> <title>Selenium add-on</title> <maps> <homeID>top</homeID> <mapref location="ma...
thc202/zap-extensions
addOns/selenium/src/main/javahelp/org/zaproxy/zap/extension/selenium/resources/help_hr_HR/helpset_hr_HR.hs
apache-2.0
960
77
67
156
411
208
203
-1
-1
-- -- Must have rules off to avoid them making it look lazy when it isn't really -- import Control.Monad import System.Exit import Test.HUnit import qualified Data.ByteString.Lazy as L ------------------------------------------------------------------------ -- The entry point main :: IO () main = do counts <- runTe...
meiersi/bytestring-builder
tests/Units.hs
bsd-3-clause
668
0
14
138
180
97
83
14
1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[NameEnv]{@NameEnv@: name environments} -} {-# LANGUAGE CPP #-} module NameEnv ( -- * Var, Id and TyVar environments (maps) NameEnv, -- ** Manipulating these environments mkNameEnv,...
shlevy/ghc
compiler/basicTypes/NameEnv.hs
bsd-3-clause
5,538
0
11
1,473
1,327
698
629
89
1
----------------------------------------------------------------------------- -- | -- Module : Graphics.Plot -- Copyright : (c) Alberto Ruiz 2005-8 -- License : GPL-style -- -- Maintainer : Alberto Ruiz (aruiz at um dot es) -- Stability : provisional -- Portability : uses gnuplot and ImageMagick -- ...
abakst/liquidhaskell
benchmarks/hmatrix-0.15.0.1/lib/Graphics/Plot.hs
bsd-3-clause
6,046
0
22
1,412
1,721
886
835
102
2
{-# LANGUAGE CPP #-} module Distribution.Compat.Exception ( catchIO, catchExit, tryIO, displayException, ) where import System.Exit import qualified Control.Exception as Exception #if __GLASGOW_HASKELL__ >= 710 import Control.Exception (displayException) #endif tryIO :: IO a -> IO (Either Exception.IOExcept...
mydaum/cabal
Cabal/Distribution/Compat/Exception.hs
bsd-3-clause
631
0
9
101
179
100
79
16
1
-- Tests that subFunTys works when the argument is a type of form (a ty1 ty2) module ShouldCompile where newtype StreamArrow a b c = Str (a [b] [c]) foo = Str $ (\x -> x)
urbanslug/ghc
testsuite/tests/typecheck/should_compile/tc202.hs
bsd-3-clause
175
0
8
39
47
30
17
3
1
{-# LANGUAGE RankNTypes #-} module LayoutType (Layout(..) ,tabbedLayout ,horizontalLayout ,verticalLayout ,tallLayout ,wideLayout) where import Text.PrettyPrint.HughesPJClass import Foreign.C.Types import Tree import WLC data Layout = Layout {getLayout :: forall a. W...
cocreature/reactand
src/LayoutType.hs
isc
3,034
0
18
902
1,037
537
500
76
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} module Scaffolding.Scaffolder (scaffold) where import Control.Arrow ((&&&)) import qualified Data.ByteString.Char8 as S import Data.Conduit (runResourceT, yield, ($$)) import Data.FileEmbed (embe...
piyush-kurur/yesod
yesod/Scaffolding/Scaffolder.hs
mit
2,693
0
16
682
811
415
396
66
2
{-# LANGUAGE BangPatterns, TypeFamilies #-} {-| Module : Rhodium.Contextual Description : Contextual Categories Copyright : (c) Nicolas Godbout, 2015 License : BSD-3 Maintainer : nicolas.godbout@gmail.com Stability : Experimental A Contextual Category is a Category with, in addition: 1) grade :: Ob C ...
DrNico/rhodium
tools/rhc-strap/Rhodium/Contextual.hs
mit
5,531
70
17
1,478
2,439
1,253
1,186
151
2
{-# LANGUAGE DeriveGeneric, TemplateHaskell #-} module Network.Protocol.Message where import Control.DeepSeq import Data.DeriveTH import Data.Int import Data.Serialize import Data.Serialize.Text() import Data.Text (Text) import GHC.Generics (Generic) import TextShow import TextShow.Generic import Util.Vec() protocol...
NCrashed/sinister
src/shared/Network/Protocol/Message.hs
mit
1,532
0
8
237
249
141
108
51
1
-- | The simplest, stupidest possible simplex algorithm. -- The idea here is to be slow, but "obviously correct" so other algorithms -- can be verified against it. -- -- That's the plan, at least. For now this is just a first cut of trying to implement simplex. -- module Numeric.Limp.Solve.Simplex.Maps where import...
amosr/limp
src/Numeric/Limp/Solve/Simplex/Maps.hs
mit
8,545
0
18
2,497
2,380
1,268
1,112
-1
-1
module Sgd.Num.VectorT (main) where import Test.HUnit import qualified Data.Vector.Unboxed as VU import qualified Sgd.Num.Vector as V dot = TestCase $ do assertEqual "dotFS Should work" 10 (V.dotFS (fromList [0, 1,2,3,4]) [(1, 1.0), (3, 3.0)]) assertEqual "dot Should work" 40 (V.dot (...
daz-li/svm_sgd_haskell
test/Sgd/Num/VectorT.hs
mit
848
0
13
207
371
217
154
28
1
{-# LANGUAGE QuasiQuotes, TypeFamilies, TemplateHaskell, MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances #-} module YesodCoreTest.Exceptions (exceptionsTest, Widget) where import Test.Hspec import Yesod.Core hiding (Request) import Network.Wai import Network.Wai.Test import...
piyush-kurur/yesod
yesod-core/test/YesodCoreTest/Exceptions.hs
mit
1,288
0
12
238
361
181
180
37
1
module Triangle (TriangleType(..), triangleType) where import qualified Data.Set as S import Data.List (sort) data TriangleType = Equilateral | Isosceles | Scalene | Illegal deriving (Eq, Read, Show) triangleType :: (Num a, Ord a) => a -> a -> a ...
exercism/xhaskell
exercises/practice/triangle/.meta/examples/success-standard/src/Triangle.hs
mit
607
0
12
183
222
125
97
15
1
module FPGrowth.Transaction (permuteTransaction) where import qualified Data.Set as Set import qualified Data.HashMap.Strict as H import qualified Data.List as List import FPGrowth.Types buildHeaderTable :: Count -> [Transaction] -> Punchcard buildHeaderTable minsup = H.filter (>= minsup) . List...
DM2014/homework2-hs
src/FPGrowth/Transaction.hs
mit
1,163
0
12
239
341
186
155
21
2
module Grails.Parser.PluginDesc ( parse ) where import Text.ParserCombinators.Parsec hiding (parse) import Grails.Parser.Common import Grails.Types (EIO) parse :: FilePath -> EIO String parse = parseFile onlyVersion onlyVersion :: Parser String onlyVersion = try defVersion <|> (anyToken >> onlyVersion)...
mbezjak/grailsproject
src/Grails/Parser/PluginDesc.hs
mit
547
0
8
111
167
86
81
18
1
{-# LANGUAGE TypeOperators , FlexibleContexts #-} module Calculus.Connectives.Simple where import Calculus.Expr import Auxiliary.List import Auxiliary.NameSource import Data.Functor import Data.List import Control.Monad.State type Formula = Expr {- Terms. Func - functional symbol Var - variab...
wowofbob/calculus
Calculus/Connectives/Simple.hs
mit
2,418
0
11
579
743
387
356
-1
-1
{-# LANGUAGE InstanceSigs #-} module Ch26.StateT where newtype StateT s m a = StateT { runStateT :: s -> m (a, s) } instance Functor m => Functor (StateT s m) where fmap f (StateT sma) = StateT $ \s -> fmap (\(a, s') -> (f a, s')) $ sma s instance Monad m => Applicative (StateT s m) where pure a = StateT...
andrewMacmurray/haskell-book-solutions
src/ch26/StateT.hs
mit
739
0
15
205
422
223
199
19
0
module CFDI.Types.Custom where import CFDI.Types.Type import Control.Error.Safe (justErr) import Data.Set (fromList, member) import Text.Read (readMaybe) newtype Custom = Custom Int deriving (Eq, Show) instance Type Custom where parseExpr c = justErr NotInCatalog maybeCustom where mayb...
yusent/cfdis
src/CFDI/Types/Custom.hs
mit
802
0
11
235
338
200
138
18
0
module Data.Logger where -- Logging functionality import Prelude hiding (mod) import Control.Monad.Writer import qualified Data.Map as Map -- below imports available via 1HaskellADay git repository import Control.DList import Data.LookupTable (LookupTable) type Logger m a = WriterT (DList LogEntry) m a say :: ...
geophf/1HaskellADay
exercises/HAD/Data/Logger.hs
mit
1,128
0
16
251
334
191
143
20
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE ViewPatterns #-} -- | This module implements the Patience Diff algorithm. -- -- The code here is heavily based on the "patience" package by -- Keegan McAllister <https://hackage.haskell.org/package/patience> module Control.Biegunka.Patience ( J...
biegunka/biegunka
src/Control/Biegunka/Patience.hs
mit
5,646
0
19
1,546
2,438
1,297
1,141
-1
-1
import Utils.Prime (isPrime, primeGen) main = print problem46Value -- the first positive odd composite integer that is rejected by the conjecture problem46Value :: Integer problem46Value = head [n | n <- [3..], n `mod` 2 == 1, not $ isPrime n, rejected n] -- a number is rejected if there are no primes p <n where (n-...
jchitel/ProjectEuler.hs
Problems/Problem0046.hs
mit
701
0
13
140
218
118
100
9
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-model.html module Stratosphere.Resources.SageMakerModel where import Stratosphere.ResourceImports im...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/SageMakerModel.hs
mit
3,940
0
15
453
624
359
265
53
1
-- Copyright 2015 Mitchell Kember. Subject to the MIT License. -- Project Euler: Problem 7 -- 10001st prime module Problem07 where import Common (primes) solve :: Int solve = primes !! 10000
mk12/euler
haskell/Problem07.hs
mit
194
0
5
35
29
19
10
4
1
{-# LANGUAGE TupleSections #-} {-# OPTIONS -Wall #-} import Control.Concurrent import Control.Exception (catch, throwIO, SomeException(..)) import Control.Monad import Data.List (stripPrefix, sort) import Data.Maybe (fromMaybe, mapMaybe) import Data.Monoid ((<...
Peaker/git-pushq
PushQ.hs
gpl-2.0
6,113
0
18
1,908
1,691
865
826
123
4
-------------------------------------------------------------------------------- -- Copyright (C) 1997, 1998, 2008 Joern Dinkla, www.dinkla.net -------------------------------------------------------------------------------- -- -- see -- Joern Dinkla, Geometrische Algorithmen in Haskell, Diploma Thesis, -- Univ...
smoothdeveloper/GeoAlgLib
src/RBox.hs
gpl-3.0
2,043
0
13
435
918
502
416
34
1
module GameLogic where import Model movePlayer :: Player -> Coord -> Player movePlayer p newPos = p {pPos = newPos} levelPlayer :: Player -> Player levelPlayer p = p { pLevelLimit = newLevelLimit, pExp = newExp, pLevel = newLevel, pMaxHealth = newMaxHp , pHealth = newMaxHp} where newExp = (pExp p) - (pLevelLimit ...
Spacejoker/DDclone
src/GameLogic.hs
gpl-3.0
763
0
11
173
279
148
131
19
1
{-# LANGUAGE ViewPatterns #-} -- https://ghc.haskell.org/trac/ghc/wiki/ViewPatterns module TB.Language.Extensions.ViewPatterns ( Record (..), viewRecCChar, recTest, factorial, searchList ) where import Data.List -- Factorial example viewFactorial :: Int -> Maybe Int viewFactorial n = if n > 0 then Just n...
adarqui/ToyBox
haskell/haskell/language-extensions/src/TB/Language/Extensions/ViewPatterns.hs
gpl-3.0
900
0
9
180
320
174
146
27
2
{-# OPTIONS_GHC -F -pgmF htfpp #-} {- | Module : UtilTest Description : Tests 'Diffr.Util'. Since : 0.1 Authors : William Martin, Jakub Kozlowski License : This file is part of diffr-h. diffr-h is free software: you can redistribute it and/or modify it under the terms of the GNU General ...
diffr/diffr-h
test/Diffr/UtilTest.hs
gpl-3.0
1,527
0
9
326
167
97
70
13
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/UserRolePermissionGroups/Get.hs
mpl-2.0
5,592
0
19
1,298
821
474
347
121
1
{-# LANGUAGE OverloadedStrings, TemplateHaskell, QuasiQuotes, RecordWildCards, DataKinds #-} module Model.AssetSlot ( module Model.AssetSlot.Types , lookupAssetSlot , lookupOrigAssetSlot , lookupAssetAssetSlot , lookupSlotAssets , lookupOrigSlotAssets , lookupContainerAssets , lookupOrigContainerAssets ...
databrary/databrary
src/Model/AssetSlot.hs
agpl-3.0
18,813
0
24
6,371
3,029
1,659
1,370
304
2
binsearch :: Ord a => a -> [a] -> Int binsearch x [] = error "Empty list" binsearch x [y] = 0 binsearch x xs = case (x `elem` xs) of True -> search x 0 (length xs) xs False -> error "Element not in list" -- search -- It takes the element e, lower i and upper boundary j of the ...
romanofski/codesnippets
binSearch/binsearch.hs
unlicense
689
3
12
245
325
152
173
15
2
module Handler.Book where import Import postBookR :: Handler Value postBookR = do book <- (requireJsonBody :: Handler Book) maybeCurrentUserId <- requireAuthId now <- lift getCurrentTime let book' = book { bookCreatedBy = maybeCurrentUserId , bookDateCreated = now } insertedBo...
PKAuth/pkcloud-accounts
src/Handler/Book.hs
apache-2.0
380
0
11
92
98
49
49
11
1
champernowne :: String champernowne = let cnext n = (show n) ++ cnext (n+1) in cnext 1 -- Champernowne digit n cnum :: Int -> Int cnum n = read [champernowne !! (n - 1)] main = do print $ product $ map cnum [1, 10, 100, 1000, 10000, 100000, 1000000]
ulikoehler/ProjectEuler
Euler40.hs
apache-2.0
265
1
12
66
139
68
71
8
1
module Main where import Api (api) import Api.V1 (v1) import Api.V1.Packages (packages) import Services.Packages (listPackages, readPackage, savePackage) import Network.Wai.Handler.Warp (run) main :: IO () main = run 8080 (api $ v1 $ packages listPackages readPackage savePackage)
haskell-serverless/management
app/Main.hs
apache-2.0
283
0
8
38
99
58
41
8
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module PolyCInfer ( Constraint, TypeError(..), Subst(..), inferTop, --constraintsExpr ) where import PolyCEnv import PolyType import PolySyntax import Control.Monad.Except import Control.Mon...
toonn/wyah
src/PolyCInfer.hs
bsd-2-clause
6,924
0
18
1,816
3,141
1,623
1,518
193
10
-- | -- Module : Text.Megaparsec.Char -- Copyright : © 2015–2017 Megaparsec contributors -- © 2007 Paolo Martini -- © 1999–2001 Daan Leijen -- License : FreeBSD -- -- Maintainer : Mark Karpov <markkarpov92@gmail.com> -- Stability : experimental -- Portability : non-port...
recursion-ninja/megaparsec
Text/Megaparsec/Char.hs
bsd-2-clause
13,126
0
15
2,711
2,527
1,387
1,140
210
30
{-# LANGUAGE BangPatterns #-} -- --------------------------------------------------------------------------- -- | -- Module : Data.Vector.Algorithms.Tim -- Copyright : (c) 2013-2015 Dan Doel, 2015 Tim Baumann -- Maintainer : Dan Doel <dan.doel@gmail.com> -- Stability : Experimental -- Portability : Non-porta...
tolysz/vector-algorithms
src/Data/Vector/Algorithms/Tim.hs
bsd-3-clause
14,174
0
16
3,761
3,701
1,893
1,808
209
6
{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE MultiWayIf #-} {-| Module : Servant.Server.Auth.Token.Model Description : Internal operations with RDBMS Copyright : (c) Anton Gushcha, 2016 License : MIT Maintainer : ncrashed@gmail.com Stability : experimental Portability : Portable -} module Servant.Serve...
NCrashed/servant-auth-token
src/Servant/Server/Auth/Token/Model.hs
bsd-3-clause
28,643
0
22
5,218
7,510
3,941
3,569
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TypeOperators #-} module CommonServer where import Data.Aeson import GHC.Generics ------------------------------ -- File Structure ------------------------------ data File = File { fileName :: FilePath, ...
Coggroach/Gluon
.stack-work/intero/intero3163SqV.hs
bsd-3-clause
2,761
0
8
517
511
301
210
75
0
-------------------------------------------------------------------------------- -- | Provides an easy way to combine several items in a list. The applications -- are obvious: -- -- * A post list on a blog -- -- * An image list in a gallery -- -- * A sitemap {-# LANGUAGE TupleSections #-} module Hakyll.Web.Template.Lis...
freizl/freizl.github.com-old
src/Hakyll/Web/Template/List.hs
bsd-3-clause
2,630
0
13
645
457
252
205
36
1
{-# LANGUAGE LambdaCase #-} module Syntax.Parser where import Syntax.Ast import Bound import Control.Applicative import Data.Attoparsec.Text as Attoparsec import Data.Char import Data.List import Data.Monoid import Data.String import qual...
exFalso/lambda
src/lib/Syntax/Parser.hs
bsd-3-clause
2,406
0
22
671
919
455
464
66
4
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 Handles @deriving@ clauses on @data@ declarations. -} {-# LANGUAGE CPP #-} module TcDeriv ( tcDeriving, DerivInfo(..), mkDerivInfos ) where #include "HsVersions.h" import HsSyn import DynFlags import TcRnMonad import ...
mettekou/ghc
compiler/typecheck/TcDeriv.hs
bsd-3-clause
78,905
3
20
23,397
8,623
4,484
4,139
-1
-1
-- To make GHC stop warning about the Prelude {-# OPTIONS_GHC -Wall -fwarn-tabs -fno-warn-unused-imports #-} {-# LANGUAGE NoImplicitPrelude #-} -- For list fusion on toListBy, and for applicative hiding {-# LANGUAGE CPP #-} ---------------------------------------------------------------- -- ...
unhammer/bytestring-trie-0.2.4
src/Data/Trie/Internal.hs
bsd-3-clause
41,507
0
21
13,377
10,484
5,319
5,165
510
17
---------------------------------------------------------------------------- -- | -- Module : E -- Copyright : (c) Sergey Vinokurov 2016 -- License : BSD3-style (see LICENSE) -- Maintainer : serg.foo@gmail.com -- Created : Sunday, 23 October 2016 ----------------------------------------------------...
sergv/tags-server
test-data/0007resolvable_import_cycle/E.hs
bsd-3-clause
496
0
6
99
94
57
37
8
1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} module Clicklac.Application ( -- * App Monad App , runApp -- * Data types , AppConfig(..) ) where import Control.Monad.Base (...
onurzdg/clicklac
src/Clicklac/Application.hs
bsd-3-clause
3,945
0
11
706
1,024
603
421
97
1
{-# OPTIONS_HADDOCK show-extensions #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE BangPatterns #-} module Control.THEff.Reader.Strict ( -- * Overview -- | -- This version builds its output strictly; for a lazy version with -- the ...
KolodeznyDiver/THEff
src/Control/THEff/Reader/Strict.hs
bsd-3-clause
3,637
0
15
1,156
638
369
269
40
3
{-# LANGUAGE OverloadedStrings #-} module Scoutess.Core where import Control.Arrow hiding ((<+>)) import Control.Applicative ((<$>)) import Control.Monad.Trans.Maybe import Control.Monad.Writer hiding ((<>)) import Data.List (isPrefixOf) import qualified Data.Map as M import Data.Maybe ...
cartazio/scoutess
Scoutess/Core.hs
bsd-3-clause
10,852
0
16
2,483
2,511
1,345
1,166
163
3
-- | Generating C symbol names emitted by the compiler. module CPrim ( atomicReadLabel , atomicWriteLabel , atomicRMWLabel , cmpxchgLabel , popCntLabel , pdepLabel , pextLabel , bSwapLabel , bRevLabel , clzLabel , ctzLabel , word2FloatLabel ) where import GhcPrelude ...
sdiehl/ghc
compiler/nativeGen/CPrim.hs
bsd-3-clause
3,584
0
9
927
1,022
515
507
104
10
{-# OPTIONS_GHC -Wall #-} import Language.Haskell.Exts.Annotated import Language.Haskell.Suite.Preprocessor import Language.Haskell.Suite.Transformer import qualified QuickWeave.TransformationsList as TS import Control.Monad import Data.Generics.Uniplate.Data main :: IO () main = preprocess tM "qweave" tM :: PTr...
shayan-najd/QuickWeave
QuickWeave/Preprocessor.hs
bsd-3-clause
969
0
14
200
344
171
173
22
2
-- | This module contains combinators for creating DOM React elements. -- -- The design of creating 'ReactElement's is loosly based on -- <https://hackage.haskell.org/package/lucid lucid>. -- Most of the combinators in this module have a type: -- -- @ -- p_ :: 'Term' eventHandler arg result => arg -> result -- @ -- -- ...
nrolland/react-flux
src/React/Flux/DOM.hs
bsd-3-clause
14,560
0
8
2,463
4,035
2,111
1,924
-1
-1
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverlappingInstances #-} -- Needed to check (SafeCast to from) in the instance constraints for -- RuntimeCast. {-# LANGUAGE UndecidableInstances #-} -- | Safe casting. We assume Floats have 32 ...
Hodapp87/ivory
ivory/src/Ivory/Language/Cast.hs
bsd-3-clause
10,214
0
13
2,257
2,228
1,180
1,048
-1
-1
{- THMain.hs -} {-# LANGUAGE TemplateHaskell #-} module THMain where -- Import our template "pr" import THPrintf (pr) -- The splice operator $ takes the Haskell source code -- generated at compile time by "pr" and splices it into -- the argument of "putStrLn". main :: IO () main = putStrLn ( $(pr "Hello") )
notae/haskell-exercise
th/THMain.hs
bsd-3-clause
313
0
9
59
46
28
18
5
1
module Main where import Synth.Synth import Analysis.FFT import Settings import Control.Monad import System.Console.CmdArgs import Utils import System.Directory import System.Timeout import Types.Common import Types.Filter import Codec.Wav import Data.List results_file = "trumpet_sounds_results.txt" main = do ...
aedanlombardo/HaskellPS
DSP-PBE/Executables/TrumpetSounds.hs
bsd-3-clause
1,397
0
14
346
306
165
141
39
1
{-# LANGUAGE DataKinds, TypeOperators, QuasiQuotes #-} import Data.Record import Text.Read (readMaybe) import Control.Applicative import Control.Monad.State import Control.Arrow import Data.Monoid type Coord2D = '[ "x" := Double , "y" := Double ] type Coord3D = Coord2D ++ '[ "z" := Double ] writeM ...
mikeplus64/record
Example.hs
bsd-3-clause
1,362
2
15
416
570
298
272
38
1
------------------------------------------------------------ -- | -- Module : Cycle -- copyright : Kotaro Ohsugi -- License : BSD-style (see the LICENSE file in the distribution) -- -- Cyclic group maker ------------------------------------------------------------ module Cycle (cycle') where -- A wrapper of cycl...
pythonissam/Cyclic
src/Cycle.hs
bsd-3-clause
1,011
0
9
215
207
119
88
8
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Network.Monitoring.RiemannT where import Network.Monitoring.Riemann import Data.Functor.Identity import Control.Monad.IO.Class import Control.Applicative import Control.Proxy hiding (Client) type Prx = ProxyFast -- | A monad transformer layer which allows for the...
telser/riemann-hs
src/Network/Monitoring/RiemannT.hs
mit
1,721
0
11
296
380
209
171
23
1
{-# LANGUAGE DeriveDataTypeable #-} {- | Module : $Header$ Description : abstract syntax of CASL architectural specifications Copyright : (c) Klaus Luettich, Uni Bremen 2002-2006 License : GPLv2 or higher, see LICENSE.txt Maintainer : till@informatik.uni-bremen.de Stability : provisional Portability...
mariefarrell/Hets
Syntax/AS_Architecture.der.hs
gpl-2.0
3,482
0
8
1,164
492
282
210
42
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-glacier/gen/Network/AWS/Glacier/DeleteVault.hs
mpl-2.0
4,951
0
9
898
446
281
165
59
1
-- Copyright 2014 by Mark Watson. All rights reserved. The software and data in this project can be used under the terms of the GPL version 3 license. module Categorize (bestCategories, splitWords, bigram) where import qualified Data.Map as M import Data.List (sortBy) import Category1Gram (onegrams) import Category2...
mark-watson/kbnlp.hs
Categorize.hs
agpl-3.0
2,644
0
14
516
877
458
419
44
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>Forced Browse Add-On</title> <maps> <homeID>top</homeID> <mapref locati...
veggiespam/zap-extensions
addOns/bruteforce/src/main/javahelp/org/zaproxy/zap/extension/bruteforce/resources/help_es_ES/helpset_es_ES.hs
apache-2.0
968
101
29
158
411
213
198
-1
-1
-- QC tests for random number generators -- -- Require QuickCheck >= 2.2 module MWC.QC ( tests ) where import Control.Applicative import Data.Word (Word8,Word16,Word32,Word64,Word) import Data.Int (Int8, Int16, Int32, Int64 ) import Test.QuickCheck import Test.QuickCheck.Monadic import Test.Framework import Tes...
bos/mwc-random
mwc-random-bench/test/MWC/QC.hs
bsd-2-clause
1,874
0
12
338
568
306
262
33
1
{-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} -- {-# LANGUAGE FlexibleInstances, OverlappingInstances, IncoherentInstances #-} -- {-# LANGUAGE OverloadedStrings #-} module Ha...
erantapaa/simple-hunt
src/Hayoo/ParseSignature.hs
bsd-3-clause
15,106
0
18
5,043
4,063
2,157
1,906
300
8
{-# LANGUAGE TemplateHaskell #-} module Foo where import Language.Haskell.TH import Text.Printf -- | Report an error. -- -- >>> :set -XTemplateHaskell -- >>> $(logError "Something bad happened!") -- ERROR <interactive>: Something bad happened! logError :: String -> Q Exp logError msg = do loc <- location let s = ...
sol/doctest
test/integration/template-haskell/Foo.hs
mit
396
0
13
70
82
47
35
9
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-sqs/gen/Network/AWS/SQS/PurgeQueue.hs
mpl-2.0
3,227
0
9
719
336
209
127
45
1
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} module Test.Mockery.Action ( Dummy (..) , dummy , dummy_ , Stub (..) , Mockable (..) ) where import Control.Monad.IO.Class import Control.Monad import Data.IORef import Data.List...
haskell-tinc/tinc
test/Test/Mockery/Action.hs
bsd-3-clause
5,757
3
21
1,542
2,619
1,335
1,284
-1
-1
{-# OPTIONS_GHC -cpp -fglasgow-exts -fno-warn-orphans #-} -- | -- Module : Data.ByteString.Fusion -- License : BSD-style -- Maintainer : dons@cse.unsw.edu.au -- Stability : experimental -- Portability : portable -- -- Functional array fusion for ByteStrings. -- -- Originally based on code from the Data Para...
mightymoose/liquidhaskell
benchmarks/bytestring-0.9.2.1/Data/ByteString/Fusion.T.hs
bsd-3-clause
28,869
0
19
7,478
4,848
2,589
2,259
-1
-1
{-# OPTIONS -cpp -fglasgow-exts #-} -- The record update triggered a kind error in GHC 6.2 module Foo where data HT (ref :: * -> *) = HT { kcount :: Int } set_kcount :: Int -> HT s -> HT s set_kcount kc ht = ht{kcount=kc}
hvr/jhc
regress/tests/1_typecheck/2_pass/ghc/uncat/tc190.hs
mit
239
0
8
64
69
40
29
-1
-1
module Main where import API (network, simulation, configuration, matlabExtras, constructable) import qualified Matlab (generate) import qualified Latex (generate) -- import qualified Haskell (generate) import qualified Python (generate) main = do -- Latex.generate True api "tmp/fnref.tex" -- Latex.generate F...
nico202/NeMosim
src/api/autogen/Main.hs
gpl-2.0
542
0
10
91
106
65
41
9
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} module Hoopl.Block ( C , O , MaybeO(..) , IndexedCO , Block(..) , blockAppend , blockCons , blockFromList , blockJoin , blockJoinHead , blockJoinTail , bl...
shlevy/ghc
compiler/cmm/Hoopl/Block.hs
bsd-3-clause
11,235
0
15
3,982
4,431
2,283
2,148
-1
-1
{-# LANGUAGE CPP, MagicHash #-} -- | -- Module : Data.Text.UnsafeChar -- Copyright : (c) 2008, 2009 Tom Harper, -- (c) 2009, 2010 Bryan O'Sullivan, -- (c) 2009 Duncan Coutts -- -- License : BSD-style -- Maintainer : bos@serpentine.com, rtomharper@googlemail.com, -- ...
mightymoose/liquidhaskell
benchmarks/text-0.11.2.3/Data/Text/UnsafeChar.hs
bsd-3-clause
3,534
0
15
945
640
359
281
46
1
module Main where import Criterion.Main import qualified Snap.Internal.Http.Parser.Benchmark as PB main :: IO () main = defaultMain [ PB.benchmarks ]
beni55/snap-server
test/benchmark/Benchmark.hs
bsd-3-clause
162
0
7
32
43
27
16
5
1
module Test3 () where {-@ expression CyclicD1 Q = CyclicD2 Q @-} {-@ expression CyclicD2 Q = CyclicD3 Q @-} {-@ expression CyclicD3 Q = CyclicD1 Q @-}
mightymoose/liquidhaskell
tests/crash/CyclicExprAlias3.hs
bsd-3-clause
153
0
3
30
10
8
2
1
0
{-# LANGUAGE CPP #-} module Distribution.Client.Dependency.Modular.Builder (buildTree) where -- Building the search tree. -- -- In this phase, we build a search tree that is too large, i.e, it contains -- invalid solutions. We keep track of the open goals at each point. We -- nondeterministically pick an open goal (vi...
gridaphobe/cabal
cabal-install/Distribution/Client/Dependency/Modular/Builder.hs
bsd-3-clause
8,526
0
23
2,347
1,923
1,063
860
79
7
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} {-# LANGUAGE FlexibleInstances, UndecidableInstances, MultiParamTypeClasses, FunctionalDependencies #-} {-# LANGUAGE AllowAmbiguousTypes #-} -- 'x' and 'v' are ambiguous -- Trac #1564 module Foo where import Text.PrettyPrint import Prelude hiding(h...
urbanslug/ghc
testsuite/tests/typecheck/should_compile/tc235.hs
bsd-3-clause
872
0
7
207
230
125
105
24
1
-- This only typechecks if forall-hoisting works ok when -- importing from an interface file. The type of Twins.gzipWithQ -- is this: -- type GenericQ r = forall a. Data a => a -> r -- gzipWithQ :: GenericQ (GenericQ r) -> GenericQ (GenericQ [r]) -- It's kept this way in the interface file for brevity and docume...
urbanslug/ghc
testsuite/tests/typecheck/should_compile/tc191.hs
bsd-3-clause
909
0
10
205
129
73
56
9
1
{-# LANGUAGE MagicHash #-} module Main (main) where import GHC.Exts (Double(D#), Float(F#), word2Double#, word2Float#) main :: IO () main = do print (D# (word2Double# 0##)) -- 9007199254740992 is 2^53, which is the largest integer which -- can be stored in a 64-bit IEEE floating-point value without --...
urbanslug/ghc
testsuite/tests/codeGen/should_run/Word2Float64.hs
bsd-3-clause
614
0
11
129
130
71
59
9
1
{-# OPTIONS -fvia-C #-} {-# LANGUAGE DeriveDataTypeable #-} module Language.Haskell.Pointfree.Common ( Fixity(..), Expr(..), Pattern(..), Decl(..), TopLevel(..), bt, sizeExpr, mapTopLevel, mapTopLevel', getExpr, operators, opchars, reservedOps, lookupOp, lookupFix, minPrec, maxPrec, com...
substack/hs-disappoint
src/Language/Haskell/Pointfree/Common.hs
mit
4,610
0
10
1,077
1,852
1,047
805
113
3
module Anagram (anagramsFor) where import Data.Char (toLower) import Data.List (sort) anagramsFor :: String -> [String] -> [String] anagramsFor word = filter (isAnagram word) isAnagram :: String -> String -> Bool isAnagram a b = sort (normalize a) == sort (normalize b) normalize :: String -> String normalize = map ...
tfausak/exercism-solutions
haskell/anagram/Anagram.hs
mit
328
0
8
54
127
68
59
9
1