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 TemplateHaskell, MultiParamTypeClasses #-} -- | This module is for throwing dice for e.g. RPGs. (\@dice 3d6+2) -- Copyright Einar Karttunen <ekarttun@cs.helsinki.fi> 2005-04-06. module Plugin.Dice (theModule) where import Plugin import Control.Monad (replicateM,foldM) import System.Ra...
zeekay/lambdabot
Plugin/Dice.hs
mit
2,377
0
19
942
800
407
393
47
3
module Plucker (tests) where import Linear import Linear.Plucker import Linear.Plucker.Coincides import Test.HUnit ln2,ln3,ln4,ln5,ln6,ln7,ln8,ln9 :: Plucker Float ln2 = plucker3D (V3 1 3 0) (V3 1 3 (-2)) -- starting line ln3 = plucker3D (V3 2 3 0) (V3 2 3 (-2)) -- parallel ln4 = plucker3D (V3 2 4 0) (V3 1 4 (-2...
isomorphism/linear
tests/Plucker.hs
bsd-3-clause
1,751
0
14
578
695
363
332
33
1
module Main where type A = Int data D = D A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A test :: D -> D test (D a b c d e f g h i j k l m n o p q r s t u v w x y z aa bb cc dd ee ff gg hh ii jj kk ll mm nn) = D a b c d e f g h i j k l m n o p q r s t u v w x y z aa bb cc dd ee ff...
sdiehl/ghc
testsuite/tests/typecheck/should_fail/T16874.hs
bsd-3-clause
376
0
7
155
301
153
148
8
1
module IrrefutableIn1 where -- test for irrefutable patterns f :: [Int] -> Int f (~x@[]) = hd x f (~x@(b_1 : b_2)) = hd x f (~x) = hd x hd x = head x tl x = tail x
kmate/HaRe
old/testing/introPattern/IrrefutableIn1_TokOut.hs
bsd-3-clause
166
0
10
42
99
51
48
7
1
{-# OPTIONS -funbox-strict-fields #-} {-# LANGUAGE OverloadedStrings #-} module TFB.Db ( Pool , mkPool , Config(..) , queryWorldById , queryWorldByIds , updateWorlds , queryFortunes , Error ) where import qualified TFB.Types as Types import qualified Data.Either as Either import Contro...
zloster/FrameworkBenchmarks
frameworks/Haskell/warp/shared/tfb-mysql-haskell/TFB/Db.hs
bsd-3-clause
5,561
0
17
1,109
1,762
908
854
123
3
import Control.Monad (guard) import Data.List (intersperse, intercalate) main = do guard $ null [] -- is empty guard $ length [3,5,8,2,1] == 5 guard $ head [3,5,8,2,1] == 3 -- first element guard $ tail [3,5,8,2,1] == [5,8,2,1] -- all but first guard $ 3 : [5,8,2,1]...
rtoal/ple
haskell/lists.hs
mit
1,628
0
13
438
1,146
658
488
31
1
module Data.Weather ( TempUnits(..) , Weather(..) ) where import Data.Text (Text) data TempUnits = Celsiuses | Farenheits data Weather = Weather { getCity :: Text , getTemp :: Text , getUnits :: TempUnits , getText :: Text }
astynax/weather
src/Data/Weather.hs
mit
246
0
8
59
75
48
27
11
0
{-# LANGUAGE GADTs #-} {-# LANGUAGE QuasiQuotes #-} module Kafkaesque.Request.Fetch ( fetchRequestV0 , respondToRequestV0 ) where import Control.Monad (forM) import Data.ByteString (ByteString) import Data.Int (Int32, Int64) import Data.Maybe (fromMaybe) import qualified Data.Pool as Pool import qualified Datab...
cjlarose/kafkaesque
src/Kafkaesque/Request/Fetch.hs
mit
4,006
15
24
915
909
510
399
86
2
{-# LANGUAGE OverloadedStrings #-} module CreepyWaffle.EventHandle where -- import CreepyWaffle.Types -- import Data.Maybe (catMaybes) import Control.Monad (mapM) -- import qualified SDL import SDL.Cairo (createCairoTexture) import SDL.Cairo.Canvas -- import qualified FRP.Elerea.Simple as Ele -- quitPredicate :: IO Boo...
jaiyalas/creepy-waffle
src/CreepyWaffle/EventHandle.hs
mit
1,408
0
10
254
448
234
214
37
3
import Control.Monad (guard) allCases = [1..10] resolve :: [(Int,Int,Int)] resolve = do x <- allCases y <- allCases z <- allCases guard $ 4*x + y*y < z return (x,y,z) main = do print resolve
duncanfinney/haskell-play
09-monads-two.hs
mit
206
0
11
50
113
59
54
11
1
{-# htermination (minimumMyInt :: (List MyInt) -> MyInt) #-} import qualified Prelude data MyBool = MyTrue | MyFalse data List a = Cons a (List a) | Nil data MyInt = Pos Nat | Neg Nat ; data Nat = Succ Nat | Zero ; data Ordering = LT | EQ | GT ; foldl :: (b -> a -> b) -> b -> (List a) -> b; foldl...
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/minimum_5.hs
mit
1,963
0
9
454
883
474
409
54
1
module TruthTable.Tests.LogicTests (tests) where import Test.HUnit import Test.Framework import Test.Framework.Providers.HUnit import TruthTable.Types import TruthTable.Logic import TruthTable.Mapping import TruthTable.Parser (parse) import qualified Data.Map.Strict as Map parseEval :: String -> Map.Map Variable Bo...
tjakway/truth-table-generator
test/TruthTable/Tests/LogicTests.hs
mit
2,888
0
11
836
729
405
324
48
1
import Control.Concurrent (threadDelay) import Control.Monad (unless) import System.Console.AsciiProgress main :: IO () main = displayConsoleRegions $ do pg <- newProgressBar def { pgWidth = 100 , pgOnCompletion = Just "Done :perce...
yamadapc/haskell-ascii-progress
bin/Example.hs
mit
541
0
13
239
132
64
68
14
1
module Irg.Lab3.Callbacks where import Control.Monad import Control.Arrow import Data.IORef import qualified Control.Concurrent.Thread.Delay as CC import qualified Graphics.GL.Compatibility33 as GL import qualified Graphics.UI.GLUT as GLUT import qualified Data.Vector as V import Linear import Irg.Lab3.Utility import ...
DominikDitoIvosevic/Uni
IRG/src/Irg/Lab3/Callbacks.hs
mit
3,663
0
12
747
1,522
750
772
102
6
{-# OPTIONS_GHC -Wall #-} module HW02 where import Data.List -- Mastermind ----------------------------------------- -- A peg can be one of six colors data Peg = Red | Green | Blue | Yellow | Orange | Purple deriving (Show, Eq, Ord) -- A code is defined to simply be a list of Pegs type Code = [Peg] -- A mo...
NickAger/LearningHaskell
CIS194/hw02.hs
mit
3,139
0
11
662
716
391
325
43
3
{- | Module : $Header$ Description : some utilities for the abstract syntax Copyright : (c) Christian Maeder and Uni Bremen 2003-2005 License : GPLv2 or higher, see LICENSE.txt Maintainer : Christian.Maeder@dfki.de Stability : experimental Portability : portable utility functions and computations...
nevrenato/Hets_Fork
HasCASL/AsUtils.hs
gpl-2.0
14,606
0
21
3,677
4,682
2,418
2,264
277
9
module TS.Page.Theme where import TS.Utils import TS.App import Yesod pageTheme :: WidgetT TS IO () pageTheme = do setTitle "Thoughtspread" toWidgetHead [hamlet|<link rel="icon" type="image/x-icon" href="@{ResourceR icon_png}"/>|] toWidgetHead [lucius| bo...
Sheerfreeze/thoughtspread
TS/Page/Theme.hs
gpl-2.0
2,350
0
7
1,251
110
61
49
-1
-1
{-# LANGUAGE OverloadedStrings, RecordWildCards, Arrows #-} module Bot.URL where import Control.Auto import Control.Monad.IO.Class (MonadIO, liftIO) import Prelude hiding ((.), id) -- we use (.) and id from `Control.Category` import Control.Auto.Effects (arrMB) import Control.Monad import Bot.Types import ...
urbanslug/nairobi-bot
src/Bot/URL.hs
gpl-3.0
2,621
1
15
623
768
409
359
62
3
module NGram (Host, createHost, findCloseHosts, names) where import Data.List (sortBy) import qualified Data.Set as S data Host = Host {names :: [String], triGrams :: S.Set String, biGrams :: S.Set String} deriving (Eq) instance Show Host where show host = showHosts $ names host showHosts :: [String] -> String ...
Eternity-Yarr/connector
src/NGram.hs
gpl-3.0
2,053
0
10
503
721
387
334
46
2
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} import Language.Dockerfile main = putStr $ toDockerfileStr $ do from "node" run "apt-get update" [edockerfile| RUN apt-get update CMD node something.js |] -- ...
beijaflor-io/haskell-language-dockerfile
examples/edsl-quasi.hs
gpl-3.0
260
0
8
66
41
22
19
7
1
{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Network.AWS.StorageGateway -- Copyright : (c) 2013-2015 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintaine...
olorin/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway.hs
mpl-2.0
15,288
0
5
2,860
1,260
934
326
219
0
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
dysinger/amazonka
amazonka-glacier/gen/Network/AWS/Glacier/UploadArchive.hs
mpl-2.0
8,078
0
13
1,723
892
545
347
95
1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving...
duairc/opaleye-x
src/Opaleye/X/Array.hs
mpl-2.0
6,705
0
12
1,013
1,571
847
724
94
1
{-# LANGUAGE CPP #-} module Web.Types ( WebFileInfo(..) , WebFileMap , Web(..) , WebGeneratorM , WebGenerator ) where #ifdef DEVEL import Control.Concurrent.MVar (MVar) #endif import Control.Monad.Trans.Except (ExceptT) import Control.Monad.Trans.State.Strict (StateT) import Crypto.Hash (Digest, MD5) impor...
databrary/databrary
src/Web/Types.hs
agpl-3.0
927
0
11
162
231
144
87
29
0
-- Copyright (C) 2016-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 libr...
dashea/bdcs
importer/BDCS/GroupKeyValue.hs
lgpl-2.1
1,277
0
12
241
188
107
81
11
1
module Walk.A329278 (a329278) where a329278_row :: Int -> [Integer] a329278_row n = map p [0..2^n-1] where p k = div (k^2 + k) 2 `mod` 2^n a329278_list :: [Integer] a329278_list = concatMap a329278_row [0..] a329278 :: Int -> Integer a329278 = (!!) a329278_list
peterokagey/haskellOEIS
src/Walk/A329278.hs
apache-2.0
267
0
12
48
125
69
56
8
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="hi-IN"> <title>HTTPS Info Add-on</title> <maps> <homeID>httpsinfo</homeID> <mapref loca...
secdec/zap-extensions
addOns/httpsInfo/src/main/javahelp/org/zaproxy/zap/extension/httpsinfo/resources/help_hi_IN/helpset_hi_IN.hs
apache-2.0
968
77
67
157
413
209
204
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Application.WebLogger.Client.Job where import Debug.Trace import qualified Data.ByteString.Lazy.Char8 as C import qualified Data.ByteString.Char8 as SC import Data.Aeson.Types import Data.Aeson.Encode as E import Data.Aeson.Parser import qualified Data.Attoparsec as A impor...
wavewave/weblogger-client
lib/Application/WebLogger/Client/Job.hs
bsd-2-clause
2,976
24
20
667
901
479
422
72
2
-- http://www.codewars.com/kata/551204b7509063d9ba000b45 module Codewars.Kata.Product where mainDiagonalProduct :: Num a => [[a]] -> a mainDiagonalProduct = product . zipWith (flip (!!)) [0..]
Bodigrim/katas
src/haskell/B-Product-of-the-main-diagonal-of-a-square-matrix.hs
bsd-2-clause
194
0
8
22
55
32
23
3
1
{-# LANGUAGE PackageImports #-} import "yesodoro-reboot" 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 (thr...
samstokes/yesodoro-reboot
devel.hs
bsd-2-clause
709
0
10
123
186
101
85
23
2
-- Haskell Torrent -- Copyright (c) 2009, Jesper Louis Andersen, -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are -- met: -- -- * Redistributions of source code must retain the above copyright -- ...
astro/haskell-torrent
src/StatusP.hs
bsd-2-clause
3,977
14
21
926
676
389
287
57
4
module EmitLLVM( withContextAST) where import RPN import Control.Monad import Control.Monad.Trans.Error import LLVM.General.Module import LLVM.General.Context --import LLVM.General.AST as AST withContextAST mod = withContext (testErrE mod) testErrE mod con = Control.Monad.Trans.Error.runErrorT $ withContextAndMo...
dillonhuff/FCalc
src/EmitLLVM.hs
bsd-3-clause
410
0
7
55
95
54
41
10
1
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} module Test.ZM.ADT.Content.K957357183935 (Content(..)) where import qualified Prelude(Eq,Ord,Show) import qualified GHC.Generics import qualified Flat import qualified Data.Model import qualified Test.ZM.ADT.List.Kb8cd13187198 import qualified Test.ZM.ADT....
tittoassini/typed
test/Test/ZM/ADT/Content/K957357183935.hs
bsd-3-clause
928
0
9
232
223
143
80
21
0
import Test.Hspec import Test.QuickCheck import System.IO import Ch6 main = hspec $ do describe "Knapsack exmaple" $ do it "returns 26" $ do knapsackExample `shouldBe` 26.0 describe "fib" $ do it "returns 0th Fibonacci number 0" $ do fib 0 `shouldBe` 0 ...
wangwangwar/cis194
test/Ch6Spec.hs
bsd-3-clause
3,525
0
30
1,046
1,265
649
616
56
1
{-# OPTIONS -fno-warn-tabs #-} -- The above warning supression flag is a temporary kludge. -- While working on this module you are encouraged to remove it and -- detab the module (please do the detabbing in a separate patch). See -- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces -- fo...
ekmett/ghc
compiler/nativeGen/SPARC/CodeGen/Amode.hs
bsd-3-clause
1,861
17
17
443
628
316
312
55
1
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-} module Main where ------------------------------------------------------------------------------ import Control.Applicative import Control.Lens import ...
ixmatus/snaplet-mandrill
example/Main.hs
bsd-3-clause
2,165
0
20
516
461
237
224
45
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. {-# LANGUAGE OverloadedStrings #-} module Duckling.PhoneNumber.PT.Corpus ( corpus ) where import Prelude im...
facebookincubator/duckling
Duckling/PhoneNumber/PT/Corpus.hs
bsd-3-clause
710
0
9
129
114
71
43
15
1
{- | Module : Language.Javascript.JMacro Copyright : (c) Gershom Bazerman, 2010 License : BSD 3 Clause Maintainer : gershomb@gmail.com Stability : experimental Simple DSL for lightweight (untyped) programmatic generation of Javascript. A number of examples are available in the source of "Language.J...
tingtun/jmacro
Language/Javascript/JMacro.hs
bsd-3-clause
3,542
0
6
577
86
62
24
9
0
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE LambdaCase #-} module Main where import Data.Maybe import Control.Applicative import Control.Monad import Control.Monad.ST import Control.Monad.Writer hiding (Any) import Control.Arrow ((***)) import Lens.Family2 import Lens.Family2.St...
divipp/lensref
src/runtests.hs
bsd-3-clause
25,717
0
26
11,897
7,775
3,605
4,170
645
12
-- | Contains the blaze-html templates for the site -- {-# LANGUAGE OverloadedStrings #-} module Tweetov.Views ( root , tweet , user , userAjax ) where import Prelude import Data.Monoid (mempty, mappend) import Text.Blaze.Html5 import qualified Text.Blaze.Html5 as H import Text.Blaze.Html5.Attribu...
jaspervdj/tweetov
src/Tweetov/Views.hs
bsd-3-clause
2,814
0
17
820
736
366
370
62
1
-- This module requires LukaBlock.h support module Language.ObjectiveC.Luka.Extra where import Prelude () import Air.Env import Air.Extra import Control.Monad ((>=>)) import Language.ObjectiveC.Luka.API import Language.ObjectiveC.Luka.Prelude import Language.ObjectiveC.Luka.RunTime import Foreign.C.Types import F...
nfjinjing/luka
src/Language/ObjectiveC/Luka/Extra.hs
bsd-3-clause
1,122
0
12
179
346
180
166
31
1
{-# LANGUAGE RankNTypes, TypeFamilies, BangPatterns, Trustworthy #-} {-| The module @Pipes.Text@ closely follows @Pipes.ByteString@ from the @pipes-bytestring@ package. A draft tutorial can be found in @Pipes.Text.Tutorial@. -} module Pipes.Text ( -- * Producers fromLazy -- * Pipes , map ...
bitemyapp/text-pipes
Pipes/Text.hs
bsd-3-clause
22,744
0
24
7,283
6,725
3,432
3,293
493
4
instance MonadPlus [] where mzero = [] mplus = (++)
davdar/quals
writeup-old/sections/04MonadicAAM/00MonadicStyle/00Nondeterminism/02NondetMonadPlus.hs
bsd-3-clause
56
0
6
14
25
14
11
3
0
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE RecordWildCards #-} module CANOpen.Tower.Attr where import Ivory.Language import Ivory.Tower data AttrWriter a = AttrWriter { aw_chan :: ChanInput a , aw_name :: String } data AttrReader a = AttrReader { ar_chan :: ChanOut...
distrap/ivory-tower-canopen
ivory-tower-canopen-core/src/CANOpen/Tower/Attr.hs
bsd-3-clause
4,810
0
18
1,393
1,726
840
886
137
1
{-# LANGUAGE OverloadedStrings #-} import TPG.WebAPI import Cfg import System.IO import System.Directory import System.Environment import Data.ByteString.Internal import qualified Data.ByteString.Lazy as BS import Control.Applicative import Control.Monad import TPG.Structured dispatch :: [(String, (String,[String]) ->...
sebug/tpg_sandbox
test_tpg.hs
bsd-3-clause
3,271
0
22
787
1,157
604
553
68
4
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} module Templates.Components.React where import Data.Text (Text) import Templates.Components import Text.InterpolatedString.Perl6 (qc) import Types import Types.PropTypes reactCo...
tpoulsen/generate-component
src/Templates/Components/React.hs
bsd-3-clause
2,783
0
8
581
251
140
111
24
4
data NestedList a = Elem a | List [NestedList a] myFlatten :: NestedList t -> [t] myFlatten (Elem x) = [x] myFlatten (List x) = concatMap myFlatten x -- *Main> myFlatten (List []) -- [] -- *Main> myFlatten (Elem 5) -- [5] -- *Main>
m00nlight/99-problems
haskell/p-07.hs
bsd-3-clause
236
0
8
48
78
43
35
4
1
----------------------------------------------------------------------------- -- | -- Module : Plugins.StdinReader -- Copyright : (c) Andrea Rossato -- License : BSD-style (see LICENSE) -- -- Maintainer : Andrea Rossato <andrea.rossato@unibz.it> -- Stability : unstable -- Portability : unportable --...
neglectedvalue/xmobar-freebsd
Plugins/StdinReader.hs
bsd-3-clause
975
0
14
185
176
100
76
16
0
{-# LANGUAGE CPP #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE...
bermanjosh/bloodhound
tests/V5/tests.hs
bsd-3-clause
83,623
0
31
21,674
21,920
10,854
11,066
1,538
16
{-# LANGUAGE OverloadedStrings #-} module Main (main) where import Control.Error.Util (hush) import Data.Aeson (decode) import Data.Char (toLower) import Data.List as L import Data.List.Split as L import Data.Maybe (mapMaybe) import qualified Data.Text.Lazy as T import qualified Data.Text.Lazy.Encoding as T import qua...
bus000/Dikunt
plugins/Help/Main.hs
bsd-3-clause
2,323
0
13
432
703
373
330
54
2
{-| Module : Idris.Elab.Utils Description : Elaborator utilities. Copyright : License : BSD3 Maintainer : The Idris Community. -} {-# LANGUAGE PatternGuards #-} module Idris.Elab.Utils where import Idris.AbsSyntax import Idris.Core.Elaborate hiding (Tactic(..)) import Idris.Core.Evaluate import Idris.Core....
jmitchell/Idris-dev
src/Idris/Elab/Utils.hs
bsd-3-clause
25,459
25
26
9,146
9,482
4,735
4,747
465
17
{-# LANGUAGE QuasiQuotes #-} import LiquidHaskell import Language.Haskell.Liquid.Prelude (choose) prop = if x > 0 then bar x else x where x = choose 0 [lq| bar :: Nat -> Nat |] bar :: Int -> Int bar x = x [lq| bar :: a -> {v:Int | v = 9} |] bar :: a -> Int bar _ = 9
spinda/liquidhaskell
tests/gsoc15/unknown/pos/LocalSpec.hs
bsd-3-clause
297
2
7
91
110
57
53
-1
-1
{-# LANGUAGE RecordWildCards, PatternGuards #-} module Text.HTML.TagSoup.Specification(parse) where import Text.HTML.TagSoup.Implementation import Data.Char white x = x `elem` "\t\n\f " -- We make some generalisations: -- <!name is a valid tag start closed by > -- <?name is a valid tag start closed by ?> -- </!nam...
nfjinjing/yuuko
src/Text/HTML/TagSoup/Specification.hs
bsd-3-clause
9,826
0
14
2,554
3,833
1,811
2,022
194
10
{-# LANGUAGE TemplateHaskell, TypeOperators #-} ----------------------------------------------------------------------------- -- | -- Module : Minecraft.Format.Schematic.Data -- Copyright : (c) Tamar Christina 2012 -- License : BSD3 -- -- Maintainer : tamar@zhox.com -- Stability : experimental -- Po...
Mistuke/CraftGen
Minecraft/Format/Entity.hs
bsd-3-clause
11,851
0
9
4,512
1,182
778
404
132
0
module Network.DNS.SHAHelper where import Crypto.HMAC import Crypto.Hash.CryptoAPI import Data.Hex(hex) import qualified Data.Serialize as C import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Lazy.Char8 as BL8 -- import Codec.Utils (listToOctets) -- import Codec.Utils (listFromOctets) import...
mwotton/dnsmadeeasy
src/Network/DNS/SHAHelper.hs
bsd-3-clause
656
0
11
90
162
100
62
12
1
{-# LANGUAGE OverloadedStrings #-} import Network.Wai.Application.Static import Network.Wai.Handler.Warp (run) main :: IO () main = run 3000 $ staticApp defaultWebAppSettings { ssLookupFile = fileSystemLookup "." , ssMaxAge = MaxAgeForever , ssIndices = [] , ssListing = Just defaultListing }
sol/wai
wai-app-static/sample.hs
mit
314
0
7
60
88
48
40
9
1
module TupleFunctions where addEmUp2 :: Num a => (a, a) -> a addEmUp2 (x, y) = x + y addEmUp2Alt :: Num a => (a, a) -> a addEmUp2Alt tup = (fst tup) + (snd tup) fst3 :: (a, b, c) -> a fst3 (x, _, _) = x third3 :: (a, b, c) -> c third3 (_, _, x) = x
brodyberg/Notes
ProjectRosalind.hsproj/LearnHaskell/lib/HaskellBook/MatchingTuples1.hs
mit
252
0
7
65
160
91
69
9
1
{-# LANGUAGE NoMonomorphismRestriction #-} module Graph.Op ( module Expression.Op , eval, eval0, Graph , example ) where import Expression.Op import qualified Autolib.TES.Binu as U import Autolib.Graph.Graph ( Graph ) import qualified Autolib.Graph.Basic as B import qualified Autolib.Graph.Ops as O import qualif...
florianpilz/autotool
src/Graph/Op.hs
gpl-2.0
2,156
14
14
669
817
476
341
58
2
module DerivingDrift.StandardRules (standardRules,driftResolvedNames) where import DerivingDrift.RuleUtils import Name.Prim import Name.Name import qualified Data.Map as Map standardRules :: Map.Map Name.Name.Name (Data -> Doc) standardRules = Map.fromList [ (class_Eq,eqfn), (class_Ord,ordfn), (class_Enum...
dec9ue/jhc_copygc
src/DerivingDrift/StandardRules.hs
gpl-2.0
9,200
274
27
2,107
4,006
2,129
1,877
188
3
{-# LANGUAGE OverloadedStrings #-} -- | -- Copyright : (c) 2010-2012 Benedikt Schmidt -- License : GPL v3 (see LICENSE) -- -- Maintainer : Benedikt Schmidt <beschmi@gmail.com> -- -- Builtin function symbols and signatures. module Term.Builtin.Signature where import Term.LTerm import qualified Data.Set as S --...
ekr/tamarin-prover
lib/term/src/Term/Builtin/Signature.hs
gpl-3.0
1,736
0
6
229
318
212
106
25
1
-- | Erlang style supervisors for Haskell. -- Note that yet, these are not really good enough for using in other projects. -- are currently subject to change until I figure out how a nice interface will -- look like. At that moment they could be split off into their own package. {-# LANGUAGE ScopedTypeVariables #...
beni55/combinatorrent
src/Supervisor.hs
bsd-2-clause
5,134
0
13
1,347
1,336
680
656
111
4
----------------------------------------------------------------------------- -- | -- Module : Graphics.HGL.X11.Timer -- Copyright : (c) Alastair Reid, 1999-2003 -- License : BSD-style (see the file libraries/base/LICENSE) -- -- Maintainer : libraries@haskell.org -- Stability : internal -- Portabili...
FranklinChen/hugs98-plus-Sep2006
packages/HGL/Graphics/HGL/X11/Timer.hs
bsd-3-clause
3,599
6
12
709
1,075
587
488
68
2
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Pretty-printing assembly language -- -- (c) The University of Glasgow 1993-2005 -- ----------------------------------------------------------------------------- {-# OPTIONS_GHC -fno-warn-orphans #-} module X86.Ppr...
AlexanderPankiv/ghc
compiler/nativeGen/X86/Ppr.hs
bsd-3-clause
45,480
0
28
13,669
13,261
6,603
6,658
870
97
{- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[RnPat]{Renaming of patterns} Basically dependency analysis. Handles @Match@, @GRHSs@, @HsExpr@, and @Qualifier@ datatypes. In general, all of these functions return a renamed thing, and a set of free variables. -} {-# LANGUAGE CPP, RankNTypes, S...
mettekou/ghc
compiler/rename/RnPat.hs
bsd-3-clause
35,290
44
24
11,407
6,735
3,518
3,217
-1
-1
module Duffer.Unified (module Duffer.Unified) where import Data.Attoparsec.ByteString (parseOnly) import Data.ByteString (init, readFile) import Data.Bool (bool) import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT) import Control.Applicative ((<|>)) import System.FilePath ...
vaibhavsagar/duffer.hs
duffer/src/Duffer/Unified.hs
bsd-3-clause
1,600
0
16
341
477
258
219
34
2
{-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE ImpredicativeTypes #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeOperators #-} -- | -- Module : Data.Array.Accelerate.CUDA.CodeGen.Pref...
tmcdonell/accelerate-cuda
Data/Array/Accelerate/CUDA/CodeGen/PrefixSum.hs
bsd-3-clause
18,181
0
17
6,232
2,873
1,583
1,290
199
4
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} -- | Provide ability to upload tarballs to Hackage. module Stack.Upload ( -- * Upload mkUploader , Uploader , upload , uploadBytes , UploadSettings , defaultUploadSettings , s...
chreekat/stack
src/Stack/Upload.hs
bsd-3-clause
11,089
0
24
3,834
2,043
1,118
925
215
5
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Stack.Options.BenchParser where import Options.Applicative import Options.Applicative.Builder.Extra import Stack.Prelude import Stack.Options.Utils import Stack.Types.Config -- | Parser for ...
MichielDerhaeg/stack
src/Stack/Options/BenchParser.hs
bsd-3-clause
1,077
0
15
395
151
81
70
20
1
module ContMT (HasCont(..), MT(..), at, Z, S, removeCont, runCont, WithCont) where import MT import Control.Monad(liftM,MonadPlus(..)) import Control_Monad_Fix import ImpUtils newtype WithCont o m i = C { ($$) :: (i -> m o) -> m o } removeCont :: WithCont o m i -> (i -> m o) -> m o removeCont = ($$)...
kmate/HaRe
old/tools/base/lib/Monads/ContMT.hs
bsd-3-clause
3,297
98
14
1,091
1,202
632
570
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ViewPatterns #-} module WaiAppStatic.Listing ( defaultListing ) where import qualified Text.Blaze.Html5.Attributes as A import qualified Text.Blaze.Html5 as H import Text.Blaze ((!)) import qualified Data...
AndrewRademacher/wai
wai-app-static/WaiAppStatic/Listing.hs
mit
7,629
0
20
3,040
1,781
907
874
125
12
module T14396 where import T14396a import T14396b data S = S
ezyang/ghc
testsuite/tests/typecheck/should_compile/T14396.hs
bsd-3-clause
61
0
5
11
17
11
6
4
0
module T3286 (train) where import qualified Data.Map as M import Data.List (groupBy, foldl') import Data.Maybe (fromMaybe, fromJust) import Data.Function (on) import T3286b type Prob = LogFloat learn_states :: (Ord state) => [(observation, state)] -> M.Map state Prob learn_states xs = histogram $ map snd xs learn_...
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/codeGen/should_compile/T3286.hs
bsd-3-clause
1,700
0
16
576
602
331
271
34
1
module T13290 where data Foo = Bar Int Char | Baz Char {-# RULES "BarBaz" Bar 0 'a' = Baz 'b' #-}
ezyang/ghc
testsuite/tests/deSugar/should_compile/T13290.hs
bsd-3-clause
101
0
6
25
21
13
8
4
0
module Good (Good(..)) where class Good a where isGood :: a -> Bool
urbanslug/ghc
testsuite/tests/stranal/should_run/T8425/Good.hs
bsd-3-clause
71
0
7
16
31
18
13
3
0
{-# LANGUAGE OverloadedStrings #-} module Crypto.Condition where import Control.Exception import Data.ByteString as B import Data.ByteString.Char8 as B8 import Data.Word8 (_equal) --import qualified Data.ByteString.Base16 as B16 import qualified Data.ByteString.Base64.URL as B64URL import qualified Crypto.Hash.SHA256 ...
gip/cinq-cloches-ledger
src/Crypto/Condition.hs
mit
3,963
0
14
851
897
478
419
104
5
{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE RankNTypes #-} ...
zenhack/haskell-capnp
lib/Capnp/Repr/Methods.hs
mit
5,908
0
15
1,629
1,621
873
748
-1
-1
{-# LANGUAGE Arrows #-} {-# LANGUAGE ExplicitForAll #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE Rank2Types #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS -Wall #-} module Input.Input ( inputMouseButtonDown , inputM...
mfpi/hsys
src/Input/Input.hs
mit
11,547
22
16
2,478
2,810
1,568
1,242
-1
-1
{-# LANGUAGE CPP #-} -- | This is the main module that contains bindings for PKCS#11 interface. module System.Crypto.Pkcs11 ( -- * Library Library , libraryVersion , loadLibrary , releaseLibrary -- ** Reading library information , getInfo , LibraryInfo , infoCryptokiVersion , infoManufactur...
denisenkom/hspkcs11
src/System/Crypto/Pkcs11.hs
mit
25,086
0
17
5,112
5,246
2,736
2,510
476
3
module Feature.InsertSpec where import Test.Hspec hiding (pendingWith) import Test.Hspec.Wai import Test.Hspec.Wai.JSON import Network.Wai.Test (SResponse(simpleBody,simpleHeaders,simpleStatus)) import SpecHelper import PostgREST.Types (DbStructure(..)) import qualified Data.Aeson as JSON import Data.Maybe (fromJust...
motiz88/postgrest
test/Feature/InsertSpec.hs
mit
18,062
0
26
5,474
3,094
1,653
1,441
-1
-1
{-# LANGUAGE TypeOperators, ScopedTypeVariables, OverloadedStrings, FlexibleContexts, TemplateHaskell #-} module Wf.Web.JsonApiSpec ( jsonApiSpec ) where import Control.Eff (Eff, Member, (:>)) import Control.Eff.Exception (Exc, runExc) import Control.Eff.Lift (Lift, runLift) import Control.Monad (sequence_) import Con...
bigsleep/Wf
test/Wf/Web/JsonApiSpec.hs
mit
4,390
0
15
774
1,486
828
658
78
2
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.SVGLength (js_newValueSpecifiedUnits, newValueSpecifiedUnits, js_convertToSpecifiedUnits, convertToSpecifiedUnits, pattern SVG_LENGTHTYPE_UNKNOWN, pattern SVG_LENGTHTYPE_NUMBER, patt...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/SVGLength.hs
mit
5,987
66
11
904
1,246
690
556
95
1
module Graphs where import Data.List (sortOn) import Log burn' :: [Name] -> Log Entry -> [(Time, Weight)] burn' names log = let es = map (flip lookt log) names es' = sortOn fst es step (time, entry) p@(total, chain) = case entry of Task _ -> let nw = total + 1 in ...
kovach/watdo
src/Graphs.hs
mit
1,418
0
22
609
299
166
133
23
6
{-# LANGUAGE TemplateHaskell, RecordWildCards, DeriveDataTypeable #-} import Control.Monad import Control.Applicative import Control.Arrow hiding ((<+>)) import System.IO import System.Directory import System.Process import Control.Concurrent import Control.Exception import System.Exit import System.IO import System.I...
QuickChick/Luck
luck/examples-template/C.hs
mit
6,684
0
23
2,576
2,102
1,051
1,051
156
3
{-Thanks to jaspervdj: http://jaspervdj.be/ -} -------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} module Main where -------------------------------------------------------------------------------- import Data.Monoid (mappend) import ...
rejuvyesh/homepage
src/site.hs
mit
6,245
0
24
2,057
1,158
554
604
129
1
{-# LANGUAGE TemplateHaskell #-} module Main where -- base import Control.Monad (when) import System.Exit (die) import Data.Char -- bytestring import Data.ByteString (ByteString) import qualified Data.ByteString as B -- transformers import Control.Monad.IO.Class -- JuicyPixels import Codec.Picture -- linear import Li...
Lokathor/hexes
app/Main.hs
mit
2,358
0
19
574
577
292
285
48
1
module Input where import Control.Monad ( when ) import Data.IORef import Data.Maybe ( fromMaybe ) import Graphics.UI.GLUT import qualified Data.Map as M import Types -- | A pure version of "getKeyState". Rather than look up the key in the -- global "State"'s "KeyboardState", the supplied "KeyboardState" is used --...
labcoders/gol3d-hs
src/Input.hs
mit
1,014
0
12
200
216
115
101
16
1
module One where import Data.List import qualified Data.Map as M import qualified Data.Vector as V import Data.Time import Data.List.Split import Common sumPrimes :: Int -> Int sumPrimes lim = let iterSum :: Int -> Int -> Int iterSum i res ...
zeniuseducation/poly-euler
Alfa/ml/one.hs
epl-1.0
4,566
0
16
1,657
2,368
1,228
1,140
110
4
{- dfsbuild: CD image builder Copyright (c) 2006 John Goerzen Please see COPYRIGHT for more details -} module Bootloader.Aboot where import Utils import System.Cmd.Utils import System.Path import System.Posix.Files import System.Posix.Directory import System.Path.Glob import Data.ConfigFile import System.FilePath impo...
jgoerzen/dfsbuild
Bootloader/Aboot.hs
gpl-2.0
1,028
0
13
288
234
125
109
21
1
module Main where import Data.Char (digitToInt) main :: IO () main = let target = 1000 :: Integer power = 2^target digits = show power values = map digitToInt digits in print $ sum values
liefswanson/projectEuler
app/p1/q16/Main.hs
gpl-2.0
238
0
9
85
77
41
36
10
1
module Handler.AssignPaper where import Import import qualified Handler.ProgramChair as PC import qualified Util as U import Data.PaperStatus postAssignPaperR :: Handler Html postAssignPaperR = do reviewerOpts <- U.reviewerOpts paperOpts <- U.paperOpts ((assignResult, _), _) <- runFormPost $ PC.assignPape...
ackao/APRICoT
web/conference-management-system/Handler/AssignPaper.hs
gpl-3.0
677
0
13
166
166
84
82
18
2
{-# LANGUAGE TemplateHaskell #-} module Annotation.Demo where import Common annotate [d| data Foo = A Int | B Int String | C { a :: Int } | Int :+ Int deriving (Eq, Ord, Show) |]
ktvoelker/FLang
src/Annotation/Demo.hs
gpl-3.0
189
0
5
46
20
13
7
6
0
{-# LANGUAGE OverloadedStrings #-} -------------------------------------------------------------------------------- -- | -- Module : Web.View -- Copyright : (C) 2014 Yorick Laupa -- License : (see the file LICENSE) -- -- Maintainer : Yorick Laupa <yo.eight@gmail.com> -- Stability : provisional -- Portability : non-port...
YoEight/personal-site
Web/View.hs
gpl-3.0
2,631
0
10
473
448
252
196
-1
-1
-------------------------------------------------------------------------------- -- This file is part of Hellnet -- -- Hellnet is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3...
Voker57/hellnet
Hellnet/Files.hs
gpl-3.0
3,688
6
16
629
1,001
489
512
73
2
-- 24/03/16 -- Lorenzo Jose Lamas -- Algebra I -- Labo -- mcd :: Integer -> Integer -> Integer mcd a b | b == 0 = a | otherwise = mcd b (mod a b) fact :: Integer -> Integer fact 0 = 1 fact n = (n * fact (n - 1)) enIngles :: Integer -> [Char] enIngles 1 = "one!" enIngles 2 = "two" enIngles 3 = "three" enIngles 4...
lorenzojlamas/ejercicios
6.hs
gpl-3.0
1,739
0
11
401
761
409
352
42
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-firebase-dynamiclinks/gen/Network/Google/Resource/FirebaseDynamicLinks/GetLinkStats.hs
mpl-2.0
5,607
0
18
1,324
880
509
371
126
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-consumersurveys/gen/Network/Google/Resource/ConsumerSurveys/Results/Get.hs
mpl-2.0
4,190
0
21
1,065
555
318
237
82
1
-- This file is part of purebred -- Copyright (C) 2020 Róman Joost -- -- purebred is free software: you can redistribute it and/or modify -- it under the terms of the GNU Affero General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later vers...
purebred-mua/purebred
src/Purebred/UI/Widgets.hs
agpl-3.0
1,975
0
9
358
267
152
115
20
1
import Helpers.Subsets (choose) -- Points (in 3D) of a centered hexagonal lattice of size n. -- A002417 type Point = (Int, Int, Int) type Points = [Point] hexLatticePoints :: Int -> [Point] hexLatticePoints n = [(x,y,3*n - x - y) | x <- [0..2*n], y <- [max 0 (n-x)..min (2*n) (3*n - x)]] isEquilateral :: Points -> Boo...
peterokagey/haskellOEIS
src/Sandbox/CenteredHexagonal.hs
apache-2.0
733
0
14
167
429
234
195
17
1
module TF.CallChecker where import Control.Arrow import Control.Error as E import Control.Lens hiding (noneOf,(??)) import Lens.Family.Total hiding ((&), Empty) import Control.Monad import Control.Monad.Writer import Control.Monad.State import Control.Monad....
sleepomeno/TForth
src/TF/CallChecker.hs
apache-2.0
3,767
0
20
879
1,259
667
592
85
2
module Rec where data IntList = Empty | Cons Int IntList deriving (Show) absAll :: IntList -> IntList absAll Empty = Empty absAll (Cons x xs) = Cons(abs x) (absAll xs) squareAll :: IntList -> IntList squareAll Empty = Empty squareAll (Cons x xs) = Cons (x * x)(squareAll xs) exampleList = Co...
hungaikev/learning-haskell
cis194/week3/rec-poly.hs
apache-2.0
1,689
0
11
454
745
379
366
48
1