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
module Lib ( helloWorld ) where helloWorld :: IO () helloWorld = putStrLn "Hello world!"
stackbuilders/hapistrano
example/src/Lib.hs
mit
98
0
6
24
27
15
12
4
1
--map takes a function and a list and applies that function to all elements map' :: (a -> b) -> [a] -> [b] map' _ [] = [] map' f (x:xs) = f x : map' f xs map1 = map' (replicate 3) [3..6] map2 = map (map (^2)) [[1,2],[3,4,5,6],[7,8]] --filter takes a predicate and returns a list filter' :: (a -> Bool) -> [a] -> [a...
luisgepeto/HaskellLearning
06 Higher Order Functions/03_maps_and_filters.hs
mit
1,688
0
12
406
755
411
344
34
1
module Main where import System (getArgs) import System.Console.GetOpt import System.IO import System.Directory import System.FS.RDFS data Options = Options { optVerbose :: Bool , optShowVersion :: Bool , optFiles :: [FilePath] } deriving Show defaultOptions = Options { optV...
realdesktop/rdfs
exec/Main.hs
mit
1,348
0
13
342
430
238
192
43
2
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.SVGForeignObjectElement (getX, getY, getWidth, getHeight, SVGForeignObjectElement(..), gTypeSVGForeignObj...
ghcjs/jsaddle-dom
src/JSDOM/Generated/SVGForeignObjectElement.hs
mit
2,220
0
10
268
504
308
196
33
1
{-# LANGUAGE GADTs, DataKinds, TypeFamilies, TypeOperators, PolyKinds #-} module ListProofs where import Data.Singletons.Prelude import Data.Type.Equality import FunctionProofs {- data MapP f l r where MapNil :: MapP f '[] '[] MapCons :: MapP f as bs -> MapP f (a ': as) (Apply f a ': bs) mapP :: SList l -> MapP...
vladfi1/hs-misc
ListProofs.hs
mit
2,062
0
14
489
270
140
130
17
2
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} module Tinc.Sandbox ( PackageConfig , Sandbox , findPackageDb , initSandbox , recache , cabalSandboxDirectory , cabalSandboxBinDirectory , listPackages #ifdef TEST , packageFromPackageConf...
robbinch/tinc
src/Tinc/Sandbox.hs
mit
3,362
0
13
584
908
466
442
-1
-1
module Day08 where import Debug.Trace import Data.Char part1 :: IO () part1 = do text <- readFile "lib/day08-input.txt" let f l = length l - go l (print . sum . map f . words) text where go :: String -> Int go [] = 0 go ('\"' :xs) = go xs go ('\\':'x':_:_:xs...
cirquit/Personal-Repository
Haskell/Playground/AdventOfCode/advent-coding/src/Day08.hs
mit
602
0
13
226
297
144
153
20
6
module Sound.Morse ( encodeString , encodeMorse , morseTable , fromChar , morseToBool , Morse(..) ) where import Data.List (intersperse) import Data.Char (toLower) import Data.Maybe (fromMaybe) import Control.Arrow (first) import qualified Data.Map as Map data Morse = Dit | Dah | Pause deriving (Show,...
fritz0705/morse
Sound/Morse.hs
mit
4,126
0
11
1,514
1,889
1,191
698
100
2
-- | First-order logic constants. ----------------------------------------------------------------------------- {-# LANGUAGE CPP #-} {-# LANGUAGE UnicodeSyntax #-} -- Adapted from AgdaLight (Plugins.FOL.Constants). module Apia.FOL.Constants ( lTrue , lFalse , lNot , lAnd , lOr , lCond , lBic...
asr/apia
src/Apia/FOL/Constants.hs
mit
1,100
0
4
256
139
99
40
37
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE DeriveGeneric #-} import GHC.Generics import Test.SmallCheck import Test.SmallCheck.Series data NList1 a = Empty | ConsElem a (NList1 a) | ConsList (NList1 a) (NList1 a) deriving (Show, Eq, Generic) data NList2 a = Elem ...
mihaimaruseac/blog-demos
lists/list.hs
mit
1,554
6
12
351
753
361
392
47
1
{-# LANGUAGE OverloadedStrings #-} -- | -- Module: Database.Neo4j -- Copyright: (c) 2014, Antoni Silvestre -- License: MIT -- Maintainer: Antoni Silvestre <antoni.silvestre@gmail.com> -- Stability: experimental -- Portability: portable -- -- Library to interact with the Neo4j REST API. -- module Databa...
asilvestre/haskell-neo4j-rest-client
src/Database/Neo4j.hs
mit
6,370
0
5
1,339
406
310
96
25
0
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE FlexibleInstances, OverloadedStrings, ScopedTypeVariables, DeriveDataTypeable, CPP #-} #if MIN_VERSION_base(4,8,0) #else {-# LANGUAGE OverlappingInstances #-} #endif {- Copyright (C) 2012-2015 John MacFarlane <jgm@berkeley.edu> This program is free software; you c...
Thell/pandoc
src/Text/Pandoc/Writers/Custom.hs
gpl-2.0
10,247
0
14
2,106
3,012
1,493
1,519
200
2
{-# LANGUAGE TemplateHaskell #-} module Nova.Config where import Config (Database(..), ServerType(..), BaseConfig(..)) import Data.Aeson.TH (deriveJSON, defaultOptions) import Data.Default (Default(..)) import System.Log.Logger (Priority(NOTICE)) data NovaConfig = NovaConfig { certificateFile ::...
VictorDenisov/keystone
src/Nova/Config.hs
gpl-2.0
1,690
0
9
751
269
169
100
35
1
module Interpreter.Repl (getInputLine) where import System.IO import System.Console.ANSI import Control.Applicative import Data.Maybe (fromMaybe) import Interpreter.Types keycodes :: [(String, Key)] keycodes = [ ("[D", KeyLeft) , ("[C", KeyRight) , ("[A", KeyUp) , ("[B", KeyDown) , ("[7", Ke...
felixsch/simplelisp
src/Interpreter/Repl.hs
gpl-2.0
2,506
0
16
780
953
496
457
63
8
module Game.Folivora.Sound where import Control.Concurrent import Data.IORef import Data.List import Control.Monad ( when, unless ) import Sound.ALUT type SoundCommand = Maybe String type Sound = SoundCommand data Channel = ChannelPlaying ThreadId | ChannelToPlay SoundCommand | ChannelGarbage deriving (Eq, Show) t...
caryoscelus/folivora-ge
src/Game/Folivora/Sound.hs
gpl-3.0
2,882
0
18
895
757
372
385
58
4
{-# LANGUAGE CPP, GADTs, RankNTypes, ScopedTypeVariables, TypeFamilies #-} #if __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -- | Utilities for clients of Hoopl, not used internally. module Compiler.Hoopl.XUtil ( -- * Utilities for clients firstXfer, distributeXfer , distributeFact, dist...
jwiegley/ghc-release
libraries/hoopl/src/Compiler/Hoopl/XUtil.hs
gpl-3.0
6,850
0
15
1,463
1,695
892
803
77
3
import Control.Monad as M import Data.List as L import System.Directory import System.Environment import System.FilePath import System.Random import Text.Printf {-# INLINE shuffle #-} shuffle :: [a] -> IO [a] shuffle xs = do ys <- M...
XinhuaZhang/PetaVisionHaskell
Application/Amoeba/GeneratePath.hs
gpl-3.0
3,991
0
17
1,180
1,216
632
584
107
1
module HLinear.Hook ( EchelonForm(..) , EchelonTransformation(..) , LeftTransformation(..) , PLEHook(..) , PLUEHook(..) , UEHook(..) ) where import HLinear.Hook.EchelonForm import HLinear.Hook.EchelonTransformation import HLinear.Hook.LeftTransformation import HLinear.Hook.PLEHook
martinra/hlinear
src/HLinear/Hook.hs
gpl-3.0
297
0
5
39
74
51
23
11
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-logging/gen/Network/Google/Resource/Logging/Organizations/Locations/Get.hs
mpl-2.0
4,830
0
15
1,078
704
412
292
103
1
{-# OPTIONS_GHC -F -pgmF ../../scripts/local-htfpp #-} import "HTF" Test.Framework -- error must be in line 7 test_foo :: Int test_foo = 5 main :: IO () main = return ()
skogsbaer/HTF
tests/compile-errors/Test3.hs
lgpl-2.1
173
0
6
33
39
22
17
-1
-1
{-# LANGUAGE RecordWildCards, TupleSections, LambdaCase #-} module ViperVM.Platform.Kernel where import Control.Applicative ((<$>)) import ViperVM.Platform.Proc import ViperVM.Platform.KernelParameter import ViperVM.Platform.KernelConstraint import ViperVM.Platform.ProcessorCapabilities import qualified ViperVM.Pla...
hsyl20/HViperVM
lib/ViperVM/Platform/Kernel.hs
lgpl-3.0
1,465
0
9
209
337
187
150
26
1
import Data.List (sort) main = do let test = [[2],[3,4],[6,5,7],[4,1,8,3]] print $ minimumTotal 0 test print $ minimumTotal 0 [[2]] minimumTotal :: Integer -> [[Integer]] -> Integer minimumTotal = foldl (\a b -> (head.sort) $ map (+ a) b)
ccqpein/Arithmetic-Exercises
Triangle/Triangle2.hs
apache-2.0
258
0
11
58
152
86
66
7
1
rank (m:e:j:_) | (m==100) || (e==100) || (j==100) = 'A' | m+e >= 180 = 'A' | m+e+j >= 240 = 'A' | m+e+j >= 210 = 'B' |(m+e+j >= 150) &&((m>=80) || (e>=80)) = 'B' | otherwise = 'C' ans ([0]:_) = [] ans (n:x) = let n'= (n!!0) o = map rank ...
a143753/AOJ
0218.hs
apache-2.0
512
1
14
203
359
181
178
18
1
-- | The 'MakeReflections' module takes the 'FileDescriptorProto' -- output from 'Resolve' and produces a 'ProtoInfo' from -- 'Reflections'. This also takes a Haskell module prefix and the -- proto's package namespace as input. The output is suitable -- for passing to the 'Gen' module to produce the files. -- -- This...
alphaHeavy/protocol-buffers
hprotoc/Text/ProtocolBuffers/ProtoCompile/MakeReflections.hs
apache-2.0
17,414
1
19
4,907
3,884
2,096
1,788
236
10
{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} module Network.Eureka.Application ( lookupByAppName , lookupByAppNameAll , lookupAllApplications ) where import Control.Monad (mzero) import Control.Monad.Logger (MonadLoggerIO) import Data.A...
SumAll/haskell-eureka-client
src/Network/Eureka/Application.hs
apache-2.0
4,451
0
16
1,150
1,023
553
470
84
2
module Main where import TAEval import TAType import TACheck import TAParser import TAPretty import CalcSyntax import Data.Maybe import Control.Monad.Trans import System.Console.Haskeline eval' :: Expr -> Expr eval' = fromJust . eval process :: String -> IO () process line = do let res = parseExpr line case re...
toonn/wyah
src/TA.hs
bsd-2-clause
749
0
20
200
262
130
132
29
3
-- | Tests for substring functions (@take@, @split@, @isInfixOf@, etc.) {-# OPTIONS_GHC -fno-enable-rewrite-rules -fno-warn-missing-signatures #-} module Tests.Properties.Substrings ( testSubstrings ) where import Data.Char (isSpace) import Test.QuickCheck import Test.Tasty (TestTree, testGroup) import Test.T...
bos/text
tests/Tests/Properties/Substrings.hs
bsd-2-clause
15,864
0
14
4,173
5,540
2,869
2,671
305
2
{-# LANGUAGE PackageImports #-} import "mini-scilab-site" Application (getApplicationDev) import Network.Wai.Handler.Warp (runSettings, defaultSettings, settingsPort) import Control.Concurrent (forkIO) import System.Directory (doesFileExist, removeFile) import System.Exit (exitSuccess) import Control.Concurrent (th...
marcotmarcot/mini-scilab-site
devel.hs
bsd-2-clause
710
0
10
123
186
101
85
23
2
{-# LANGUAGE CPP, OverloadedStrings #-} module Demo.JS ( readInputState , writeInputState , mkRandomInput , sDrawButton , printHighError , sCellsDiv , sNumCells , printLowError , cullErrors ...
RoboNickBot/linked-list-web-demo
src/Demo/JS.hs
bsd-2-clause
14,296
0
21
6,215
4,791
2,416
2,375
314
3
{-# LANGUAGE CPP, RankNTypes, ScopedTypeVariables #-} {-# LANGUAGE BangPatterns #-} {-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.InterfaceFile -- Copyright : (c) David Waern 2006-2009, -- Ma...
haskell/haddock
haddock-api/src/Haddock/InterfaceFile.hs
bsd-2-clause
22,415
0
28
7,907
6,462
3,039
3,423
-1
-1
-- | Settings are centralized, as much as possible, into this file. This -- includes database connection settings, static file locations, etc. -- In addition, you can configure a number of different aspects of Yesod -- by overriding methods in the Yesod typeclass. That instance is -- declared in the Foundation.hs file....
thlorenz/WebToInk
webtoink/Settings.hs
bsd-2-clause
2,518
0
9
454
295
187
108
-1
-1
{-# LANGUAGE OverloadedStrings #-} --{-# LANGUAGE QuasiQuotes #-} module Main where import MyLib (app) import Control.Monad (mzero) import Data.Aeson import Test.Hspec import Test.Hspec.Wai import Network.HTTP.Types (methodPost, hCont...
sagarsachdeva/database-service
test/Main.hs
bsd-3-clause
7,843
0
19
2,108
1,377
719
658
110
1
-- 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. ------------------...
facebookincubator/duckling
Duckling/Ranking/Classifiers/PL_XX.hs
bsd-3-clause
152,584
0
15
74,167
27,016
16,846
10,170
2,429
1
{-# language CPP #-} -- No documentation found for Chapter "Fence" module Vulkan.Core10.Fence ( createFence , withFence , destroyFence , resetFences , getFenceStatus , waitForFenc...
expipiplus1/vulkan
src/Vulkan/Core10/Fence.hs
bsd-3-clause
31,350
0
18
6,449
4,457
2,560
1,897
-1
-1
module Cpp where import FixPrime cpp (x, y) = [(a, b) | a <- x, b <- y] cpr (a, y) = [(a, b) | b <- y] cpl (x, b) = [(a, b) | a <- x] cpp' (x, y) = do a <- x b <- y return (a, b) cpr' (a, y) = do b <- y return (a, b) cpl' (x, b) = do a <- x return (a, b)
cutsea110/aop
src/Cpp.hs
bsd-3-clause
274
0
8
93
214
117
97
15
1
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} module Test.ZM.ADT.TypedBLOB.K614edd84c8bd (TypedBLOB(..)) where import qualified Prelude(Eq,Ord,Show) import qualified GHC.Generics import qualified Flat import qualified Data.Model import qualified Test.ZM.ADT.Type.K7028aa556ebc import qualified Test.ZM....
tittoassini/typed
test/Test/ZM/ADT/TypedBLOB/K614edd84c8bd.hs
bsd-3-clause
796
0
9
88
178
119
59
15
0
{- In the game of darts a player throws three darts at a target board which is split into twenty equal sized sections numbered one to twenty. The score of a dart is determined by the number of the region that the dart lands in. A dart landing outside the red/green outer ring darts zero. The black and cream regions in...
bgwines/project-euler
src/solved/problem109.hs
bsd-3-clause
2,741
12
13
603
366
214
152
41
1
module Language.Haskell.GhcMod.Lint where import Control.Applicative ((<$>)) import Control.Exception (handle, SomeException(..)) import Language.Haskell.GhcMod.Logger (checkErrorPrefix) import Language.Haskell.GhcMod.Types import Language.Haskell.HLint (hlint) -- | Checking syntax of a target file using hlint. -- ...
carlohamalainen/ghc-mod
Language/Haskell/GhcMod/Lint.hs
bsd-3-clause
705
0
10
135
183
104
79
13
1
module DobadoBots.Interpreter.Data ( ActionToken ( ..) , SensorToken ( ..) , Cond ( ..) , LogicExpr ( ..) , CmpInteger ( ..) , Collider ( ..) ) where import Data.HashMap.Strict (HashMap) data ActionToken = MoveForward | TurnLeft | TurnRight ...
NinjaTrappeur/DobadoBots
src/DobadoBots/Interpreter/Data.hs
bsd-3-clause
1,113
0
8
472
256
156
100
28
0
import Test.QuickCheck -- Our QC instances and properties: import Instances import Properties.Delete import Properties.Failure import Properties.Floating import Properties.Focus import Properties.GreedyView import Properties.Insert import Properties.Screen import Properties.Shift import Properties.Stack import Propert...
xmonad/xmonad
tests/Properties.hs
bsd-3-clause
8,250
0
15
1,603
1,755
1,007
748
156
3
module Main where ---------------------------------------------------------------------------------------- -- Specification: -- -- 1. Input format is displayed UTF-8 encoded text. -- -- 2. All punctuation...
dmjio/wordfreq
Main.hs
bsd-3-clause
3,868
0
18
1,174
1,067
560
507
58
2
{-# LANGUAGE TypeApplications #-} module Streaming.BinarySpec where import Control.Monad (replicateM_, void) import Data.Binary (put) import Data.Binary.Put (runPut) import Data.Function ((&)) import qualified Data.ByteString.Streaming as Q import Streaming.Binary import qualified Streaming.Prelude as S import Test.H...
mboes/streaming-binary
test/Streaming/BinarySpec.hs
bsd-3-clause
2,030
0
20
545
757
378
379
47
1
{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE ExplicitForAll #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGU...
taruti/diagrams-cairo-raster
example/Benchmarks.hs
bsd-3-clause
2,332
0
20
528
1,008
541
467
64
1
{-# LANGUAGE BangPatterns #-} module Tactics.Util ( allLockablePlaces , randomWalkTillLocked , randomWalkTillLockedWithPPs ) where import Control.Monad import Data.Map (Map) import qualified Data.Map as Map import Data.Set (Set) import qualified Data.Set as Set import qualified System.Random as Rand im...
msakai/icfpc2015
src/Tactics/Util.hs
bsd-3-clause
4,435
0
16
1,023
1,526
800
726
78
3
----------------------------------------------------------------------------- {- | This module defines the monad of sampling functions. See Park, Pfenning and Thrun: A probabilistic language based upon sampling functions, Principles of programming languages 2005 Sampling functions allow the composition of both discre...
glutamate/probably
Math/Probably/Sampler.hs
bsd-3-clause
12,708
0
20
3,927
3,673
1,871
1,802
200
3
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. {-# LANGUAGE GADT...
rfranek/duckling
Duckling/Time/ES/Rules.hs
bsd-3-clause
38,523
0
21
10,279
11,130
6,027
5,103
1,241
2
{-# LINE 1 "Control.Monad.ST.Lazy.Imp.hs" #-} {-# LANGUAGE Unsafe #-} {-# LANGUAGE MagicHash, UnboxedTuples, RankNTypes #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | -- Module : Control.Monad.ST.Lazy.Imp -- Copyright : (c) The University of...
phischu/fragnix
builtins/base/Control.Monad.ST.Lazy.Imp.hs
bsd-3-clause
4,607
0
15
1,161
858
482
376
63
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} module Language.Why3.PP (ppTh, ppD, ppE, ppT, ppL, ppP, isOpWhy3) where import Language.Why3.AST import Text.PrettyPrint import Data.Text (Text) import qualified Data.Text as Text ppTh :: Theory -> Doc ppTh (Theory x ds) = text "theory" <+> p...
GaloisInc/why3
src/Language/Why3/PP.hs
bsd-3-clause
7,013
0
21
3,112
2,888
1,390
1,498
158
27
{-# LANGUAGE OverloadedStrings #-} module Network.XMPP.TCPConnection ( TCPConnection , openStream , getStreamStart , openComponent , tagXMPPConn ) where import Network.XMPP.XMLParse import...
drpowell/XMPP
Network/XMPP/TCPConnection.hs
bsd-3-clause
5,945
0
17
1,937
1,602
790
812
124
4
-- | Simulates the @isUnicodeIdentifierStart@ Java method. <http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html#isUnicodeIdentifierStart%28int%29> module Language.Java.Character.IsUnicodeIdentifierStart ( IsUnicodeIdentifierStart(..) ) where import Data.Char import Data.Word import Data.Set.Diet(Diet) ...
tonymorris/java-character
src/Language/Java/Character/IsUnicodeIdentifierStart.hs
bsd-3-clause
9,723
0
10
4,189
2,818
1,754
1,064
371
1
module ControllerService ( controller , PacketIn ) where import Prelude hiding (catch) import Base import Data.Map (Map) import MacLearning (PacketOutChan) import qualified NIB import qualified NIB2 import qualified Nettle.OpenFlow as OF import Nettle.OpenFlow.Switch (showSwID) import qualified Nettle.Servers.Se...
brownsys/pane
src/ControllerService.hs
bsd-3-clause
14,376
0
23
4,132
3,558
1,817
1,741
-1
-1
{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE FlexibleInstances #-} module Language.Nano.Errors where import Debug.Trace import Text.Printf import Text.PrettyPrint.HughesPJ import Language.ECMAScript3.PrettyPrint bugBadPhi l t1s t2s = printf "BUG: Unbalanced Phi at %s \n %s \n %s" (ppshow l) (...
UCSD-PL/nano-js
Language/Nano/Errors.hs
bsd-3-clause
2,435
0
9
527
727
359
368
34
1
module Paths_language_c_quote_utils ( version, getBinDir, getLibDir, getDataDir, getLibexecDir, getDataFileName ) where import Data.Version (Version(..)) import System.Environment (getEnv) version :: Version version = Version {versionBranch = [0,0,0,1], versionTags = []} bindir, libdir, datadir, libexe...
jfischoff/language-c-quote-utils
dist/build/autogen/Paths_language_c_quote_utils.hs
bsd-3-clause
1,119
0
10
144
283
163
120
22
1
import Network import Control.Concurrent import System.IO main = withSocketsDo $ do sock <- listenOn $ PortNumber 5002 loop sock loop sock = do (h,_,_) <- accept sock forkIO $ body h loop sock where body h = do hPutStr h msg hFlush h hClose h msg = "HTTP/1.1 200 OK\r\nCon...
aycanirican/hlibev
Examples/BasicConcurrent.hs
bsd-3-clause
358
0
10
100
121
56
65
15
1
-- https://www.codewars.com/kata/number-of-trailing-zeros-of-n module Zeros where zeros :: Int -> Int zeros n = h n 0 where h n z = let r = div n 5 in if r == 0 then z else h r (z + r)
airtial/Codegames
codewars/number-of-trailing-zeros-of-n.hs
gpl-2.0
193
0
12
48
79
41
38
4
2
{-| hledger-ui - a hledger add-on providing a curses-style interface. Copyright (c) 2007-2015 Simon Michael <simon@joyful.com> Released under GPL version 3 or later. -} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} module Hledger.UI.Main where imp...
adept/hledger
hledger-ui/Hledger/UI/Main.hs
gpl-3.0
9,951
0
24
2,734
1,588
874
714
130
5
{- Copied & modified from the public-domain uglymemo package by - Lennart Augustsson -} module Data.MRUMemo ( memoIO, memoIOPure, memo ) where import Control.Concurrent.MVar import Data.IORef import System.IO.Unsafe (unsafePerformIO) memoIO :: Eq a => (a -> IO b) -> IO (a -> IO b) memoIO act = do ...
da-x/lamdu
bottlelib/Data/MRUMemo.hs
gpl-3.0
1,560
0
19
623
462
238
224
39
2
-- Copyright (C) 2017 Red Hat, Inc. -- -- This library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Lesser General Public -- License as published by the Free Software Foundation; either -- version 2.1 of the License, or (at your option) any later version. -- -- This library i...
atodorov/bdcs
src/BDCS/Label/License.hs
lgpl-2.1
1,522
0
11
339
281
161
120
-1
-1
-- just fire up ghci, :load Smt.hs and run `go file.smt2` module Smt where import qualified Data.Text.Lazy.IO as T import Language.Fixpoint.Config (SMTSolver (..)) import Language.Fixpoint.Parse import Language.Fixpoint.SmtLib2 import System.Environment main = do f:_ <- getArgs _ <- go f ...
rolph-recto/liquid-fixpoint
tests/smt2/Smt.hs
bsd-3-clause
558
0
10
148
170
88
82
18
1
{-# LANGUAGE BangPatterns, FlexibleInstances, OverloadedStrings, TypeSynonymInstances #-} module Main ( main ) where import Control.Applicative import Criterion.Main import Data.ByteString (ByteString) import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL import qualified Data....
solidsnack/cassava
benchmarks/Benchmarks.hs
bsd-3-clause
2,992
0
20
916
693
370
323
62
1
{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-| Unittests for the 'Ganeti.Common' module. -} {- Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by...
ribag/ganeti-experiments
test/hs/Test/Ganeti/Common.hs
gpl-2.0
7,189
0
17
2,431
1,137
627
510
113
5
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-sqs/gen/Network/AWS/SQS/GetQueueAttributes.hs
mpl-2.0
6,581
0
10
1,209
530
328
202
61
1
{-# LANGUAGE DeriveDataTypeable, PatternGuards, FlexibleInstances, MultiParamTypeClasses, CPP #-} -- deriving Typeable for ghc-6.6 compatibility, which is retained in the core ----------------------------------------------------------------------------- -- | -- Module : XMonad.Hooks.ManageDocks -- Copyright : ...
markus1189/xmonad-contrib-710
XMonad/Hooks/ManageDocks.hs
bsd-3-clause
10,132
0
16
2,394
2,277
1,267
1,010
106
5
<?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="pt-BR"> <title>Revisitar | Extensão ZAP</title> <maps> <homeID>top</homeID> <mapref loc...
kingthorin/zap-extensions
addOns/revisit/src/main/javahelp/org/zaproxy/zap/extension/revisit/resources/help_pt_BR/helpset_pt_BR.hs
apache-2.0
972
78
66
158
416
210
206
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Lazyfoo.Lesson07 (main) where import Control.Monad import Foreign.C.Types import Linear import SDL (($=)) import qualified SDL import Paths_sdl2 (getDataFileName) #if !MIN_VERSION_base(4,8,0) import Control.Applicative #endif screenWidth, screenHeight :...
tejon/sdl2
examples/lazyfoo/Lesson07.hs
bsd-3-clause
1,760
0
21
414
463
228
235
51
2
module Foo () where import Data.Set (Set(..)) {-@ include <selfList.hquals> @-} {-@ invariant {v0:[{v: a | (Set_mem v (listElts v0))}] | true } @-} {-@ type IList a = {v0: [{v:a | (Set_mem v (listElts v0))}] | true } @-} {-@ moo :: [a] -> IList a @-} moo [] = [] moo (_:xs) = xs goo [] = [] goo (_:xs) ...
abakst/liquidhaskell
tests/pos/selfList.hs
bsd-3-clause
410
0
7
113
115
68
47
9
1
----------------------------------------------------------------------------- -- | -- Module : XMonad.Prompt.Theme -- Copyright : (C) 2007 Andrea Rossato -- License : BSD3 -- -- Maintainer : andrea.rossato@unibz.it -- Stability : unstable -- Portability : unportable -- -- A prompt for changing the t...
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Prompt/Theme.hs
bsd-2-clause
1,628
0
9
284
258
152
106
21
1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Makefile Dependency Generation -- -- (c) The University of Glasgow 2005 -- ----------------------------------------------------------------------------- module DriverMkDepend ( doMkDependHS ) where #inc...
forked-upstream-packages-for-ghcjs/ghc
compiler/main/DriverMkDepend.hs
bsd-3-clause
14,693
0
21
4,624
2,716
1,422
1,294
215
6
{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-} module Shexkell.Data.ShapeMap where import qualified Data.Map as Map import Data.RDF import Data.List import Data.Maybe (fromJust) import Shexkell.Data.ShEx hiding (shapes) import Shexkel...
weso/shexkell
src/Shexkell/Data/ShapeMap.hs
mit
2,610
0
12
601
680
379
301
39
1
isPrime :: Integer -> Bool isPrime n | n == 1 = False | n > 1 = and [ mod n i /= 0 | i <- [2..n], i*i <= n] | otherwise = False factorize :: Integer -> [Integer] factorize n = factorize_worker n 2 factorize_worker :: Integer -> Integer -> [Integer] factorize_worker n factor | n == 1 = [] | mod n factor ...
mino2357/Hello_Haskell
src/test.hs
mit
860
0
10
182
427
216
211
23
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-volumes-host.html module Stratosphere.ResourceProperties.ECSTaskDefinitionHostVolumeProper...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/ECSTaskDefinitionHostVolumeProperties.hs
mit
1,676
0
12
158
174
101
73
22
1
{-# LANGUAGE OverloadedStrings #-} module VDOM.Adapter.Types where import Data.Int import Data.Word import Data.Text data Property = Property { propertyName :: String , propertyValue :: JSProp } deriving (Show) data VNodeAdapter = VNodeAdapter { vNodeAdapterTagName :: String , vNodeAdapterInnerText :: String...
smurphy8/shakespeare-dynamic
vdom-adapter/src/VDOM/Adapter/Types.hs
mit
1,146
0
9
338
253
149
104
33
1
module Main(main) where import Snap.Snaplet import Snap import Site main :: IO () main = do (_, site, _) <- runSnaplet Nothing haskitterInit quickHttpServe site -- Start the Snap server
lkania/Haskitter
src/Main.hs
mit
204
0
8
48
63
35
28
8
1
{-# htermination show :: (Show a) => (Maybe a) -> String #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_show_10.hs
mit
61
0
2
12
3
2
1
1
0
module Y2017.M08.D04.Exercise where -- below import available via 1HaskellADay git repository import Y2017.M08.D01.Exercise {-- Yesterday we looked at a rot13 cypher, but that was unsatifactory for a couple of reasons: 1. it rotted down low on the 13 only. What if you want to rot 12? Would you have to write a whole...
geophf/1HaskellADay
exercises/HAD/Y2017/M08/D04/Exercise.hs
mit
1,756
0
9
293
105
66
39
9
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternSynonyms #-} module Unison.TypePrinter where import Unison.Prelude import qualified Data.Map as Map import Unison.HashQualified (HashQualified) import Unison.Name ( Name ) import Unison.NamePrinter (...
unisonweb/platform
parser-typechecker/src/Unison/TypePrinter.hs
mit
7,559
0
24
1,922
2,500
1,275
1,225
-1
-1
{-# LANGUAGE ExistentialQuantification #-} module Jakway.Blackjack.Util where import Data.List (elemIndex) import System.IO import System.Exit hiding (die) import System.Console.GetOpt import Data.Maybe (catMaybes) innerMapTuple4 :: forall t t1. (t -> t1) -> (t, t, t, t) -> (t1, t1, t1, t1) innerMapTuple4 f (a,b,c,d)...
tjakway/blackjack-simulator
src/Jakway/Blackjack/Util.hs
mit
2,422
0
13
583
823
452
371
37
3
import Control.Monad import Data.Set (Set) import qualified Data.Set as Set data Pos = Pos { x :: Int, y :: Int } deriving (Eq, Ord) data Node = Node { pos :: Pos , size :: Int , used :: Int } deriving (Eq, Ord) type State = (Pos, Pos) data Grid = Grid { wall :: Pos ...
seishun/aoc2016
day22.hs
mit
2,020
0
14
601
1,024
530
494
56
2
module Main where import Network.Hubbub.Queue.Test import Network.Hubbub.SubscriptionDb.Test import Network.Hubbub.Http.Test import Network.Hubbub.Hmac.Test import Network.Hubbub.Internal.Test import Network.Hubbub.Test import Prelude (IO) import Test.Tasty (defaultMain,testGroup,TestTree) main :: IO () main = defa...
benkolera/haskell-hubbub
test/Test.hs
mit
489
0
6
70
120
76
44
19
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpccidrblock.html module Stratosphere.Resources.EC2VPCCidrBlock where import Stratosphere.ResourceImports ...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/EC2VPCCidrBlock.hs
mit
2,426
0
15
301
370
211
159
35
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appstream-fleet-domainjoininfo.html module Stratosphere.ResourceProperties.AppStreamFleetDomainJoinInfo where...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/AppStreamFleetDomainJoinInfo.hs
mit
2,315
0
12
205
264
151
113
27
1
import Control.Applicative ((<*>),(<$>)) class CompState s where ret :: a -> s a (=:) :: s a -> (a -> s b) -> s b (!) :: s a -> s b -> s b x ! y = x =: (\_ -> y) newtype State s a = State { runState :: s -> (a,s) } get :: State s s get = State $ \s -> (s, s) put :: s -> State s () put s ...
WraithM/SemiColonTutorial
SemiColon.hs
gpl-3.0
2,428
0
13
748
1,029
547
482
87
2
-- o MCD por euclides {- empezamos con dous numeros x = 20 y = 16 - se x/y da como resto 0 y é o MCD - se non x = y y = resto asi ate que o resto sexa 0 en tal caso teremos que y é o mcd - -} mcd x y = if resto == 0 then y else mcd y resto where resto = x `mod` y mcdPm _ 1 = 1 mcdP...
jmlb23/haskell
ch06/euclides.hs
gpl-3.0
1,739
0
9
513
326
174
152
28
3
{-# LANGUAGE RankNTypes, GADTs #-} module Data.Exists where import Unsafe.Coerce (unsafeCoerce) data Exists f where Exists :: f a -> Exists f mkExists :: forall f a. f a -> Exists f mkExists = unsafeCoerce runExists :: forall f r. (forall a. f a -> r) -> (Exists f -> r) runExists = unsafeCoerce
graninas/Haskell-Algorithms
Tests/TransitionGraph/transition-graph/src/Data/Exists.hs
gpl-3.0
302
0
10
60
108
61
47
9
1
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE GADT...
tlaitinen/sms
backend/Handler/DB/RouteTargetedtextmessage.hs
gpl-3.0
7,783
0
19
2,507
1,521
856
665
146
11
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-shopping-content/gen/Network/Google/Resource/Content/Products/Update.hs
mpl-2.0
6,144
0
20
1,465
965
561
404
134
1
{- - This file is part of Bilder. - - Bilder is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Bilder i...
ingemaradahl/bilder
src/Compiler/Split.hs
lgpl-3.0
15,643
0
19
3,517
5,874
3,055
2,819
357
3
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} module Control.Monad.Shmonad.CommandSpec (main, spec) where import Test.Hspec import GHC.TypeLits import Control.Monad.Shmonad.Expression import Control.Monad.Shmonad.Command main :: IO () main = hspec spec spec :: Spec spec = do describe "A C...
corajr/shmonad
test/Control/Monad/Shmonad/CommandSpec.hs
bsd-2-clause
1,744
0
20
415
572
283
289
40
1
{- | Module : Cantor.Project Copyright : Copyright (C) 2014 Krzysztof Langner License : BSD3 Maintainer : Krzysztof Langner <klangner@gmail.com> Stability : alpha Portability : portable Data Types and functions for procesing project -} module Cantor.Project ( Project , projectBuildSystem ...
klangner/cantor
src/Cantor/Project.hs
bsd-2-clause
2,960
0
12
746
816
445
371
49
3
module Rede.MainLoop.Framer( readNextChunk ,readLength ,Framer ,LengthCallback ) where import Control.Monad.Trans.Class (lift) import Control.Monad.IO.Class (MonadIO -- , liftIO ) import qualifi...
loadimpact/http2-test
hs-src/Rede/MainLoop/Framer.hs
bsd-3-clause
2,730
2
16
1,019
509
267
242
47
3
{-# language PackageImports #-} -- | This module re-exports <https://hackage.haskell.org/package/indentation-parsec/docs/Text-Parsec-Indentation.html Text.Parsec.Indentation> from <https://hackage.haskell.org/package/indentation-parsec indentation-parsec>. module Text.Parsec.Indentation (module Impl) where import "ind...
lambdageek/indentation
indentation/src/Text/Parsec/Indentation.hs
bsd-3-clause
369
0
4
25
24
18
6
3
0
{-# LANGUAGE EmptyDataDecls , OverloadedStrings , GeneralizedNewtypeDeriving , FlexibleInstances #-} module Clay.Size ( -- * Size type. Size , Abs , Rel -- * Size constructors. , px , pt , em , ex , pct -- * Shorthands for mutli size-valued properties. , sym , sym2 , sym3 -- * Angle type. , Angle ,...
bergmark/clay
src/Clay/Size.hs
bsd-3-clause
3,373
0
12
757
1,044
550
494
-1
-1
{-# LANGUAGE ScopedTypeVariables #-} -- | This module provides convenience functions for interfacing @tls@. -- -- This module is intended to be imported @qualified@, e.g.: -- -- @ -- import "Data.Connection" -- import qualified "System.IO.Streams.TLS" as TLS -- @ -- module System.IO.Streams.TLS ( TLSConnec...
didi-FP/tcp-streams
System/IO/Streams/TLS.hs
bsd-3-clause
3,903
0
15
1,026
749
424
325
59
2
-- For Scotty {-# LANGUAGE OverloadedStrings #-} import Web.Scotty import Network.Wai.Handler.Warp (defaultSettings, settingsPort, settingsHost, HostPreference (HostIPv4)) -- For Me import Control.Monad.Trans (liftIO) import Data.Text.Lazy (pack, unpack) -- Project-Internal -- TODO: Hookup internal modules listenPort ...
clockfort/mobile-webnews
webnews.hs
bsd-3-clause
1,142
3
12
187
210
117
93
16
1
{-# LANGUAGE TemplateHaskell, ScopedTypeVariables #-} -- | -- This package provides a function to generate a choice operator -- in lifted IO monad by specifying exceptions to be caught. module Control.Exception.IOChoice.Lifted.TH (newIOChoice) where import Control.Exception.Lifted import Language.Haskell.TH import ...
kazu-yamamoto/io-choice
Control/Exception/IOChoice/Lifted/TH.hs
bsd-3-clause
905
0
6
133
77
57
20
7
1
{-# OPTIONS_GHC -F -pgmF tasty-discover -optF --modules="*Test.hs" -optF --debug #-}
tittoassini/typed
test/Driver.hs
bsd-3-clause
86
0
2
11
3
2
1
1
0
import Control.Concurrent (threadDelay) import Control.Distributed.Process import Control.Distributed.Process.Node import Control.Monad (forever) import Network.Transport.TCP (createTransport, ...
igniting/cloud-haskell-example
src/SingleNode.hs
bsd-3-clause
1,716
0
17
477
335
168
167
28
2
{-# LANGUAGE OverloadedStrings #-} module Configuration where import Data.Aeson import Control.Applicative ((<$>),(<*>)) import Control.Monad (mzero) import System.Directory (doesFileExist) import qualified Data.ByteString.Lazy as B (readFile) import System.Exit (exitFailure) -- | Contains the configuratio values da...
froozen/simple-wiki
src/Configuration.hs
bsd-3-clause
1,510
0
15
386
321
174
147
36
3
module NaiveLensExamples where -- http://blog.jakubarnold.cz/2014/07/14/lens-tutorial-introduction-part-1.html data User = User { name :: String, age :: Int } deriving Show data Project = Project { owner :: User, value :: Int } deriving Show bob = User { name = "Bob", age = 30 } project1 = Project { owner = bob, val...
peterbecich/haskell-programming-first-principles
src/NaiveLensExamples.hs
bsd-3-clause
1,163
0
11
219
361
208
153
21
1
{-# LANGUAGE OverloadedStrings #-} module Network.HPACK.Table.Entry ( -- * Type Size , Entry(..) , Header -- re-exporting , HeaderName -- re-exporting , HeaderValue -- re-exporting , Index -- re-exporting -- * Header and Entry , toEntry , toEntryToken -- * Getters , entrySize , ...
kazu-yamamoto/http2
Network/HPACK/Table/Entry.hs
bsd-3-clause
2,406
0
9
477
500
286
214
53
1