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 DeriveDataTypeable #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Gmail.Types -- Copyright : (c) 2015-2016 Brendan Hay -...
brendanhay/gogol
gogol-gmail/gen/Network/Google/Gmail/Types.hs
mpl-2.0
11,101
0
7
2,553
1,272
857
415
307
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.ResourceViews.Types -- Copyright : (c) 2015-2016 Brend...
rueshyna/gogol
gogol-resourceviews/gen/Network/Google/ResourceViews/Types.hs
mpl-2.0
5,272
0
7
1,156
555
374
181
139
1
{-#LANGUAGE OverloadedStrings#-} module Data.P440.XML.Instances.PNO where import qualified Data.P440.Domain.PNO as PNO import Data.P440.Domain.SimpleTypes import Data.P440.Domain.ComplexTypes import Data.P440.XML.XML import qualified Data.P440.XML.Instances.ComplexTypes as C instance ToNode PNO.Файл where toNode...
Macil-dev/440P-old
src/Data/P440/XML/Instances/PNO.hs
unlicense
3,907
0
10
1,264
1,789
906
883
70
0
module Lexer where import Text.Parsec.String (Parser) import Text.Parsec.Language (emptyDef) import qualified Text.Parsec.Token as Token lexer :: Token.TokenParser () lexer = Token.makeTokenParser style where style = emptyDef { Token.commentLine = "#", Token.reservedOpNames = ["+", ...
raviqqe/jack
command/Lexer.hs
unlicense
906
0
9
190
291
158
133
26
1
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NoImplicitPrelude #...
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/program-structure/2019-01-hc-example-based-on-adjointio-raft/test/XTestX.hs
unlicense
8,292
0
21
2,091
2,296
1,164
1,132
176
5
{-# LANGUAGE FlexibleContexts #-} module UseReaderState where import Test.HUnit as T (Test (TestList), runTestTT) import Test.HUnit.Util as U import MonadReader import MonadState foo :: (MonadReader [String] m, MonadState [String] m) => m Int foo = do a <- asks head let a'...
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/monads/m/src/UseReaderState.hs
unlicense
686
0
10
156
223
122
101
19
1
import MPL.NumberTheory.Primes main = putStrLn $ show $ last $ primeFactors 600851475143
rohitjha/ProjectEuler
MPL/PE003.hs
unlicense
90
0
7
13
27
14
13
2
1
{-# LANGUAGE OverloadedStrings #-} module GitHub ( updateDeploymentStatus ) where import qualified Control.Exception.Base as CE import Data.Monoid import qualified Data.Text as T import System.Environment (getEnv) import Network.HTTP.Conduit import ...
wereHamster/mudbath
GitHub.hs
unlicense
1,161
0
13
285
246
133
113
22
1
module Nullable where import Prelude hiding (Maybe, Just, Nothing, Either, Left, Right) data Maybe a = Nothing | Just a deriving (Show) {- instance (Show a) => Show (Maybe a) where show (Just x) = "Just " ++ show x show Nothing = "Nothing" -} fromMaybe :: a -> Maybe a -> a fromMaybe defval wrapped = case wr...
SPbAU-ProgrammingParadigms/materials
haskell_2/Nullable.hs
unlicense
414
0
8
101
110
64
46
9
2
module Main where import Control.Concurrent.Chan import Control.Concurrent -- Fork some computation processes, print their results main = do primes <- run primes fibs <- run fibonacci mapM print $ take 100 $ zip primes fibs -- fork a process, return any messages it produces as a list wh...
pdbartlett/misc-stuff
unfuddle/PdbMisc/Haskell/Tutorial/Main.hs
apache-2.0
688
0
12
208
201
101
100
15
1
module HelperSequences.A000720 (a000720) where import HelperSequences.A000040 (a000040_list) import Data.List (genericLength) a000720 :: Integer -> Integer a000720 n = genericLength $ takeWhile (<= n) a000040_list
peterokagey/haskellOEIS
src/HelperSequences/A000720.hs
apache-2.0
215
0
7
25
61
35
26
5
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} ----------------------------------------------------------------------------- -- Copyright 2019, Ideas project team. This file is distributed under the -- terms of the Apache License 2.0. For more information, see the files -- "LICENSE.txt" and "NOTICE.txt", which are include...
ideas-edu/ideas
src/Ideas/Utils/Decoding.hs
apache-2.0
2,799
0
12
582
804
426
378
54
2
{-# LANGUAGE Haskell2010 #-} {-# OPTIONS_HADDOCK hide #-} module HiddenInstancesA where -- | Should be visible class Foo a -- | Should be visible data Bar -- | Should be visible instance Foo Bar -- | Should *not* be visible data Baz -- | Should *not* be visible instance Foo Baz
haskell/haddock
html-test/src/HiddenInstancesA.hs
bsd-2-clause
284
0
5
56
38
23
15
-1
-1
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoMonomorphismRestriction #-} -- FIXME remove -- | Some fields spiced up with jQuery UI. module Yesod.Form.Jquery ( YesodJquery (..) , jqueryDayField ...
chreekat/yesod
yesod-form/Yesod/Form/Jquery.hs
bsd-2-clause
5,163
41
22
1,198
1,256
686
570
-1
-1
-- functions from GHC copied here until they can be exported in the next version. module Language.Haskell.GHC.ExactPrint.GhcInterim where import ApiAnnotation import Lexer import SrcLoc -- --------------------------------------------------------------------- -- From Lexer.x commentToAnnotation :: Located Token -> Loc...
mpickering/ghc-exactprint
src/Language/Haskell/GHC/ExactPrint/GhcInterim.hs
bsd-3-clause
1,031
0
9
152
317
160
157
14
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ExistentialQuantification #-} module Feldspar.Frontend where import qualified Prelude...
josefs/MiniDSL
Feldspar/Frontend.hs
bsd-3-clause
6,899
0
14
1,838
3,543
1,792
1,751
182
1
{-# LANGUAGE TemplateHaskell #-} module Foreign.Inference.Interface.Metadata ( moduleInterfaceEnumerations, moduleInterfaceStructTypes, paramMetaUnsigned, functionReturnMetaUnsigned, -- * Helper sanitizeStructName ) where import Control.Arrow ( (&&&) ) import Data.HashMap.Strict ( HashMap ) import qualif...
travitch/foreign-inference
src/Foreign/Inference/Interface/Metadata.hs
bsd-3-clause
11,088
0
22
2,713
3,045
1,574
1,471
228
16
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TypeFamilies #-} module Horbits.Time.KerbalDateTime (KerbalTimeCompo...
chwthewke/horbits
src/horbits/Horbits/Time/KerbalDateTime.hs
bsd-3-clause
3,512
0
11
781
1,197
642
555
77
1
module ParserTests(allParserTests) where import CoreSyntax import Lexer import Parser import TestUtils import UniversalSyntax allParserTests = do testFunction (parseExpr . strToToks) parseExprCases cve = cVarExpr . var dcFalse = cDataCon (dataCon "False") [] dcTrue = cDataCon (dataCon "True") [] iLit = cLitExpr . ...
dillonhuff/AFL
test/ParserTests.hs
bsd-3-clause
2,536
0
21
569
1,493
778
715
47
1
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE ViewPatterns #-} module VisualizationData.Queue.RealTime where import VisualizationData.Queue.Interface import VisualizationData.Thunk import Control.Arrow (second) data LazyListThunk a = AppendReverseThunk !(LazyListRef a) !(LazyList a) ![a...
timjb/pfds-visualizations
src/VisualizationData/Queue/RealTime.hs
bsd-3-clause
4,313
0
13
1,076
1,547
786
761
157
3
{-# LANGUAGE FlexibleContexts #-} {-# OPTIONS_GHC -fcontext-stack=22 #-} module Main (main) where import Control.Applicative import Control.Monad import Control.Monad.ST import Criterion import Criterion.Main (defaultMain) import Data.Array.ST import Data.Tuple.ITuple import Data.Tuple.ST import Data.Var.ST main :: ...
sonyandy/var
benchmarks/boxed.hs
bsd-3-clause
2,574
0
19
782
1,200
605
595
103
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE Strict #-} {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} module Static.Array ( module Static.Array , module Static.Measure , U, D ) where import Static.Measure import Util i...
jonascarpay/convoluted
src/Static/Array.hs
bsd-3-clause
5,611
0
13
1,501
2,043
1,049
994
-1
-1
module Network.Mail.Postie.Settings ( Settings (..), TLSSettings (..), StartTLSPolicy (..), settingsStartTLSPolicy, defaultExceptionHandler, mkServerParams, def, -- | reexport from Default class ) where import Control.Applicative import Control.Exception import Data.ByteString (ByteStri...
alexbiehl/postie
src/Network/Mail/Postie/Settings.hs
bsd-3-clause
6,155
0
13
1,527
1,276
721
555
124
8
{-# language CPP #-} -- | = Name -- -- VK_KHR_depth_stencil_resolve - device extension -- -- == VK_KHR_depth_stencil_resolve -- -- [__Name String__] -- @VK_KHR_depth_stencil_resolve@ -- -- [__Extension Type__] -- Device extension -- -- [__Registered Extension Number__] -- 200 -- -- [__Revision__] -- 1 -...
expipiplus1/vulkan
src/Vulkan/Extensions/VK_KHR_depth_stencil_resolve.hs
bsd-3-clause
10,194
0
8
1,891
623
452
171
-1
-1
-- | Log filenames in current directory sorted by name. {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ExtendedDefaultRules #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} module Main where import Control.Applicative import Data.List(sort) import Shelly.Pipe import Data.Text.Lazy as LT default (LT.Text) main = shs ...
adinapoli/Shelly.hs
examples/Pipe/Log.hs
bsd-3-clause
496
0
11
101
111
62
49
16
1
module Main where import Ivory.Tower.Config import Ivory.OS.FreeRTOS.Tower.STM32 import LDrive.Platforms import LDrive.Tests.CANSendRecv (app) main :: IO () main = compileTowerSTM32FreeRTOS testplatform_stm32 p $ app (stm32config_clock . testplatform_stm32) testplatform_can testplatf...
sorki/odrive
test/CANSendRecv.hs
bsd-3-clause
384
0
8
75
87
49
38
11
1
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module Snap.Internal.Http.Parser.Tests ( tests ) where import qualified Control.Exception as E import Control.Exception hiding (try, assert) import Control.Monad import Control.Paralle...
janrain/snap-server
test/suite/Snap/Internal/Http/Parser/Tests.hs
bsd-3-clause
5,001
0
17
1,343
1,437
749
688
121
2
module FunctorDigit where import Digit (Digit(..)) instance Functor Digit where {-# INLINE fmap #-} fmap f (One a) = One (f a) fmap f (Two a b) = Two (f a) (f b) fmap f (Three a b c) = Three (f a) (f b) (f c) fmap f (Four a b c d) = Four (f a) (f b) (f c) (f d)
phischu/fragnix
tests/quick/InstancePropagation/FunctorDigit.hs
bsd-3-clause
303
0
8
105
185
94
91
8
0
{-# LANGUAGE RecordWildCards, ViewPatterns, ScopedTypeVariables, TupleSections #-} module Development.Ninja.All(runNinja) where import Development.Ninja.Env import Development.Ninja.Type import Development.Ninja.Parse import Development.Shake hiding (addEnv) import Development.Shake.Classes import qualified Data.Byte...
ndmitchell/shake
src/Development/Ninja/All.hs
bsd-3-clause
13,795
0
26
4,120
4,329
2,185
2,144
210
11
module Parser.ParseQuoted (parseQuotedString) where import Parser.Parse import Control.Monad (guard) import qualified Data.Map as Map escapes :: Map.Map Char Char escapes = Map.fromList [('\\', '\\') ,('"', '"') ,('\'', '\'') ,('n', '\n') ,('r', '\r') ,('t', '\t') ,('a', '\a')] parseQuotedString :: Char -> P...
Kiwi-Labs/kwirc
kwick/parser/ParseQuoted.hs
mit
703
10
16
141
254
128
126
30
2
{-| TODO This has a bunch of stub logic that was intended for an architecture with a single Urbit daemon running multiple ships. Do it or strip it out. -} module Urbit.King.API (King(..), kingAPI, readPortsFile) where import RIO.Directory import Urbit.Prelude import Network.Socket (Socket) impo...
ngzax/urbit
pkg/hs/urbit-king/lib/Urbit/King/API.hs
mit
4,276
0
18
1,217
1,128
586
542
-1
-1
{-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} module System.HFind.ArgParse ( FindFlag(..) , Result(..) ...
xcv-/hfind
cli/System/HFind/ArgParse.hs
mit
11,682
0
17
3,321
3,057
1,631
1,426
-1
-1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeApplications #-} module Test.Pos.Infra.Bi ( tests ) where import Universum import Hedgehog (Property) import qualified Hedgehog as H import Pos.Infra.Communication.Types.Protocol (HandlerSpec (..)) import qualified Prelude...
input-output-hk/pos-haskell-prototype
infra/test/Test/Pos/Infra/Bi.hs
mit
1,678
0
9
258
236
142
94
28
1
{- SkateBackendWiki: Backend to generate a Wiki documentation Part of Skate: a Schema specification languge Copyright (c) 2017, ETH Zurich. All rights reserved. This file is distributed under the terms in the attached LICENSE file. If you do not find this file, copies can be found by writing to: ETH Zu...
kishoredbn/barrelfish
tools/skate/SkateBackendWiki.hs
mit
7,044
0
18
1,430
2,032
1,069
963
114
2
{-# 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-elasticache/gen/Network/AWS/ElastiCache/DeleteCacheCluster.hs
mpl-2.0
5,393
0
13
1,033
638
385
253
82
1
{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE ScopedTypeVariables #-} module HERMIT.Dictionary.Local.Let ( -- * Rewrites on Let Expressions externals -- ** Let Elimination , letNonRecSubstR , letNonRecSubstSafeR ,...
conal/hermit
src/HERMIT/Dictionary/Local/Let.hs
bsd-2-clause
32,736
0
22
9,155
7,275
3,703
3,572
428
6
-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} module NumberSix.Message.Decode.Tests ( tests ) where -------------------------------------------------------------------------------- import Test.Framework (Test, testGroup)...
itkovian/number-six
tests/NumberSix/Message/Decode/Tests.hs
bsd-3-clause
1,702
0
14
412
307
167
140
35
1
{-# LANGUAGE GADTs #-} {-# LANGUAGE TemplateHaskell #-} import Control.Monad import Data.Dynamic import Data.Int import Data.Word import Test.Tasty.QuickCheck import Test.Tasty.TH import Language.Syntactic import Language.Syntactic.Functional import Feldspar.Representation import Feldspar.Optimize import Feldspar.F...
kmate/raw-feldspar
tests/NumSimpl.hs
bsd-3-clause
3,235
0
14
846
1,333
705
628
75
1
-- | -- Module : Test.LeanCheck.Error -- Copyright : (c) 2015-2020 Rudy Matela -- License : 3-Clause BSD (see the file LICENSE) -- Maintainer : Rudy Matela <rudy@matela.com.br> -- -- This module is part of LeanCheck, -- a simple enumerative property-based testing library. -- -- This module re-exports "Test...
rudymatela/llcheck
src/Test/LeanCheck/Error.hs
bsd-3-clause
7,635
0
11
1,796
1,321
804
517
86
1
module Midi.Util ( every, drops ) where every :: Int -> [a] -> [a] every n | n > 0 = go | otherwise = error ("every called with invalid spacing: " ++ show n) where go [] = [] go xs@(x:_) = x : go (drop n xs) -- Passed: -- -- prop_equiv :: Int -> [Int] -> Bool -- prop_equiv n xs = every...
beni55/Midi
src/Midi/Util.hs
bsd-3-clause
580
0
10
165
224
122
102
12
2
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Lazyfoo.Lesson11 (main) where import Control.Lens.Operators import Control.Monad import Foreign.C.Types import Linear import Linear.Affine import SDL (($=)) import qualified SDL import Paths_sdl2 (getDataFileName) #if !MIN_VERSION_base(4,8,0) import Cont...
oldmanmike/sdl2
examples/lazyfoo/Lesson11.hs
bsd-3-clause
3,091
0
21
679
1,018
497
521
74
2
----------------------------------------------------------------------------- -- -- Generating machine code (instruction selection) -- -- (c) The University of Glasgow 1996-2004 -- ----------------------------------------------------------------------------- -- This is a big module, but, if you pay attention to -- (a)...
lukexi/ghc-7.8-arm64
compiler/nativeGen/X86/CodeGen.hs
bsd-3-clause
108,302
0
23
36,225
28,357
13,962
14,395
-1
-1
module BinarySearch where import Control.Lens import Data.Maybe a :: [Int] a = [6, 13, 14, 25, 33, 43, 51, 53, 64, 72, 84, 93, 95, 96, 97] bsearch :: Int -> [Int] -> Maybe Int bsearch _ [] = Nothing bsearch key xs | key < fromJust val = bsearch key (take (mid-1) xs) | key > fromJust val = bsearch key (...
manikTharaka/al-go-rithms
search/binary_search/haskell/binary_search.hs
mit
445
0
14
118
237
128
109
13
1
----------------------------------------------------------------------------- -- | -- Module : Haddock.Options -- Copyright : (c) Simon Marlow 2003-2006, -- David Waern 2006-2009, -- Mateusz Kowalczyk 2013 -- License : BSD-like -- -- Maintainer : haddock@...
lamefun/haddock
haddock-api/src/Haddock/Options.hs
bsd-2-clause
11,972
0
15
2,554
2,914
1,562
1,352
255
8
module T14373b where data BigFam = A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P {-# NOINLINE earlySwitch #-} earlySwitch A = True earlySwitch B = False earlySwitch C = False
sdiehl/ghc
testsuite/tests/codeGen/should_compile/T14373b.hs
bsd-3-clause
193
0
5
55
81
50
31
6
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="tr-TR"> <title>AMF Support</title> <maps> <homeID>amf</homeID> <mapref location="map.jh...
kingthorin/zap-extensions
addOns/amf/src/main/javahelp/help_tr_TR/helpset_tr_TR.hs
apache-2.0
956
77
66
156
407
206
201
-1
-1
{-# OPTIONS_GHC -ddump-types #-} {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts #-} -- See Trac #1456 -- The key thing here is that foo should get the type -- foo :: forall b s t1. (Zork s (Z [Char]) b) -- => Q s (Z [Char]) t1 -> ST s () -- Note the quantification over 'b', which...
spacekitteh/smcghc
testsuite/tests/typecheck/should_compile/tc231.hs
bsd-3-clause
642
0
9
156
148
83
65
11
1
{-# LANGUAGE PolyKinds, KindSignatures, FunctionalDependencies, FlexibleInstances, UndecidableInstances, TypeOperators, DataKinds, FlexibleContexts #-} module T6015a where import Prelude hiding ((++)) data T a = T class ((a :: [k]) ++ (b :: [k])) (c :: [k]) | a b -> c instance ('[] ++ b) b insta...
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/polykinds/T6015a.hs
bsd-3-clause
402
6
11
94
173
98
75
-1
-1
{-# LANGUAGE TupleSections #-} -- |Vectorise variables and literals. module Vectorise.Var ( vectBndr , vectBndrNew , vectBndrIn , vectBndrNewIn , vectBndrsIn , vectVar , vectConst ) where import Vectorise.Utils import Vectorise.Monad import Vectorise.Env import Vectorise.Vect import Vectorise.Type.T...
frantisekfarka/ghc-dsi
compiler/vectorise/Vectorise/Var.hs
bsd-3-clause
2,681
0
12
601
680
358
322
61
2
{-# OPTIONS_GHC -fwarn-unused-imports #-} module Test where import qualified Control.Monad (ap) -- Test that GHC warns about the following unused import: import qualified Control.Monad.Reader foo :: IO () foo = return id `Control.Monad.ap` return ()
ezyang/ghc
testsuite/tests/module/T1074.hs
bsd-3-clause
252
0
7
37
56
34
22
6
1
-- !!! deriving Ix on d. type with one constructor module ShouldSucceed where import Data.Ix data Pair a b = Pair a b deriving (Show, Ord, Eq, Ix)
urbanslug/ghc
testsuite/tests/deriving/should_compile/drv009.hs
bsd-3-clause
149
0
6
30
42
25
17
3
0
{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples, FlexibleInstances #-} {-# OPTIONS_GHC -funbox-strict-fields #-} module Arr ( Array(..), (!!!), array ) where import GHC.Num import GHC.ST import GHC.Base import Good data Array e = Array !Int !Int Int (Array# e) array :: (Int,Int) -> [(Int, e)] -...
urbanslug/ghc
testsuite/tests/stranal/should_run/T8425/Arr.hs
bsd-3-clause
1,965
0
15
528
917
484
433
53
2
module Control.Concurrent.Object ( Class(..), Object, Self(..), CallbackModule(..) , ObjectLike(..) ) where import Prelude hiding (init, mod) import Control.Exception import Control.Concurrent import Control.Concurrent.STM import Control.Concurrent.Object.Internal instance ObjectLike IO (Object msg reply...
ruicc/structured-concurrent-object
src/Control/Concurrent/Object.hs
mit
1,314
0
11
343
443
230
213
-1
-1
{-| Module : PostgREST.Private.ProxyUri Description : Proxy Uri validator -} module PostgREST.Config.Proxy ( Proxy(..) , isMalformedProxyUri , toURI ) where import Data.Maybe (fromJust) import Data.Text (pack, toLower) import Network.URI (URI (..), URIAuth (..), isAbsoluteURI, parseURI) import Protolu...
steve-chavez/postgrest
src/PostgREST/Config/Proxy.hs
mit
2,143
0
11
492
632
343
289
50
2
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TypeFamilies #-} module UITest where import Testing import Control.Hspl hiding (predicate) import qualified Control.Hspl as Hspl import Control.Hspl.Internal.As...
jbearer/hspl
test/UITest.hs
mit
11,837
0
26
3,221
4,030
2,085
1,945
226
1
{-# LANGUAGE OverloadedStrings #-} module Mixcoin.Common.Crypto ( genWarrant , verifyWarrant , readPrivKey ) where import Control.Concurrent.STM import Crypto.PubKey.HashDescr import Crypto.PubKey.RSA import Crypto.PubKey.RSA.PKCS15 import Crypto.Random import ...
charlescharles/mixcoin-hs
src/Mixcoin/Common/Crypto.hs
mit
2,479
0
16
609
737
389
348
60
3
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.DOMStringList (item, item_, itemUnsafe, itemUnchecked, contains, contains_, getLength, DOMStringList(..),...
ghcjs/jsaddle-dom
src/JSDOM/Generated/DOMStringList.hs
mit
3,267
0
14
505
816
468
348
-1
-1
{-# LANGUAGE BangPatterns, DataKinds, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module Hadoop.Protos.FsImageProto.SnapshotDiffSection (SnapshotDiffSection(..)) where import Prelude ((+), (/)) import qualified Prelude as Prelude' import qualified Data.T...
alexbiehl/hoop
hadoop-protos/src/Hadoop/Protos/FsImageProto/SnapshotDiffSection.hs
mit
2,775
1
16
529
554
291
263
53
0
import System.Environment getCounts :: String -> (Int, Int, Int) getCounts input = (charCount, wordCount, lineCount) where charCount = length input wordCount = (length . words) input lineCount = (length . lines) input countsText :: (Int, Int, Int) -> String countsText (cc, wc, lc) = unwords [ "chars...
raventid/coursera_learning
haskell/will_kurt/24.5_calculate_stats.hs
mit
1,220
0
12
417
245
135
110
20
1
module Day11 (p1, p2) where import Control.Arrow import Control.Monad import Data.Char import Data.List import qualified Data.Map as M import Data.Map ((!)) import qualified Data.Set as S input = "vzbxkghb" test1 = "abcdefgh" test2 = "ghijklmn" test2' = "ghizzzzz" naughyChars = S.fromList ['i', 'o', 'l'] hasNaught...
farrellm/advent
src/Day11.hs
mit
1,272
0
13
360
575
303
272
41
5
module Main where import Monad import System.Environment import Text.ParserCombinators.Parsec hiding (spaces) main :: IO () main = do args <- getArgs putStrLn (readExpr (args !! 0)) symbol :: Parser Char symbol = oneOf "!$%&|*+-/:<=>?@^_~#" readExpr input = case parse parseExpr "lisp" input of Left err...
tismith/tlisp
write-yourself-a-scheme/listings/listing4.1.hs
mit
2,294
0
11
703
751
367
384
67
3
module Logix.Tokenizer where import Text.Regex.Posix import Data.Char import qualified Data.Map as Map import Data.Maybe import Data.Either import Logix.Utils data Keyword = Check | Axiom | Theorem deriving (Show, Eq, Enum) data Tactic = Qed | Mp deriving (Show, Eq, Enum) data Syntactic = Of | Curry | LP | RP | Comm...
izgzhen/logix
Logix/Tokenizer.hs
mit
2,526
0
15
660
1,082
546
536
65
1
--If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. --Find the sum of all the multiples of 3 or 5 below 1000. sum1 c 0 s = s sum1 c max s = if ((c `mod` 3 == 0) || (c `mod` 5 == 0 )) then sum1 (c+1) (max-1) (s+c) else su...
stefan-j/ProjectEuler
q1.hs
mit
340
6
10
96
126
70
56
4
2
module IRC ( module IRC.Types ) where import IRC.Types import IRC.Commands
EXio4/ircah
src/IRC.hs
mit
79
0
5
15
22
14
8
4
0
module Sat ( S -- :: * -> *; Functor, Monad , Lit -- :: *; Eq, Ord, Show , Arg(..) -- :: * , Atm(..) -- :: * , run -- :: S a -> IO a , okay -- :: S Bool , lift -- :: IO a -> S a , contradiction -- :: S () , newLit -- :: S Lit , ...
msakai/folkung
Haskell/Sat.hs
mit
12,100
1
15
3,039
3,118
1,609
1,509
177
2
{-# LANGUAGE MultiParamTypeClasses #-} module Algebra.Suspension where data Suspension a b = Suspension (a -> b) a suspend = Suspension release :: Suspension a b -> b release (Suspension f a) = f a
sgord512/Algebra
Algebra/Suspension.hs
mit
201
0
8
37
65
36
29
6
1
{-- -- Natume -- an implementation of Kana-Kanji conversion in Haskell -- Copyright (C) 2006-2012 Takayuki Usui -- -- 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 th...
takayuki/natume
Con.hs
gpl-2.0
2,801
0
16
913
733
366
367
55
3
module HW08 where import System.Random import Control.Monad.Random import Data.Monoid import Data.List import Control.Monad -- import Control.Monad.Random.Class {- Exercise 1 failed on me: import Data.List import Data.Char import Data.Maybe stringFitsFormat :: String -> Bool stringFitsFormat = isJust . go where...
urbanslug/cs194
Src/Week8/HW08.hs
gpl-3.0
3,111
0
11
741
803
412
391
-1
-1
{- Module : Tubes.Channel Description : Defines the Channel type. Copyright : (c) 2014-2016 Gatlin Johnson <gatlin@niltag.net> License : GPL-3 Maintainer : gatlin@niltag.net Stability : experimental -} module Tubes.Channel ( Channel(..) , tee ) where import Prelude hiding (map,...
gatlin/tubes
Tubes/Channel.hs
gpl-3.0
5,594
0
20
2,006
1,348
688
660
89
1
-- -*-haskell-*- -- Vision (for the Voice): an XMMS2 client. -- -- Author: Oleg Belozeorov -- Created: 21 Sep. 2010 -- -- 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 the...
upwawet/vision
src/Location/PathComp.hs
gpl-3.0
2,200
0
28
569
461
230
231
50
1
module QFeldspar.Singleton where -- import QFeldspar.MyPrelude import Prelude hiding (sin) import QFeldspar.ErrorMonad import Unsafe.Coerce import qualified QFeldspar.Nat.ADT as NA class HasSin tf t where sin :: tf t -- type family Trm (t :: k) :: * -- type family RevTrm (t :: *) :: k data Eql :: k -> k -> * wh...
shayan-najd/QFeldspar
QFeldspar/Singleton.hs
gpl-3.0
1,652
0
11
460
752
405
347
-1
-1
module Data.Sparse.Utils (unionWithD, intersectWithD, indexed, indexed2, minTup, maxTup, LB, UB, inBounds0, inBounds02, sortWith) where -- import Control.Arrow (first, second) import Data.Ord import qualified Data.Vector as V import Data.Sparse.Internal.Utils -- * Misc. utilities -- | Intersection and union of...
ocramz/sparse-linear-algebra
src/Data/Sparse/Utils.hs
gpl-3.0
4,454
0
14
1,299
1,940
1,062
878
73
5
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-games-management/gen/Network/Google/Resource/GamesManagement/Achievements/ResetForAllPlayers.hs
mpl-2.0
5,517
0
18
1,215
714
417
297
109
1
module Development.Fex ( module Development.Fex.Depend , Experiment, Dependency, Effect, Depend(..) , dependsExper, dep, dependStatus, resolve , effectsExper, effect , evalExper , baseExper , liftIO , experFail , setName, getName , cached, existsAfter ) where import Development.Fex.Base import De...
BurntSushi/fex
Development/Fex.hs
unlicense
411
0
5
66
97
65
32
15
0
module Git.Command.FastExport (run) where run :: [String] -> IO () run args = return ()
wereHamster/yag
Git/Command/FastExport.hs
unlicense
88
0
7
15
42
23
19
3
1
fac n = if n == 0 then 1 else n * fac ( n - 1 ) main = putStrLn "hi, world"
kkdg/haskell-jogging
01/0110/hello.hs
apache-2.0
77
0
9
24
43
22
21
2
2
{-# LANGUAGE CPP #-} module Actions.ManagePlans.Open.Url (url) where import qualified Actions.ManagePlans.Url as Parent url :: String url = Parent.url ++ "/open"
DataStewardshipPortal/ds-wizard
DSServer/app/Actions/ManagePlans/Open/Url.hs
apache-2.0
166
0
6
25
39
26
13
5
1
module Deptrack () where
lucasdicioccio/deptrack
src/Deptrack.hs
apache-2.0
27
0
3
6
7
5
2
1
0
module Poset.A334184 (a334184, a334184_row) where import Poset.Wichita (wichitaRanks) import Data.Set (Set) import qualified Data.Set as Set a334184 :: Int -> Int a334184 n = a334184_list !! (n-1) a334184_list :: [Int] a334184_list = concatMap a334184_row [1..] a334184_row :: Integer -> [Int] a334184_row = map Set.s...
peterokagey/haskellOEIS
src/Poset/A334184.hs
apache-2.0
339
0
7
49
117
68
49
10
1
class Tofu t where tofu :: j a -> t a j data Frank a b = Frank {frankField :: b a} deriving (Show) -- :t Frank {frankField = Just "HAHA"} -- Frank {frankField = Just "HAHA"} :: Frack [Char] Mayb -- Just "HAHA" 类型 Maybe [Char] instance Tofu Frank where tofu x = Frank x data Barry t k p = Barry { yabba :: p, ...
sharkspeed/dororis
languages/haskell/LYHGG/8-making-our-own-types-and-typeclasses/9-kinds-and-some-type-foo.hs
bsd-2-clause
450
1
10
113
163
90
73
-1
-1
module Main where import Lib main :: IO () main = putStrLn ""
danslocombe/music-geometry
app/Main.hs
bsd-3-clause
64
0
6
15
25
14
11
4
1
module AddMovie.Types where -- Imports -- ======= import Data.List (lookup) -- Types -- ===== data Metadata = Metadata [(Field, Value)] deriving (Show) lookupValue :: Field -> Metadata -> Value lookupValue query (Metadata pairs) = case lookup query pairs of Just value -> value Nothing ->...
dgrisham/suggestion
src/AddMovie/Types.hs
bsd-3-clause
366
0
8
88
110
63
47
11
2
{-# LANGUAGE FlexibleInstances, OverlappingInstances, FlexibleContexts, UndecidableInstances, Rank2Types #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -------------------------------------------------------------------- -- | Generic Instance for ToSElem using syb-with-class. -- Inspired heavily-to-entirely by Alex Drummo...
factisresearch/HStringTemplate
Text/StringTemplate/GenericWithClass.hs
bsd-3-clause
1,724
0
17
337
419
220
199
28
2
module Oracles.PackageData ( PackageData (..), PackageDataList (..), pkgData, pkgDataList ) where import Hadrian.Oracles.TextFile import Base newtype PackageData = BuildGhciLib FilePath data PackageDataList = AsmSrcs FilePath | CcArgs FilePath | CSrcs...
ezyang/ghc
hadrian/src/Oracles/PackageData.hs
bsd-3-clause
3,151
0
9
1,019
557
280
277
51
19
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.PackageDb -- Copyright : (c) The University of Glasgow ...
snoyberg/ghc
libraries/ghc-boot/GHC/PackageDb.hs
bsd-3-clause
16,358
0
21
4,554
3,248
1,729
1,519
322
4
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-} module Text.RegExp.Matching.LeftLong.Type where import Data.Semiring import Text.RegExp.Data -- | -- Semiring used for leftmost longest matching. -- -- The `LeftLong` type satisfies the distributive laws only with a -- precondition on all involved multiplic...
sebfisch/haskell-regexp
src/Text/RegExp/Matching/LeftLong/Type.hs
bsd-3-clause
1,258
0
13
450
305
155
150
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 Over...
rfranek/duckling
Duckling/Numeral/SV/Corpus.hs
bsd-3-clause
2,499
0
11
1,134
460
268
192
76
1
module Playground17 where import qualified Data.Map as Map data Box a = Box a deriving Show wrap :: a -> Box a wrap a = Box a unwrap :: Box a -> a unwrap (Box a) = a data Triple a = Triple a a a deriving Show type Point3D = Triple Double first :: Triple a -> a first (Triple x _ _) = x second :: Triple a -> a se...
stefanocerruti/haskell-primer-alpha
src/Playground17.hs
bsd-3-clause
1,001
0
8
230
494
268
226
30
1
{-# OPTIONS_GHC -fno-warn-orphans #-} -- | A module of re-exports and orphan instances module Data.ByteString.IsoBaseFileFormat.ReExports (module X) where import Data.Bits as X import qualified Data.ByteString as B import D...
sheyll/isobmff-builder
src/Data/ByteString/IsoBaseFileFormat/ReExports.hs
bsd-3-clause
2,191
0
7
1,311
277
187
90
-1
-1
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveLift #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE...
Gabriel439/Haskell-Dhall-Library
dhall/src/Dhall/Syntax.hs
bsd-3-clause
55,376
343
14
16,896
10,899
5,936
4,963
795
13
----------------------------------------------------------------------------- -- | -- Module : Main -- Copyright : (c) David Himmelstrup 2005 -- License : BSD-like -- -- Maintainer : lemmih@gmail.com -- Stability : provisional -- Portability : portable -- -- Entry point to the default cabal-install ...
alphaHeavy/cabal
cabal-install/Main.hs
bsd-3-clause
18,458
0
17
4,474
4,123
2,169
1,954
347
8
{-# LANGUAGE OverloadedStrings #-} module ECESpec where import Network.HTTP.ECE import Network.HTTP.ECE.Key import Test.Hspec spec :: Spec spec = do describe "KeyStore" $ do it "should do storage and retrieval" $ do key <- generateKey let x = getKey (ExplicitMethod, "a...
nymacro/http-ece
tests/ECESpec.hs
bsd-3-clause
2,680
0
19
721
643
331
312
39
1
-- Execute doctest tests with no dependencies on doctest -- TODO: move in a different doctest-static package {-# LANGUAGE OverloadedStrings ,DeriveFunctor#-} {-# LANGUAGE FlexibleInstances,UndecidableInstances #-} -- move to doctest module DocTest ( asPrint , test , testProp , LineChunk(..) , ExpectedLine(.....
tittoassini/flat
test/DocTest.hs
bsd-3-clause
5,171
0
13
1,253
1,404
753
651
99
10
{-# LANGUAGE OverloadedStrings #-} module Text.LaTeX.Packages.Hyperref ( -- * Hyperref package hyperref -- * Hyperref commands , HRefOption (..) , URL , createURL , href , url , nolinkurl , hyperbaseurl , hyperimage , autoref , nameref -- * Package options , pdftex , pdftitle , pdfauthor , pdf...
dmcclean/HaTeX
Text/LaTeX/Packages/Hyperref.hs
bsd-3-clause
5,255
0
10
1,143
1,044
568
476
95
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE IncoherentInstances #-} {-# LANGUAGE OverlappingInstances #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE Tem...
kumasento/accelerate
Data/Array/Accelerate/Trafo/Base.hs
bsd-3-clause
7,279
0
20
1,812
1,756
933
823
-1
-1
module MacrosNew where import GOTO import Data.List -- * Implementación Macros GOTO -- ============================ -- | Instrucciones con macros. data InstM = IncM Variable Etiqueta | DecM Variable Etiqueta | CondM Etiqueta Variable Etiqueta | Macro Etiqueta ...
EduPH/ModelosComputacionales
src/MacrosNew.hs
bsd-3-clause
14,173
0
19
4,494
3,908
2,069
1,839
166
2
{-# LANGUAGE DeriveDataTypeable #-} {- | Module : $Header$ Description : RDF Morphism Copyright : (c) Francisc-Nicolae Bungiu, Felix Gabriel Mance, 2011 License : GPLv2 or higher, see LICENSE.txt Maintainer : f.bungiu@jacobs-university.de Stability : provisional Portability : portable Morphisms f...
mariefarrell/Hets
RDF/Morphism.hs
gpl-2.0
5,404
0
16
1,422
329
181
148
31
1
{-| Implementation of the Ganeti Query2 basic types. These are types internal to the library, and for example clients that use the library should not need to import it. -} {- Copyright (C) 2012, 2013 Google Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Gen...
vladimir-ipatov/ganeti
src/Ganeti/Query/Types.hs
gpl-2.0
2,606
0
9
578
246
155
91
24
1
{- Safe/Boot.hs - as in BootTidal but in the Op monad Copyright (C) 2021 Johannes Waldmann and contributors Forked from: https://github.com/jwaldmann/safe-tidal-cli/ This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as pub...
bgold-cosmos/Tidal
src/Sound/Tidal/Safe/Boot.hs
gpl-3.0
2,975
0
8
539
830
448
382
56
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-emr/gen/Network/AWS/EMR/RunJobFlow.hs
mpl-2.0
12,105
0
10
2,661
1,376
837
539
137
1