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 OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE CPP #-} module Network.Wai.Handler.Warp.Response ( sendResponse , fileRange -- for testing , warpVersion , defaultServerValue ) where #ifndef MIN_VERSION_base #de...
jberryman/wai
warp/Network/Wai/Handler/Warp/Response.hs
mit
16,454
1
24
3,836
3,650
1,943
1,707
266
9
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedLists #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE QuasiQuotes #-} module Main ( main ) where #ifdef USE_MICROLENS import Lens.Micro import Lens.Micro.Mtl #else import Control.Lens #endif import Control.Monad.State.Lazy imp...
qrilka/xlsx
test/Main.hs
mit
26,750
0
27
8,202
5,784
3,171
2,613
-1
-1
module Y2017.M07.D05.Exercise where -- below imports available via 1HaskellADay git repository import Data.QBit import Data.Numeral.QBits {-- AHA! I'm BACK! I'm BACK in the saddle again! From the Mensa Genius Quiz-a-Day Book by Dr. Abbie F. Salny, July 3 problem: The following multiplication example uses all the d...
geophf/1HaskellADay
exercises/HAD/Y2017/M07/D05/Exercise.hs
mit
712
0
9
170
62
38
24
5
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} module Api where import Data.Aeson import Data.Int (Int64) import Data.Proxy import Data.Text (Text) import Database import Database.Persist import GHC.Generics import Servant.API import Ser...
tippenein/scrape_the_truth
src/Api.hs
mit
1,138
0
10
214
301
167
134
44
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} module MarketData where import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.Encoding as T import Data.Int --import Data.Serialize (Serialize) --import qualified Data.Serialize as S import Control.Applicative import T...
fhaust/pipes-eep
bench/MarketData.hs
mit
1,256
0
13
344
220
134
86
23
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.HTMLModElement (js_setCite, setCite, js_getCite, getCite, js_setDateTime, setDateTime, js_getDateTime, getDateTime, HTMLModElement, castToHTMLModElement, gTypeHTMLModElement) where im...
manyoo/ghcjs-dom
ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/HTMLModElement.hs
mit
2,617
28
10
367
644
379
265
41
1
module System.Nix.Store.Remote.Protocol ( WorkerOp(..) , simpleOp , simpleOpArgs , runOp , runOpArgs , runStore) where import Control.Exception (bracket) import Control.Monad.Except import Control.Monad.Reader import Control.Monad.State import Da...
shlevy/hnix-store
hnix-store-remote/src/System/Nix/Store/Remote/Protocol.hs
mit
4,680
0
18
1,375
1,182
619
563
145
2
{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} module Sproxy.Application ( sproxy , redirect ) where import Blaze.ByteString.Builder (toByteString) import Blaze.ByteString.Builder.ByteString (fromByteString) import Control.Exception ( Exception , Handler(..) , ...
ip1981/sproxy2
src/Sproxy/Application.hs
mit
17,806
0
30
4,887
4,779
2,487
2,292
440
12
{-# LANGUAGE OverloadedStrings #-} module Data.Niagra.Selector.Combinators ( -- * Pseudoclass Combinators active, checked, disabled, empty, enabled, firstChild, firstOfType, focus, hover, inRange, invalid, lang, lastChild, lastOfType, link, not, nthChild, nthLastOfType, nthOfType...
fhsjaagshs/niagra
src/Data/Niagra/Selector/Combinators.hs
mit
5,078
0
9
900
765
450
315
120
1
{-# LANGUAGE EmptyCase #-} {-# LANGUAGE FlexibleInstances #-} module Parametricity where f1 :: a -> a f1 x = x f2 :: a -> b f2 = const undefined f2' :: a -> b f2' = (\x -> case x of {}) f3 :: a -> b -> a f3 x _ = x f4 :: [a] -> [a] f4 x = x f5 :: (b -> c) -> (a -> b) -> (a -> c) f5 f g = (\x -> f $ g x) f6 :: (a...
harrisi/on-being-better
list-expansion/Haskell/Learning/Parametricity.hs
cc0-1.0
1,259
0
10
357
681
359
322
45
1
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleInstances #-} {- | Module : $Header$ Description : Inclusion of CASL_DL into CASL Copyright : (c) Uni Bremen 2007 License : GPLv2 or higher, see LICENSE.txt Maintainer : [email protected] Stability : provisional Portabi...
nevrenato/Hets_Fork
Comorphisms/CASL_DL2CASL.hs
gpl-2.0
8,448
0
15
2,929
2,075
1,011
1,064
210
19
{-# LANGUAGE GeneralizedNewtypeDeriving, CPP #-} {- Copyright (C) 2010-2014 John MacFarlane <[email protected]> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at ...
nickbart1980/pandoc
src/Text/Pandoc/Pretty.hs
gpl-2.0
16,517
0
16
5,407
5,064
2,606
2,458
376
10
module Wfg (wfg,nds) where import qualified Data.List.Stream as S import Utils boundPoint :: Point -> Point -> Point boundPoint [] [] = [] boundPoint (b:bound) (p:point) = min b p : boundPoint bound point data Dominated = XbeatsY | YbeatsX | NeitherDominates deriving (Enum, Eq) dom :: Dominated -> Point -> Point...
lbradstreet/wfg-hs
Wfg.hs
gpl-2.0
1,942
2
12
520
889
452
437
41
2
{- | Module : $Header$ Copyright : (c) Christian Maeder, DFKI GmbH 2010 License : GPLv2 or higher, see LICENSE.txt Maintainer : [email protected] Stability : provisional Portability : non-portable (ATP GUI) call metis prover -} module SoftFOL.ProveMetis ( metisProver , metisProveCMDLaut...
nevrenato/HetsAlloy
SoftFOL/ProveMetis.hs
gpl-2.0
5,530
0
16
1,354
1,031
556
475
105
3
{-# LANGUAGE OverloadedStrings #-} import System.Random import Network import Control.Monad import qualified Data.ByteString.Char8 as B import Control.Concurrent import Foreign.Marshal.Alloc import GHC.IO.Handle import System.Environment main = do [host, port] <- getArgs sh <- connectTo host $ PortNumber $ fromInt...
robgssp/uvb
names.hs
gpl-3.0
876
0
15
186
354
176
178
29
1
{-- Format, and construction of secpal proofs -} module Logic.SecPAL.Proof where import Logic.SecPAL.Language hiding (constraint, delegation) import Logic.General.Constraints (C) import Logic.SecPAL.Pretty import Logic.General.Pretty() import Logic.SecPAL.Context import Data.List import qualified Logic.SecPAL.Substitu...
bogwonch/SecPAL
src/Logic/SecPAL/Proof.hs
gpl-3.0
4,168
4
13
1,528
1,489
792
697
94
2
module Main where import Test.Framework (defaultMain) import Test.Framework.Providers.API import System.FilePath import System.Directory import System.Process import System.Exit import Control.Exception import Data.Typeable import Prelude hiding (catch) data CheckResult = CheckOk -- ^ The property ...
mboes/dedukti
Test.hs
gpl-3.0
3,104
0
18
860
790
411
379
-1
-1
{-# LANGUAGE OverloadedStrings #-} module TestUtils where import Test.Microspec import Prelude hiding ((<*), (*>)) import Data.List (sort) import Sound.Tidal.Context import qualified Data.Map.Strict as Map -- | Compare the events of two patterns using the given arc compareP :: (Ord a, Show a) => Arc -> Pattern a...
d0kt0r0/Tidal
test/TestUtils.hs
gpl-3.0
1,184
0
11
220
383
204
179
19
1
{-# LANGUAGE UnicodeSyntax, OverloadedStrings #-} {-# LANGUAGE FlexibleContexts, ConstraintKinds, TypeSynonymInstances, FlexibleInstances #-} -- -- implements ToMarkup for diff tree so that you can call Blaze toHtml on a -- diff tree. -- module ExtRep.DiffTreeToHtml (RenderableTree) where import BaseImport import Data...
c0c0n3/audidoza
app/ExtRep/DiffTreeToHtml.hs
gpl-3.0
2,778
0
12
728
581
303
278
34
5
module Problems01thru10 where import Data.List (group) -- Problem 1 -- Find the last element of a list last' :: [a] -> a last' [] = undefined last' [x] = x last' (x:xs) = last' xs last'' :: [a] -> a last'' xs | null xs = undefined | otherwise = xs !! (n-1) where n = length xs -- Problem 2 -- Find the...
zcesur/h99
src/Problems01thru10.hs
gpl-3.0
2,853
0
11
703
960
516
444
55
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-bigtableadmin/gen/Network/Google/Resource/BigtableAdmin/Projects/Instances/GetIAMPolicy.hs
mpl-2.0
6,149
0
16
1,333
795
466
329
122
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Locations/Agents/Flows/TransitionRouteGroups/Patch.hs
mpl-2.0
8,733
0
18
1,721
955
561
394
151
1
{-# LANGUAGE OverloadedStrings #-} module TransportUDP (startNodeComm) where import Blockchain (Block, BlockData) import CommandDispatcher import Logging (consensusFollower) import Control.Concurrent (forkIO) import Data.Mono...
haroldcarr/learn-haskell-coq-ml-etc
haskell/playpen/blockchain/blockchain-framework-DELETE/src/TransportUDP.hs
unlicense
2,451
0
17
621
644
324
320
45
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} module DeployR.Types where import Data.Aeson.Type...
jberthold/deployR-hs
src/DeployR/Types.hs
apache-2.0
13,810
0
16
3,574
2,677
1,511
1,166
238
2
{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveTraversable #-} module LambdaQuest.SystemF.Type (TypeT(..,TyInt,TyReal,TyBool,TyUnit),Type ,TermT(..),Term ,isValue ,BindingT(..),Binding ,getTypeFromContext ,module LambdaQuest.Common.Type )...
minoki/LambdaQuest
src/LambdaQuest/SystemF/Type.hs
bsd-3-clause
3,129
2
12
1,013
1,083
551
532
79
5
---------------------------------------------------------------------------- -- | -- Module : Language.Core.Interpreter.Util -- Copyright : (c) Carlos López-Camey, University of Freiburg -- License : BSD-3 -- -- Maintainer : [email protected] -- Stability : stable -- -- -- Useful combinators to use i...
kmels/dart-haskell
src/Language/Core/Interpreter/Util.hs
bsd-3-clause
5,970
0
15
1,255
1,263
656
607
74
6
{-# LANGUAGE OverloadedStrings #-} module ETA.CodeGen.Monad (CgEnv(..), CgState(..), CodeGen(..), crashDoc, debugDoc, printDoc, debugState, debug, withSequel, emit, initCg, getCgLoc, getCodeWithResult, newTemp, newIdLoc, peekNextLocal, setNextLocal, newLocal, newL...
alexander-at-github/eta
compiler/ETA/CodeGen/Monad.hs
bsd-3-clause
14,767
0
22
3,619
4,358
2,295
2,063
-1
-1
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell import Language.Haskell.Liquid.Prelude myabs x = if x `gt` 0 then x else 0 `minus` x absList xs = map myabs xs prop1 = map (liquidAssertB . (`geq` 0)) $ absList $ map choose [1..] numAbs x = if x > 0 then x else (0 - x) numAbsList = map numAbs prop2 ...
spinda/liquidhaskell
tests/gsoc15/unknown/pos/poslist.hs
bsd-3-clause
386
0
10
93
160
90
70
9
2
-- | This primarily exports the CStorable typeclass, which may have its -- methods automatically defaulted if it has a Generic instance. -- Then, this instance can be transfered via the `Storable' constructor. module Foreign.CStorable (CStorable(..), StorableWrap(..) ) where import Foreign.CStorable.TypeClass imp...
maurer/c-storable-deriving
Foreign/CStorable.hs
bsd-3-clause
862
0
9
159
167
93
74
13
0
-- | The module is used as a convinient starting point. It re-exports: -- -- * "Music.Diatonic.Note" -- -- * "Music.Diatonic.Interval" -- -- * "Music.Diatonic.Degree" -- -- * "Music.Diatonic.Quality" -- -- * "Music.Diatonic.Equivalence" module Music.Diatonic ( module Music.Diatonic.Note, module Music.Diatonic....
xpika/music-diatonic
Music/Diatonic.hs
bsd-3-clause
600
0
5
83
84
61
23
11
0
{-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE RankNTypes #-} {-# OPTIONS_HADDOCK hide #-} -- | -- Module : Data.Array.Accelerate.Trafo.Substitution -- Copyright : [2012] Manuel M T Chakravarty, Gabriele Keller, Trevor L. McDonell -- License :...
robeverest/accelerate
Data/Array/Accelerate/Trafo/Substitution.hs
bsd-3-clause
28,760
0
15
9,142
11,164
5,361
5,803
533
31
{-# LANGUAGE StandaloneDeriving, GeneralizedNewtypeDeriving #-} module Data.TrieMap.ReverseMap.Tests where import Data.TrieMap.ReverseMap () import Data.TrieMap.WordMap () import Data.TrieMap.Modifiers import Data.Word import qualified Data.TrieMap.TrieKey.Tests as TrieKeyTests import Test.QuickCheck deriving insta...
lowasser/TrieMap
Data/TrieMap/ReverseMap/Tests.hs
bsd-3-clause
446
0
8
48
103
63
40
11
1
{-| Module : Algebra.Function Description : Boilerplate code. Copyright : (c) Janthelme, 2016 License : BDS3 Maintainer : [email protected] Stability : experimental Portability : POSIX Boilerplate code to translate @a->b@ functions into corresponding @'Relvar.Elem'->'Relvar.Elem'@ functions (see 'liftE...
JAnthelme/relation-tool
src/Algebra/Function.hs
bsd-3-clause
17,849
0
13
3,083
5,416
2,575
2,841
364
1
module ReaderT ( ) where import Control.Applicative import Control.Monad newtype ReaderT r m a = ReaderT { runReaderT :: r -> m a} instance Functor m => Functor (ReaderT r m) where fmap f (ReaderT rma) = ReaderT $ (fmap . fmap) f rma -- ^ ^ -- | | -- ...
nicklawls/haskellbook
src/ReaderT.hs
bsd-3-clause
726
0
13
236
251
133
118
18
0
{-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE Strict #-} {-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module Graphics.Vulkan.CommandBufferBuilding where import Graphics.Vulkan.Buffer( VkBuffer(..) ) import Graphics.Vulkan.Pass...
oldmanmike/vulkan
src/Graphics/Vulkan/CommandBufferBuilding.hs
bsd-3-clause
23,206
0
18
7,031
5,448
3,014
2,434
424
0
{-# OPTIONS_GHC -fno-warn-orphans #-} module Application ( getApplicationDev , appMain , develMain , makeFoundation -- * for DevelMain , getApplicationRepl , shutdownApp -- * for GHCI , handler , db ) where import Control.Monad.Logger (liftLoc, runLoggingT) i...
cutsea110/Kestrel
Application.hs
bsd-3-clause
6,819
0
16
1,755
1,031
553
478
-1
-1
module LaTeXGrapher.Data.Function ( Function(..) , FunctionData(..) , defineFunction , FExpression(..) , EPoint ) where import Data.List(intersperse) import LaTeXGrapher.Data.Expression import LaTeXGrapher.Data.Tabular data Function = Function { name :: String , fu...
fryguybob/LaTeXGrapher
src/LaTeXGrapher/Data/Function.hs
bsd-3-clause
1,373
0
14
363
471
263
208
35
1
module Game.Server.Player( PlayerMapping , playersCollection , ServerPlayer , ServerPlayerExt(..) , PlayerShoots ) where import Control.Monad import Control.Monad.IO.Class import Data.Align import Data.Map.Strict (Map) import Data.Monoid import Data.These import Linear import qualified Data.List.NonEmpt...
Teaspot-Studio/gore-and-ash-demo
src/server/Game/Server/Player.hs
bsd-3-clause
9,158
0
27
2,447
2,341
1,182
1,159
-1
-1
module Lib ( parseInput , DateNumOrDate , dateNumOrDateToString , dateToDateNum , dateNumToDate ) where import Text.ParserCombinators.Parsec hiding ((<|>)) import Control.Applicative import Data.Time type DateNum = Integer type Date = Day data DateNumOrDate = DateNum DateNum | Date Date cwEpo...
mhweaver/daynum
src/Lib.hs
bsd-3-clause
2,773
0
13
1,096
547
288
259
35
2
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} module Data.Typewriter.Variadic.Flip where import Data.Typewriter.Core -- TODO: this is really ad-hoc, need something more sensible here type family Swap t :: * type instance S...
isomorphism/typewriter
Data/Typewriter/Variadic/Flip.hs
bsd-3-clause
1,199
0
12
307
506
273
233
29
0
{-# LANGUAGE OverloadedStrings #-} module WebServerApi (getSumAction) where import Web.Scotty import Data.Monoid (mconcat) import Control.Monad.Trans (liftIO) import qualified Data.Text.Lazy as LazyText import qualified Data.Text as Text import Database.PostgreSQL.Simple import DatabaseApi getSumAction :: Connect...
jorgen/scotty-postgres
src/WebServerApi.hs
bsd-3-clause
583
0
13
96
159
89
70
15
1
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE CPP, NoImplicitPrelude, CApiFFI #-} {-# OPTIONS_HADDOCK hide #-} #ifdef ghcjs_HOST_OS {-# LANGUAGE JavaScriptFFI #-} #endif ----------------------------------------------------------------------------- -- | -- Module : System.Posix.Internals -- Copyright : (c) The Uni...
tolysz/prepare-ghcjs
spec-lts8/base/System/Posix/Internals.hs
bsd-3-clause
30,172
330
20
5,888
5,279
2,680
2,599
-1
-1
{-# LANGUAGE ScopedTypeVariables #-} module Appraiser where import TPM import VChanUtil import Demo3Shared import Provisioning import CommTools import Data.Word import Data.Binary import Data.ByteString.Lazy (ByteString, pack, append, empty, cons, fromStrict, length) import Data.Bits import qualified Data.Text as T ...
armoredsoftware/protocol
tpm/mainline/appraisal/Appraiser.hs
bsd-3-clause
7,427
0
16
1,839
1,530
813
717
131
3
#include "Any/File.h" main = print "Hello"
alphaHeavy/hlint
tests/cpp-simple.hs
gpl-2.0
44
0
5
7
10
5
5
1
1
{-# LANGUAGE TemplateHaskell, TypeSynonymInstances, FlexibleInstances #-} module Language.Java.Paragon.Annotated where import Language.Haskell.TH --import Language.Haskell.TH.Syntax import Control.Monad ((<=<)) class Functor ast => Annotated ast where ann :: ast l -> l amap :: (l -> l) -> ast l -> ast l modName ...
bvdelft/parac2
src/Language/Java/Paragon/Annotated.hs
bsd-3-clause
2,902
0
16
664
1,024
532
492
50
5
{-# LANGUAGE CPP #-} {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeOperators #-} #ifndef ACCELERATE_DEBUG {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} {-# OPTIONS_GHC -fno-warn-unused-impo...
rrnewton/accelerate
Data/Array/Accelerate/Debug/Flags.hs
bsd-3-clause
9,991
0
19
2,978
1,788
968
820
156
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-s3/gen/Network/AWS/S3/HeadBucket.hs
mpl-2.0
2,750
0
9
649
363
219
144
49
1
{- Copyright 2015 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 a...
xwysp/codeworld
codeworld-base/src/Foreign/Concurrent.hs
apache-2.0
751
0
4
136
23
17
6
4
0
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE OverloadedStrings #-} {- Copyright 2017 The CodeWorld Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain...
venkat24/codeworld
codeworld-game-server/src/Bot.hs
apache-2.0
5,355
0
23
1,597
1,381
676
705
137
9
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} module Yesod.Core ( -- * Type classes Yesod (..) , YesodDispatch (..) , YesodSub...
andrewthad/yesod
yesod-core/Yesod/Core.hs
mit
5,471
0
12
1,289
1,150
712
438
157
2
{-# LANGUAGE PolyKinds, TypeApplications, KindSignatures, DataKinds, GADTs , TypeFamilies, RankNTypes #-} module T12045c where import Data.Kind type family F a where F @Type a = Bool F @(Type -> Type) b = Char
sdiehl/ghc
testsuite/tests/typecheck/should_fail/T12045c.hs
bsd-3-clause
229
2
8
52
48
28
20
-1
-1
module TMVar where import Control.Concurrent.STM hiding (TMVar, takeTMVar) -- <<TMVar newtype TMVar a = TMVar (TVar (Maybe a)) -- >> newTMVar :: a -> STM (TMVar a) newTMVar a = do t <- newTVar (Just a) return (TMVar t) -- <<newEmptyTMVar newEmptyTMVar :: STM (TMVar a) newEmptyTMVar = do t <- newTVar Nothing ...
AndrewRademacher/parconc-examples
tmvar.hs
bsd-3-clause
979
0
14
295
382
189
193
32
2
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# OPTIONS_GHC -fdefer-type-errors -O #-} -- Oddly this bug was only triggered with -fdefer-type-errors -- The -O ensures that the RULE is processed module T14732 where import Prelude hiding (zip, zipWith) impor...
sdiehl/ghc
testsuite/tests/typecheck/should_compile/T14732.hs
bsd-3-clause
928
0
9
228
216
120
96
-1
-1
module Main where foreign import ccall "power3" power3 :: Int -> Int main = print $ power3 4
sdiehl/ghc
testsuite/tests/rts/linker/T11223/power3.hs
bsd-3-clause
95
0
6
20
32
18
14
3
1
{-# LANGUAGE MagicHash, UnboxedTuples #-} import GHC.Prim import GHC.Word big :: Word big = maxBound carry :: Word carry = case big of W# w -> case plusWord2# w w of (# hi, lo #) -> W# hi main = print carry
oldmanmike/ghc
testsuite/tests/codeGen/should_run/T9013.hs
bsd-3-clause
217
0
11
52
76
40
36
10
1
{-# OPTIONS_GHC -fwarn-safe #-} -- | Basic test to see if Safe warning flags compile -- Warn if module is infered safe -- In this test the warning _shouldn't_ fire module SafeFlags23 where import System.IO.Unsafe f :: Int f = 1
urbanslug/ghc
testsuite/tests/safeHaskell/flags/SafeFlags24.hs
bsd-3-clause
231
0
4
44
24
17
7
5
1
data NBaum a = NBlatt a | NKnoten a [NBaum a] deriving (Show) entferneBlaetter :: NBaum a -> NBaum a entferneBlaetter (NKnoten s xs) = NKnoten s [entferneBlaetter x | x <- xs, not $ isLeaf x] entferneBlaetter x = x isLeaf :: NBaum a -> Bool isLeaf (NBlatt _) = True isLeaf (NKnoten _ []) = True isLea...
michalc/haskell-experiments
tree.hs
mit
587
0
9
135
187
94
93
10
1
main = do print c where a = 1 b = 2 c = a + b
shigemk2/haskell_abc
Hoge.hs
mit
79
0
7
50
33
17
16
5
1
module Main where import Data.List (sort, reverse) type CountryName = String type Bugs = Int data Country = Country { name :: CountryName, bugs :: Bugs } deriving (Show, Eq) instance Ord Country where (Country _ b1) `compare` (Country _ b2) = b1 `compare` b2 upda...
Valiev/contests
darkus/201506/Main.hs
mit
1,131
0
8
389
342
186
156
26
2
module ArbitrarySum where import Test.QuickCheck import Data.Monoid -- the module designed to avoid the warning: -- "No instance for (Arbitrary (Sum Int))" -- see http://austinrochford.com/posts/2014-05-27-quickcheck-laws.html instance (Arbitrary a) => Arbitrary (Sum a) where arbitrary = Sum <$> arbitrary ...
NickAger/LearningHaskell
HaskellProgrammingFromFirstPrinciples/Chapter15.hsproj/ArbitrarySum.hs
mit
574
0
7
114
56
36
20
5
0
module Rebase.Data.Unique ( module Data.Unique ) where import Data.Unique
nikita-volkov/rebase
library/Rebase/Data/Unique.hs
mit
77
0
5
12
20
13
7
4
0
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} module Solar.Storage.Context ( Context(..) , noContext , addToContext , (~+=:) -- * Context Wrappers , contextWrap , contextWrap2 , contextWrap3 , contextWrap4 , contextWrap5 , contextWrap6 , contextWrap7 , contextWrap...
Cordite-Studios/solar
solar-cells/Solar/Storage/Context.hs
mit
3,613
0
13
1,040
1,011
546
465
76
3
{-# LANGUAGE FlexibleInstances #-} module Bot.Component.Impl.History ( HistoryHandle , Nick , Message , newHistoryHandle , historyService , getHistory ) where import Bot.Component import Bot.IO import Control.Applicative import Control.Concurrent import Control.Monad.Error import Control.Monad.State i...
numberten/zhenya_bot
Bot/Component/Impl/History.hs
mit
2,205
0
18
598
483
266
217
49
1
module Anagram (anagramsFor) where import Data.Char (ord, toUpper) import Data.List (sort) anagramsFor :: String -> [String] -> [String] anagramsFor = filter . isAnagram isAnagram :: String -> String -> Bool isAnagram xs ys | length xs /= length ys = False | sumAscii xs' /= sumAscii ys' = False | x...
vaibhav276/exercism_haskell
anagram/src/Anagram.hs
mit
558
0
9
202
193
97
96
15
1
module Actions where import Import import DbFunctions import Database.Persist.Sql go :: Text -> Int64 -> Text -> Handler Text go loc areaId urlHash = do area <- lookAtArea areaId case area of Just area' -> do let newAreaId = case loc of "north" -> areaGo_north area' ...
total-git/missingno
yesodMissingNo/Actions.hs
mit
5,731
19
29
1,809
1,665
778
887
119
7
module GHCJS.DOM.CSSPageRule ( ) where
manyoo/ghcjs-dom
ghcjs-dom-webkit/src/GHCJS/DOM/CSSPageRule.hs
mit
41
0
3
7
10
7
3
1
0
{-# LANGUAGE OverloadedLists #-} -- | Example using the pure scene graph to make a static scene. module Main where import qualified Linear as L import qualified Iris.Backends.GLFW as W import Iris.Camera import Iris.SceneGraph import Iris.Visuals.Line main :: IO () main = do win <-...
jdreaver/iris
examples/Pure2D.hs
mit
915
0
13
329
260
139
121
24
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE DeriveDataTypeable #-} -- | Dynamically look up available executables. module Plugins ( Plugin , pluginPrefix , pluginName , pluginSummary , pluginProc , Plugins , findPlugins , listPlugins , lookupPlugin , callPlugin ,...
fpco/stackage-cli
src/Plugins.hs
mit
6,271
0
16
1,176
1,744
930
814
163
3
module Main (main) where import qualified Data.Text as T data Variable = Variable String deriving (Show, Eq) data Predicate = Predicate String deriving (Show, Eq) data Expr = Atomic Predicate [Variable] | Not Expr | Expr :|: Expr | Expr :&: Expr | Forall Variable Expr ...
IreneKnapp/Inductive
Haskell/Inductive.hs
mit
3,820
0
12
1,082
1,458
752
706
81
1
module Shared.Input where import qualified Graphics.UI.SDL as SDL import Graphics.UI.SDL.Types data KeyDirection = KeyUp | KeyDown | KeyLeft | KeyRight | KeyOther deriving (Show, Read) data Key = Q | W | E | A | S | D | Unknown type Input = Maybe SDL.Event handleNoInput :: IO (Maybe SDL.Event) -> IO Bool handleNoInp...
oldmanmike/haskellSDL2Examples
src/shared/input.hs
gpl-2.0
1,220
0
14
353
454
230
224
39
7
{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} module PackagesNG.ParsePackage where import Control.Applicative ((<*)) import qualified Data.Attoparsec.ByteString.Char8 as Atto (Parser (), char, char, decimal, ...
vikraman/packages-ng
parse-packages/src/PackagesNG/ParsePackage.hs
gpl-2.0
4,015
0
12
1,557
1,012
515
497
83
1
module State ( Sym, dosym , gensym, push ) where -- state Monad ---------------------------------------------------- data Sym s a = Sym (s -> (s, a)) dosym :: Sym (Int, [s]) a -> (a, [s]) -- start computation, show effect dosym (Sym f) = let ((_, x), r) = f (0, []) in (r, x) instance Functor (Sym s) where fmap...
jwaldmann/rx
src/State.hs
gpl-3.0
868
4
13
231
460
257
203
17
1
module Pipes.Network.TCP.UIO ((>^>), fromSocket, toSocket) where import Control.Monad.Morph (MFunctor, hoist) import Control.Monad.Trans.Class (MonadTrans, lift) import Data.ByteString (ByteString) import Data.Word (Word16) import Pipes (Producer, Consumer, Effect, (>->)) import qualified Pipes.Network.TCP as T import...
rimmington/pirandello
src/Pipes/Network/TCP/UIO.hs
gpl-3.0
812
0
12
127
350
193
157
-1
-1
module Utility where import Control.Monad import Control.Monad.Random import Debug.Trace import Text.Regex randomPM1 :: (MonadRandom m) => m Double randomPM1 = (+ (-1)) . (* 2) <$> getRandom screen :: (Show a) => a -> a screen = join traceShow screenT :: (Show a) => String ->...
mrlovre/super-memory
Pro5/src/Utility.hs
gpl-3.0
485
0
10
123
180
100
80
14
1
{-# LANGUAGE TemplateHaskell #-} module SNet.Network ( SNet , Info (..) , location , createTasks , Location (..) , initChildNet , spawnSNet ) where import Control.Lens import Control.Monad.State import Data.Default import SNet.Stream newtype Location = Loc Int data Info = Info { _location :: Locatio...
merijn/SNet2.0
SNet/Network.hs
gpl-3.0
804
0
9
187
254
137
117
32
1
{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeOperators #-} module Cereal where import Data.Bits import GHC.Generics data Bit = O | I deriving Show class Serialize a where put :: a -> [Bit] default put :: (Gen...
capitanbatata/sandbox
scrapping-expressions-boilerplate/src/Cereal.hs
gpl-3.0
2,208
0
12
560
970
516
454
57
1
toExp :: (a -> b) -> Exp a b toExp f = Lan (f . fst) (I ()) fromExp :: Exp a b -> (a -> b) fromExp (Lan f (I x)) = \a -> f (a, x)
hmemcpy/milewski-ctfp-pdf
src/content/3.11/code/haskell/snippet08.hs
gpl-3.0
130
0
9
38
107
55
52
4
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- | -- Module : Network.Google.Blogger.Typ...
rueshyna/gogol
gogol-blogger/gen/Network/Google/Blogger/Types/Product.hs
mpl-2.0
69,208
0
30
19,689
16,650
9,536
7,114
1,717
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-admin-reports/gen/Network/Google/Resource/Reports/Activities/List.hs
mpl-2.0
15,536
0
31
3,686
1,682
999
683
224
1
{-#LANGUAGE OverloadedStrings#-} module Data.P440.XML.Instances.Parse.ComplexTypes where import qualified Data.P440.Domain.SimpleTypes as S import qualified Data.P440.Domain.ComplexTypes as C import Control.Applicative import Data.P440.XML.Parse -- Сложные типы из раздела 2.18 -- Сведения о банке (филиале) БанкТип...
Macil-dev/p440
src/Data/P440/XML/Instances/Parse/ComplexTypes.hs
unlicense
4,267
0
17
1,131
1,178
586
592
82
1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveAnyClass #-} module Nanocoin.Network.Cmd ( Cmd(..), cmdProc ) where {- This module is necessary because the Process type cannot easily be the base monad for some transformer stacks because Control.Distributed.Process does not export the `Process` monad da...
tdietert/nanocoin
src/Nanocoin/Network/Cmd.hs
apache-2.0
1,986
0
11
371
298
165
133
35
2
{-# LANGUAGE Rank2Types #-} {-# LANGUAGE TemplateHaskell #-} -- | Utilities for rewriting: e.g. inlining, specialisation, etc. module CLaSH.Rewrite.Util where import Control.DeepSeq import Control.Lens (Lens', (%=), (+=), (^.)) import qualified Control.Lens a...
christiaanb/clash-compiler
clash-lib/src/CLaSH/Rewrite/Util.hs
bsd-2-clause
24,176
0
30
7,473
6,547
3,371
3,176
397
9
{-# LANGUAGE OverloadedStrings, LambdaCase #-} module Halive where import GHC import Linker import Packages import DynFlags import GHC.Paths import Outputable import Data.IORef import Data.String (fromString) import Control.Monad import Control.Concurrent import Control.Monad.IO.Class import System.FSNotify import Sy...
nfjinjing/halive
exec/Halive.hs
bsd-2-clause
5,035
0
21
1,472
993
490
503
-1
-1
{-# LANGUAGE NoMonomorphismRestriction, Rank2Types, RebindableSyntax #-} {-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-do-bind #-} module Language.Brainfuck.Emitter (emit) where import Control.Monad (forM_) import Control.Monad.Fix import Control.Monad.Code import Control.Monad.ConstantPool import Control....
sonyandy/tnt
Language/Brainfuck/Emitter.hs
bsd-3-clause
1,917
0
14
369
626
293
333
75
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DataKinds #-} module Main where import Control.Exception.Base import Control.Concurrent import Control.Concurrent.Async import Control.Concurrent.STM import Control.Monad import qualified Data.Attoparsec.ByteString.Lazy as AL import ...
farnoy/torrent
app/Main.hs
bsd-3-clause
2,198
0
15
325
611
303
308
58
1
{-# LANGUAGE NoImplicitPrelude, RankNTypes, TemplateHaskell, QuasiQuotes, OverloadedStrings, ConstraintKinds, FlexibleInstances, FlexibleContexts, TypeFamilies, GADTs #-} {-# LANGUAGE RecordWildCards #-} module MediaSub.PlainAnnex where import qualified Data.Conduit.List as CL import MediaSub.Import import ...
SimSaladin/rnfssp
rnfssp-media/MediaSub/PlainAnnex.hs
bsd-3-clause
1,210
0
10
250
276
144
132
24
1
{-# LANGUAGE TypeFamilies #-} module Pipes.PostgreSQL.Simple.SafeT (Format(..), toTable) where import Control.Monad (void) import Control.Monad.Catch (catchAll, throwM) import Control.Monad.IO.Class (MonadIO, liftIO) import Data.ByteString (ByteString) import Data.String (fromString) import qualified Database.Postgre...
ocharles/pipes-postgresql-simple
src/Pipes/PostgreSQL/Simple/SafeT.hs
bsd-3-clause
1,530
0
17
295
404
230
174
32
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} import Control.Concurrent.STM import Control.Monad.IO.Class import Data.Aeson import Data.Proxy import GHC.Generics import Network.Wai.Handler.Warp (run) import Servant import Servant.JQ...
derekelkins/servant-jquery
examples/counter.hs
bsd-3-clause
2,275
0
11
508
498
261
237
51
1
{- - Claq (c) 2013 NEC Laboratories America, Inc. All rights reserved. - - This file is part of Claq. - Claq is distributed under the 3-clause BSD license. - See the LICENSE file for more details. -} {-# LANGUAGE FlexibleContexts #-} module Language.Claq.Parser (circuit) where import Control.Monad.Free import...
ti1024/claq
src/Language/Claq/Parser.hs
bsd-3-clause
3,787
0
13
1,096
1,324
682
642
94
3
module Jana.Format where import Prelude hiding (GT, LT, EQ, (<>)) import Data.List (intersperse) import Text.PrettyPrint import qualified Data.Map as Map import Jana.Ast commasep = hsep . punctuate (char ',') formatType (Int _) = text "int" formatType (Stack _) = text "stack" formatIdent :: Ident -> Doc formatI...
mbudde/jana
src/Jana/Format.hs
bsd-3-clause
6,662
0
13
1,744
2,776
1,393
1,383
170
11
module Data.Text.Encoding where encodeUtf8 = id decodeUtf8 = id
Soostone/string-compat
src/Data/Text/Encoding.hs
bsd-3-clause
67
0
4
12
17
11
6
3
1
module Data.LFSR.Tap2 ( Tap2(..), tap2, ) where import Data.Array (Array, array, (!)) data Tap2 = Tap2 { width :: Int , bits :: (Int, Int) } deriving Show tapPair :: (Int, (Int, Int)) -> (Int, Tap2) tapPair (i, bs) = (i, Tap2 { width = i, bits = bs }) tap2Table :: Array Int...
khibino/haskell-lfsr
src/Data/LFSR/Tap2.hs
bsd-3-clause
502
0
9
161
242
152
90
18
1
module Main where data List a = Cons a (List a) | Nil deriving (Show) sumList :: List Integer -> Integer sumList lst = undefined -- must be unguarded identifier of undefined add :: Integer -> Integer -> Integer add = (+) zero,one :: Integer zero = 0 one = 1 {- check :: [Bool] check = [check_a, check_b] check_...
sw17ch/Volcano
stash/spec.hs
bsd-3-clause
475
0
8
110
91
54
37
10
1
{-| Copyright : (c) Dave Laing, 2017 License : BSD3 Maintainer : [email protected] Stability : experimental Portability : non-portable -} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE TypeFamilies ...
dalaing/type-systems
src/Rules/Type/Infer/Offline.hs
bsd-3-clause
4,564
0
17
1,161
1,778
911
867
-1
-1
module SAWScript.Prover.RME where import Control.Monad.IO.Class import qualified Data.Map as Map import qualified Data.RME as RME import Verifier.SAW.FiniteValue import qualified Verifier.SAW.Simulator.RME as RME import SAWScript.Proof(Prop, propToSATQuery, propSize, CEX) import SAWScript.Prover.SolverStats import...
GaloisInc/saw-script
src/SAWScript/Prover/RME.hs
bsd-3-clause
1,508
0
30
440
451
231
220
31
3
module Module4.Task27 where newtype Maybe' a = Maybe' { getMaybe :: Maybe a } deriving (Eq,Show) instance Monoid a => Monoid (Maybe' a) where mempty = Maybe' $ Just mempty mappend (Maybe' Nothing) _ = Maybe' Nothing mappend _ (Maybe' Nothing) = Maybe' Nothing mappend (Maybe' a) (Maybe' b) = Maybe' (ma...
dstarcev/stepic-haskell
src/Module4/Task27.hs
bsd-3-clause
332
0
8
73
138
71
67
7
0
module VMA.Bracket ( brackets ) where import Relude hiding ( Handle , Type ) import Data.Vector ( Vector ) import qualified Data.Map as Map im...
expipiplus1/vulkan
generate-new/vma/VMA/Bracket.hs
bsd-3-clause
2,912
0
21
742
593
311
282
-1
-1
{-# LANGUAGE CPP, BangPatterns, RecordWildCards, NamedFieldPuns, DeriveGeneric, DeriveDataTypeable, GeneralizedNewtypeDeriving, ScopedTypeVariables #-} -- | -- module Distribution.Client.ProjectBuilding ( BuildStatus(..), BuildStatusMap, BuildStatusRebuild(..), BuildReason(.....
headprogrammingczar/cabal
cabal-install/Distribution/Client/ProjectBuilding.hs
bsd-3-clause
58,703
0
27
18,286
8,108
4,201
3,907
807
12
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module Pushbullet.Models.PushRequest ( Target(..), Message(..), PushRequest(..) ) where import Control.Applicative ((<$>), (<*>), (<|>)) import Data.Aeson (FromJSON, ToJSO...
joshbohde/pushbullet
src/Pushbullet/Models/PushRequest.hs
bsd-3-clause
2,588
0
16
768
839
460
379
64
1
{-# LANGUAGE CPP #-} {-# LANGUAGE ForeignFunctionInterface #-} module Web.Browser.Windows ( openBrowserWindows ) where import System.Win32.Types (INT, HANDLE, HINSTANCE, LPCTSTR, handleToWord, nullPtr, withTString) openBrowserWindows :: String -> IO Bool openBrowserWindows url = withTSt...
rightfold/open-browser
lib/Web/Browser/Windows.hs
bsd-3-clause
1,268
2
11
568
181
103
78
-1
-1