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 Roguelike.Model.Board ( Board , GameBoard (..) ) where import Control.Monad (forM_) import Control.Monad.ST (ST, runST) import qualified Data.Matrix as MI import qualified Data.Matrix.Mutable as MM import Roguelike.Model.Defs newtype Board = Board ...
tr00per/roguelike0
src/Roguelike/Model/Board.hs
bsd-2-clause
2,150
0
14
679
792
402
390
53
1
{-# LANGUAGE ScopedTypeVariables #-} module Main where import Reduce import Prelude hiding (replicate) import Prelude as P import Obsidian import Obsidian.Run.CUDA.Exec -- import Obsidian.Run.CUDA.SC import qualified Data.Vector.Storable as V import Control.Monad.State import Data.Int import Data.Word performS...
svenssonjoel/ObsidianGFX
Examples/ReductionTutorial/ReduceExec.hs
bsd-3-clause
3,770
0
23
1,188
1,083
543
540
77
1
{-# LANGUAGE OverloadedStrings #-} module Home.Views where import Text.Blaze.Html5 as H import Text.Blaze.Html5.Attributes as Ha import Common.Views import Area.Links import Apc.Links homePage :: Html homePage = layout "Home" $ do p $ a ! href (viewAreasLink "blc") $ "Browse base layer controllers" p $ a ! href ...
hectorhon/autotrace2
app/Home/Views.hs
bsd-3-clause
450
0
12
74
122
65
57
13
1
{-# LANGUAGE OverloadedStrings #-} module YaLedger.Parser.CSV where import Control.Applicative import Control.Monad import Data.Yaml import qualified Data.ByteString.Lazy as L import YaLedger.Types import YaLedger.Parser.Common (loadParserConfig, readUrlLBS) import YaLedger.Parser.Tables data ParserConfig = ParserCo...
portnov/yaledger
YaLedger/Parser/CSV.hs
bsd-3-clause
1,539
0
13
340
453
234
219
41
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. module Duckling.Q...
rfranek/duckling
tests/Duckling/Quantity/PT/Tests.hs
bsd-3-clause
603
0
9
96
80
51
29
11
1
module REPL.Suggest (suggest) where import Text.Printf import Data.List (intercalate) import Data.Maybe (fromJust) import REPL.NPC (npcLookup) import Rating import AlbanKnights (findKeyIndices, pickOne, getKeywordIndex) suggest :: [String] -> Rating -> Either String Rating suggest [str] r = case npcLookup str of "...
sandmark/AlbanKnights
src/REPL/Suggest.hs
bsd-3-clause
2,094
0
12
495
692
360
332
37
9
module Network.SMTP.Server ( SMTPParameters(..) , smtpParameters , ClientInfo(..) , smtpConnection , runSMTPServer ) where import Prelude hiding ((.), id) import Data.List import Control.Monad import Control.Monad.Trans.Class import Control.Monad.IO.Class import Data.Conduit i...
abbradar/smtp
src/Network/SMTP/Server.hs
bsd-3-clause
9,344
0
22
3,706
2,302
1,209
1,093
-1
-1
module SatO.Karma.Chart (Chart, chart) where import Data.Bifunctor (second) import Data.Map (Map, foldWithKey) import Data.Text (Text, unpack) import Data.Colour.CIE import Data.Colour.CIE.Illuminant (d65) import Graphics.Rendering.Chart.Easy import SatO.Karma.Types (Graph (..)) newtype Chart = Chart (EC (Layout D...
osakunta/karma
src/SatO/Karma/Chart.hs
bsd-3-clause
1,650
0
16
454
719
382
337
-1
-1
import Data.Maybe import System.IO import System.Environment import Text.HTML.TagStream import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as S import System.Console.ANSI import qualified Data.Enumerator as E import qualified Data.Enumerator.Binary as E import qualified Data.Enumerator.List as E...
yihuang/tag-stream
Highlight.hs
bsd-3-clause
1,143
0
15
267
327
177
150
28
1
module Server (runServer ) where import qualified Data.Map.Strict as Map import ConcurrentUtils import Control.Monad import Control.Monad.STM import Control.Concurrent.STM.TVar import Network import System.IO import Models import Messages (decode, encode) import Utils runServer :: ServerId -> CurrentConnection ->...
shterrett/peer-chat
src/Server.hs
bsd-3-clause
1,634
0
13
358
561
283
278
40
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 GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module Duckling.Ordinal.KM...
facebookincubator/duckling
Duckling/Ordinal/KM/Rules.hs
bsd-3-clause
903
0
16
176
180
111
69
25
2
{-# OPTIONS -Wno-redundant-constraints #-} module Language.Expression.Match where { import Import; import Language.Expression.Expression; matchBind :: (TestEquality wit,Functor f1,Functor f2) => MatchExpression wit f1 a -> ValueExpression wit f2 b -> ValueExpression wit (Compose f1...
AshleyYakeley/expression
src/Language/Expression/Match.hs
bsd-3-clause
1,413
0
21
307
529
284
245
21
1
module Prac6 where import Prelude import FPPrac.Graphics import FPPrac.Events import Graphics import System.FilePath (splitPath, dropExtension) import CreateGraph import Debug.Trace data MyStore = MyStore { myGraph :: Graph } initPrac6 graph = MyStore {myGraph = graph} main = doGraph doPrac6 initPrac6 myGraph...
christiaanb/fpprac
examples/Prac6.hs
bsd-3-clause
1,456
0
13
288
432
235
197
25
2
{-# LANGUAGE CPP #-} {-# LANGUAGE ForeignFunctionInterface #-} {-# LANGUAGE OverloadedStrings #-} -- | Low level XMLHttpRequest support. IE6 and older are not supported. module Haste.Ajax (Method (..), URL, ajaxRequest, noParams) where import Haste.Prim import Haste.JSType import Haste.Callb...
joelburget/haste-compiler
libraries/haste-lib/src/Haste/Ajax.hs
bsd-3-clause
2,232
0
15
770
524
279
245
40
5
-- 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.Ordinal.TA.Corpus ( corpus ) where import Data.String im...
facebookincubator/duckling
Duckling/Ordinal/TA/Corpus.hs
bsd-3-clause
3,219
0
9
1,257
557
315
242
82
1
module Statistics.Information.Utils.List where import Data.List repeatN :: Int -> a -> [a] repeatN n a = take n (repeat a) count :: Eq a => a -> [a] -> Int count x = length . filter (==x) probs :: (Eq a, Fractional b) => [a] -> [(a, b)] probs xs = [(x, (fromIntegral $ count x xs) / len) | x <- nub xs] where l...
eligottlieb/Shannon
src/Statistics/Information/Utils/List.hs
bsd-3-clause
423
0
10
99
235
127
108
11
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeOperators #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Tensor ( tests ) where import Control.Applicative (liftA2) import Distribution.TestSuite.QuickChec...
tensor5/tensor
tests/Tensor.hs
bsd-3-clause
5,274
0
24
1,633
2,387
1,230
1,157
-1
-1
module Hork.Header where import Hork.Mem -- Constants for the locations of things in the header. hdrVERSION, hdrFLAGS1, hdrHIMEM, hdrPC0, hdrDICTIONARY, hdrOBJTABLE, hdrGLOBALS, hdrSTATIC, hdrFLAGS2, hdrABBREVIATIONS, hdrFILESIZE, hdrCHECKSUM, hdrINTNUMBER, hdrINTVERSION, hdrSTANDARD :: RA hdrVERSION = 0 hdrFLAGS1 =...
shepheb/hork
Hork/Header.hs
bsd-3-clause
556
0
4
81
120
84
36
18
1
import Control.Monad (void) import Control.Arrow ((&&&)) import Data.IORef ( newIORef , readIORef , writeIORef) import Data.List (groupBy, sort, isInfixOf) import Data.Char (toLower) import System.Directory import qualified Graphics.UI.Threepenny as UI import Graphics.UI.Threepenny....
epsilonhalbe/Skriptenliste
Main.hs
bsd-3-clause
3,719
1
20
1,219
1,206
620
586
74
2
{-# LANGUAGE TypeFamilies, FlexibleContexts, PackageImports #-} module Network.XmlPush.Http.Server ( HttpSv, HttpSvArgs(..), Mechanism(..), HttpPullSvArgs(HttpPullSvArgs), HttpPushArgs(HttpPushArgs), ) where import Control.Monad import "monads-tf" Control.Monad.Error -- import Control.Monad.Base import Control.Mo...
YoshikuniJujo/xml-push
src/Network/XmlPush/Http/Server.hs
bsd-3-clause
1,913
24
19
321
656
348
308
57
2
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[HsBinds]{Abstract syntax: top-level bindings and signatures} Datatype for: @BindGroup@, @Bind@, @Sig@, @Bind@. -} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleConte...
vTurbine/ghc
compiler/hsSyn/HsBinds.hs
bsd-3-clause
39,532
0
18
11,540
6,144
3,322
2,822
420
4
{-# LANGUAGE PackageImports, FlexibleContexts #-} import "monads-tf" Control.Monad.State import Control.Monad.Trans.Control import qualified GHC.Event as E registerTimeout :: MonadBaseControl IO m => E.EventManager -> Int -> m () -> m E.TimeoutKey registerTimeout ev i cb = control $ \runInIO -> E.registerTimeout ev...
YoshikuniJujo/xmpipe
test/testControl.hs
bsd-3-clause
349
4
11
51
111
59
52
8
1
-- | module X12.ParserSpec where import SpecHelper main :: IO () main = hspec spec spec :: Spec spec = describe "X12.Parser" $ do context "Parse an InterchangeVal" $ do it "parses a [SegmentToken] into an InterchangeVal" $ do pendingWith "need to update Parser to work with SegmentToken i/o Segme...
alexkyllo/xtwelve
test/X12/ParserSpec.hs
bsd-3-clause
327
0
14
74
71
35
36
10
1
module Main where import Control.Applicative import Network.API.Codeship import System.Environment main :: IO () main = do result <- projects =<< CodeshipKey <$> getEnv "CODESHIP_API_KEY" print result
filib/codeship-hs
examples/Projects.hs
mit
207
0
9
32
59
31
28
8
1
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Network.AWS.EC2.Waiters -- Copyright : (c) 2013-2015 Brendan Hay -- License : Mozilla Public License, v. ...
fmapfmapfmap/amazonka
amazonka-ec2/gen/Network/AWS/EC2/Waiters.hs
mpl-2.0
21,473
0
17
8,851
2,929
1,617
1,312
413
1
{-# LANGUAGE CPP #-} module System.Posix.GracefulSpec ( spec ) where import Control.Concurrent import Control.Exception import Control.Monad import Data.List import Network import Network.Socket #if MIN_VERSION_process(1,0,1) #else import System.Cmd #endif import System.Directory import System.Exit import System.FileP...
notogawa/haskell-graceful-debian
test/System/Posix/GracefulSpec.hs
bsd-3-clause
7,609
0
15
1,743
2,233
1,074
1,159
222
2
-- Name: Java Generics -- Description: Shows how to interface with Java APIs that use Generics. -- These language extensions are currently required to support -- Java Generics. {-# LANGUAGE MagicHash, FlexibleContexts, TypeFamilies, DataKinds, TypeOperators #-} -- This imports all the standard library functionality th...
pparkkin/eta
examples/JavaGenerics.hs
bsd-3-clause
2,319
10
13
415
490
264
226
-1
-1
{-# LANGUAGE OverloadedStrings, TypeFamilies, TemplateHaskell, QuasiQuotes #-} module Network.PushNotify.General.YesodPushAppRoutes where import Yesod import Network.PushNotify.General.Types import Control.Concurrent import Data.Text -- Yesod subsite to be used for the registration and reception of messages from dev...
jimpeak/GSoC-Communicating-with-mobile-devices
push-notify-general/Network/PushNotify/General/YesodPushAppRoutes.hs
mit
428
0
5
46
42
28
14
7
0
----------------------------------------------------------------------------- -- -- Stg to C--: heap management functions -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- module StgCmmHeap ( getVirtHp, setVirtHp, setRealHp, g...
lukexi/ghc-7.8-arm64
compiler/codeGen/StgCmmHeap.hs
bsd-3-clause
23,495
0
20
6,810
3,595
1,854
1,741
284
8
<?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="fil-PH"> <title>Mga Patakaran ng Pasibong Pag-scan - Beta | Ekstensyon ng ZAP</title> <maps> ...
thc202/zap-extensions
addOns/pscanrulesBeta/src/main/javahelp/org/zaproxy/zap/extension/pscanrulesBeta/resources/help_fil_PH/helpset_fil_PH.hs
apache-2.0
1,020
78
68
167
436
219
217
-1
-1
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="ro-RO"> <title>Automation Framework</title> <maps> <homeID>top</homeID> <mapref locatio...
thc202/zap-extensions
addOns/automation/src/main/javahelp/org/zaproxy/addon/automation/resources/help_ro_RO/helpset_ro_RO.hs
apache-2.0
965
77
66
156
407
206
201
-1
-1
module RefacMoveDef(liftToTopLevel, liftOneLevel, demote,liftingInClientMod) where import Prelude hiding (putStrLn) import PrettyPrint import Data.Maybe import Data.List import RefacUtils import HsName import AbstractIO data Direction = UptoTopLevel | UpOneLevel | Down {--------This function handles refactorings i...
mpickering/HaRe
old/refactorer/RefacMoveDef.hs
bsd-3-clause
46,373
1
24
16,651
9,884
5,048
4,836
-1
-1
{-# LANGUAGE CPP #-} #if __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif -- | -- Module : Data.ByteString.Short -- Copyright : (c) Duncan Coutts 2012-2013 -- License : BSD-style -- -- Maintainer : duncan@community.haskell.org -- Stability : stable -- Portability : ghc only -- -- A compact...
markflorisson/hpack
testrepo/bytestring-0.10.4.1/Data/ByteString/Short.hs
bsd-3-clause
2,977
0
4
704
116
100
16
10
0
-- | This is program use uzbl embedded in window to render webpage. -- Just simple model demo for view, haven't handle event or else. -- -- You need install uzbl (git clone git://github.com/Dieterbe/uzbl.git) first. -- -- How to use: -- ./Uzbl default open Google page. -- ./Uzbl url will open url you input -- m...
k0001/gtk2hs
gtk/demo/embedded/Uzbl.hs
gpl-3.0
1,279
0
13
313
209
110
99
23
2
{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} module T14885b where class Foo1 a where foo1 :: forall b. a -> b -> b default foo1 :: forall b. a -> b -> b foo1 _ x = (x :: b) $([d| class Foo2 a where foo2 :: forall b. a -> b -> b...
sdiehl/ghc
testsuite/tests/th/T14885b.hs
bsd-3-clause
403
0
10
130
81
47
34
12
0
{-# htermination elemIndex :: Bool -> [Bool] -> Maybe Int #-} import List
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/List_elemIndex_6.hs
mit
74
0
3
13
5
3
2
1
0
{-# LANGUAGE TemplateHaskell #-} module THDerive where import Language.Haskell.TH derive :: Name -> Name -> Dec derive class_ type_ = StandaloneDerivD [] (AppT (ConT class_) (ConT type_))
vladfi1/hs-misc
THDerive.hs
mit
194
0
9
33
61
33
28
6
1
{-# LANGUAGE TemplateHaskell #-} -- | Tests for @importify file@ command. module Test.File ( spec ) where import Universum import Data.List (sort) import Path (Abs, Dir, File, Path, Rel, dirname, fileExtension, filename, fro...
serokell/importify
test/hspec/Test/File.hs
mit
1,939
0
14
524
510
276
234
38
2
module Main where import Codec.Picture import PathTracer import System.Random main :: IO () main = do rndGen <- newStdGen let image = render rndGen 500 300 writePng "./result.png" image render :: StdGen -> Int -> Int -> Image PixelRGB8 render rndGen width height = snd $ generateFo...
sdeframond/haskell-tracer
src/MainPath.hs
mit
759
0
10
194
272
139
133
19
1
-- single line comment {- - multi-line comment - - to use interactive ghc session for it - $ ghci - > :l haskell01 -} import Data.List import System.IO always5 :: Int always5 = 5 always7 = 7 {- - uses type inference ; this is what inspired golang - Int -2^63 to 2^63 - Integer is unbounded whole number, si...
abhishekkr/tutorials_as_code
talks-articles/languages-n-runtimes/haskell/DerekBanas.Haskell.LYAH/haskell01.hs
mit
1,449
0
7
301
224
129
95
25
1
{-# LANGUAGE TupleSections #-} module ProjectEuler.Problem137 ( problem ) where import Data.Maybe import Data.Word import Math.NumberTheory.Powers.Squares import ProjectEuler.Types problem :: Problem problem = pureProblem 137 Solved result {- I have no clue for this one, but 74049690 looks like a searchable ...
Javran/Project-Euler
src/ProjectEuler/Problem137.hs
mit
1,678
0
12
372
245
140
105
21
1
{-# LANGUAGE TupleSections #-} module RL.Generator.Items (ItemConfig(..), itemsGenerator, generateChestItems, randomItemAppearances) where -- generate random items in dungeon import RL.Generator import RL.Item import RL.Map import RL.Random import Control.Monad.Reader (ask) import Data.Map (Map) import Data.Ratio i...
MichaelMackus/hsrl
RL/Generator/Items.hs
mit
4,964
0
15
1,484
1,852
942
910
116
16
{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} module Xml.TasteometerSpec (spec) where import Data.Text (Text) import Lastfm import qualified Lastfm.Tasteometer as Taste import Test.Hspec import Text.Xml.Lens import SpecHelper spec :: Spec spec = do ...
supki/liblastfm
test/api/Xml/TasteometerSpec.hs
mit
969
0
14
207
276
149
127
29
1
module Model ( Item (..) , Element, Floor , parseFloor ) where import Data.Maybe (catMaybes) import Data.Set (Set) import qualified Data.Set as S import Parser data Item = Generator Element | Microchip Element deriving (Show, Eq, Ord) parseItems :: Parser (Set Item) parseItems = S.fromList <$> pa...
CarstenKoenig/AdventOfCode2016
Day11/Model.hs
mit
1,265
0
10
309
356
181
175
44
1
module Main where import Control.Applicative import Control.Monad import Data.IORef import Test.Framework (defaultMain) import Test.Framework.Providers.HUnit (hUnitTestToTests) import Test.HUnit import System.FilePath.Glob (glob) import Language.Egison.Types import Language.Egison.Core import Language.Egison.Primiti...
beni55/egison
test/UnitTest.hs
mit
1,145
0
16
233
351
185
166
30
3
{-# LANGUAGE PackageImports #-} {-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-} -- | Reexports "Data.Void.Compat" -- from a globally unique namespace. module Data.Void.Compat.Repl.Batteries ( module Data.Void.Compat ) where import "this" Data.Void.Compat
haskell-compat/base-compat
base-compat-batteries/src/Data/Void/Compat/Repl/Batteries.hs
mit
278
0
5
31
29
22
7
5
0
{-# LANGUAGE FlexibleInstances #-} module ParserSpec where import Text.Parsec import Text.Parsec.Pos import Test.Hspec import Parser import AST u :: SourcePos u = newPos "test" 0 0 v :: String -> Expr v = IdentExpr u c :: Integer -> Expr c = Constant u exprSample :: Expr exprSample = BinaryPrim u "||" (v "a") ...
yu-i9/HaSC
test/ParserSpec.hs
mit
5,252
0
27
2,099
1,730
888
842
103
1
module AI.DemoNeuron ( Neuron(..) , L2Neuron(..) , ReducedNeuron(..) , NeuronWeights , Values , ActivationFunction , ActivationFunction' , sigmoidNeuron , tanhNeuron , recluNeuron , sigmoid, sigmoid' , tanh, tanh' , r...
qzchenwl/LambdaNet
AI/DemoNeuron.hs
mit
3,294
0
11
830
688
382
306
63
2
{-# LANGUAGE NoImplicitPrelude #-} module Crypto.Boring.Internal.Context ( EVP_CIPHER_CTX , EVP_CIPHER , EVP_MD_CTX , EVP_MD , HMAC_CTX , ErrorCallback , cryptoCtx ) where import qualified Data.Map as M import qualified Language.C.Inline as C import qualified Language.C.Inline.Context as C import qual...
chpatrick/boring-crypto
src/Crypto/Boring/Internal/Context.hs
mit
950
0
12
184
269
171
98
-1
-1
module Odds where odds :: [Int] -> [Int] odds = filter odd
cojoj/Codewars
Haskell/Codewars.hsproj/Odds.hs
mit
63
0
6
16
27
16
11
3
1
{-# LANGUAGE DeriveDataTypeable #-} -- Handles indentation in the keymaps. Includes: -- * (TODO) Auto-indentation to the previous lines indentation -- * Tab-expansion -- * Shifting of the indentation for a region of text module Yi.Buffer.Indent where import Yi.Buffer.Basic import Yi.Buffer.Misc import Yi.Buffer.H...
codemac/yi-editor
src/Yi/Buffer/Indent.hs
gpl-2.0
18,405
10
15
4,575
2,564
1,350
1,214
196
9
{-# LANGUAGE ScopedTypeVariables #-} module TestHelper (qc, mustFail) where import Prelude import Data.List import Test.QuickCheck as QC import Test.HUnit as HU import Test.QuickCheck.Monadic (monadicIO, run) import Control.Exception (try, evaluate, SomeException) qc :: QC.Testable prop => prop -> HU.Assertion qc t...
Erdwolf/autotool-bonn
src/Haskell/Blueprint/TestHelper.hs
gpl-2.0
755
0
13
161
248
132
116
21
2
import Data.List (maximumBy, minimumBy, transpose, group, sort) import Data.Function (on) import Control.Monad (liftM) main = do columns <- liftM (transpose . lines) (readFile "input.txt") putStrLn $ map mode columns putStrLn $ map lode columns mode = head . (maximumBy $ on compare length) . group . sort lode =...
ayron/AoC
2016/Day 6/solution.hs
gpl-3.0
375
3
10
68
164
81
83
9
1
-- Insertion sort in Haskell insertSort :: [Int] -> [Int] insertSort [] = [] insertSort (x:xs) = insert x (insertSort xs) where insert y [] = [y] insert y (x:xs) = if y > x then x:(insert y xs) else y:x:xs -- An alternative with foldr insertSort :: [Int] -> [Int] insertSo...
YuKitAs/tech-note
algorithm/sorting-algo/insertion-sort.hs
gpl-3.0
488
0
10
168
232
123
109
10
3
module Main where import Hip.Prelude import Hip.HipSpec import Prelude (Bool(..)) True && a = a False && _ = False False || a = a True || _ = True not True = False not False = True prop_and_comm :: Bool -> Bool -> Prop Bool prop_and_comm x y = y && x =:= x && y prop_or_comm :: Bool -> Bool -> Prop Bool prop_or...
danr/hipspec
examples/old-examples/hip/Bool.hs
gpl-3.0
2,273
0
9
504
1,027
520
507
57
1
-- "Data/RoseTrie/RoseTrie.hs" provides the RoseTrie data type, a tree combining -- properties of a Trie and a RoseTrie. -- -- Copyright (C) 2008-2016 Ramin Honary. -- -- This library is free software: you can redistribute it and/or modify it under the terms of -- the GNU General Public License as published by the Fr...
RaminHAL9001/rose-trie
src/Data/Tree/RoseTrie.hs
gpl-3.0
32,423
13
27
6,444
8,696
4,546
4,150
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-compute/gen/Network/Google/Resource/Compute/URLMaps/List.hs
mpl-2.0
6,417
0
18
1,415
678
409
269
94
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-android-publisher/gen/Network/Google/Resource/AndroidPublisher/Edits/Listings/Get.hs
mpl-2.0
5,482
0
21
1,365
862
501
361
128
1
-- 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
haskell-rpm/RPM/Tags.hs
lgpl-2.1
46,720
0
15
21,328
9,696
4,986
4,710
700
301
{- Copyright (C) 2009 Andrejs Sisojevs <andrejs.sisojevs@nextmail.ru> All rights reserved. For license and copyright information, see the file COPYRIGHT -} -------------------------------------------------------------------------- -------------------------------------------------------------------------- -- | The a...
Andrey-Sisoyev/haskell-PCLT
Text/PCLT/PCSI.hs
lgpl-2.1
4,138
0
12
952
503
307
196
45
1
module External.A001481 (a001481) where import Helpers.PolygonSizes (a001481_pairs) a001481_list :: [Integer] a001481_list = map reconstitute a001481_pairs where reconstitute ((a,b):_) = a^2 + b^2 a001481 :: Int -> Integer a001481 n = a001481_list !! (n - 1)
peterokagey/haskellOEIS
src/External/A001481.hs
apache-2.0
263
0
10
39
102
57
45
7
1
import Data.IORef import Data.Foldable import Control.Monad bubbleSort :: [Int] -> IO [Int] bubbleSort input = do let n = length input xs <- mapM newIORef input forM_ [0..n-1] $ \i -> do forM_ [0..n-2] $ \j -> do let ix = xs !! j let iy = xs !! (j + 1) x <- readIORef ix y <- readIOR...
omefire/HaskellProjects
ioref-bubblesort.hs
apache-2.0
528
0
20
176
260
124
136
22
1
class BasicEq a where isEqual :: a -> a -> Bool isEqual x y = not $ isNotEqual x y isNotEqual :: a -> a -> Bool isNotEqual x y = not $ isEqual x y instance BasicEq Bool where isEqual True True = True isEqual False False = True isEqual _ _ = False
EricYT/Haskell
src/real_haskell/chapter-6/BasicEq.hs
apache-2.0
291
0
8
99
112
55
57
9
0
module Application.DiagramDrawer.Draw where import Graphics.UI.Gtk import Graphics.Rendering.Cairo import Data.IORef import Application.DiagramDrawer.Type redrawCrossmarkAfterErase :: DrawingArea -> Maybe (Double,Double) -> (Double,Double) ...
wavewave/diagdrawer
lib/Application/DiagramDrawer/Draw.hs
bsd-2-clause
846
0
14
228
320
167
153
27
2
-- Copyright © 2012 Frank S. Thomas <frank@timepit.eu> -- All rights reserved. -- -- Use of this source code is governed by a BSD-style license that -- can be found in the LICENSE file. module Web.Ohloh.Lens.NameL where import Data.Lens.Common class NameL a where nameL :: Lens a String
fthomas/ohloh-hs
Web/Ohloh/Lens/NameL.hs
bsd-3-clause
293
0
7
53
38
24
14
4
0
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} module Main where import Network.HTTP import Network.Browser import Network.URI import Control.Monad.IO.Class (MonadIO(liftIO)) import Control.Monad impo...
GaloisInc/verification-game
web-prover/exes/Bot.hs
bsd-3-clause
9,658
0
20
2,635
2,943
1,531
1,412
237
2
{-# LANGUAGE DeriveDataTypeable, RankNTypes, FlexibleInstances, FlexibleContexts, KindSignatures, ScopedTypeVariables #-} module Game.Sample.Sample where -- Useful sampling functions used when playing games import qualified Language.Hakaru.ImportanceSampler as IS import Language.Hakaru.Metropolis hiding (s...
cronburg/deckbuild
Game/Sample/Sample.hs
bsd-3-clause
1,701
0
11
339
481
256
225
33
2
{-# LANGUAGE PatternGuards #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} -- For `Show` instance, it's OK. {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE TupleSections #-} {- | Module : Ve...
GaloisInc/saw-script
saw-core/src/Verifier/SAW/Simulator/Value.hs
bsd-3-clause
13,963
0
17
3,328
4,396
2,199
2,197
-1
-1
-- -- Test.hs -- -- A top level module for loading test cases. -- -- Gregory Wright, 18 June 2011 -- module Main where import Data.Maybe import Ratio import Basic import Canonicalize import Commutativity import Expr import Expression import Numeric import Symbol import IO import Tensor import TensorBasics import Te...
gwright83/Wheeler
src/Math/Symbolic/Wheeler/Test.hs
bsd-3-clause
1,520
0
15
395
698
363
335
49
3
module HaskellGame.Rendering where import Prelude ( Num(..), Show(..), Integral(..), Ord(..), IO(..), Integer(), String() ) import qualified System.Console.ANSI as Console import qualified Data.List as List import Control.Concurrent (threadDelay) import Control.Monad (m...
KevinCardiff/haskell-game2
src/HaskellGame/Rendering.hs
bsd-3-clause
3,338
0
22
696
1,120
599
521
60
2
--{-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE ExplicitForAll #-} --{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} --{-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE MultiParamTypeClasses #-} --{-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE RankNTypes #-} --{-# LANGUAGE RebindableSyntax #...
LATBauerdick/fv.hs
src/FV/Jacob.hs
bsd-3-clause
4,857
0
20
1,957
1,651
939
712
109
5
module Main where import Program.Programs import Syntax import qualified Transformer.ConsPD runConsPD = Transformer.ConsPD.runConsPD runDoubleAppendo = runConsPD (-1) "doubleAppendo" prog where prog = Program doubleAppendo $ fresh ["x", "y", "z", "r"] (call "doubleAppendo" [V "x", V "y"...
kajigor/uKanren_transformations
app/bench/Main.hs
bsd-3-clause
378
0
12
83
121
67
54
11
1
-- A Lighted Wreath -- ================ -- -- This program draws the wreath with all its default values. {-# LANGUAGE NoMonomorphismRestriction #-} import Wreath import Diagrams.Prelude import Diagrams.Backend.SVG.CmdLine -- Run the program with `dist/build/simulation/simulation -o simulation.svg -w 400` -- where `...
bobgru/wreath
examples/simulation.hs
bsd-3-clause
426
0
8
63
41
26
15
5
1
{-# LANGUAGE DeriveDataTypeable, ForeignFunctionInterface, RecordWildCards #-} -- | -- Module: Database.MySQL.Base -- Copyright: (c) 2011 MailRank, Inc. -- License: BSD3 -- Maintainer: Bryan O'Sullivan <bos@serpentine.com> -- Stability: experimental -- Portability: portable -- -- A low-level client libra...
lhuang7/mysql
Database/MySQL/Base.hs
bsd-3-clause
19,330
0
22
4,786
4,476
2,360
2,116
371
3
{- OnYourOwn1.hs (adapted from Simple.cpp which is (c) 2004 Astle/Hawkins) Copyright (c) Sven Panne 2004-2005 <sven.panne@aedion.de> This file is part of HOpenGL and distributed under a BSD-style license See the file libraries/GLUT/LICENSE -} import Control.Monad ( unless ) import System.Exit ( exitWith, E...
FranklinChen/hugs98-plus-Sep2006
packages/GLUT/examples/BOGLGP/Chapter01/OnYourOwn1.hs
bsd-3-clause
4,096
0
14
786
834
413
421
57
1
{-# LANGUAGE DeriveDataTypeable #-} {-| Module : Numeric.ER.BasicTypes.PlusMinus Description : mini sign datatype Copyright : (c) Michal Konecny License : BSD3 Maintainer : mikkonecny@gmail.com Stability : experimental Portability : portable A mini enumeratio...
michalkonecny/polypaver
src/Numeric/ER/BasicTypes/PlusMinus.hs
bsd-3-clause
1,111
0
11
270
215
112
103
25
1
-- BANNERSTART -- - Copyright 2006-2008, Galois, Inc. -- - This software is distributed under a standard, three-clause BSD license. -- - Please see the file LICENSE, distributed with this software, for specific -- - terms and conditions. -- Author: Adam Wick <awick@galois.com> -- BANNEREND -- |A low-level module for de...
GaloisInc/HaLVM
src/HALVMCore/Hypervisor/Memory.hs
bsd-3-clause
17,921
0
20
4,106
3,910
2,065
1,845
275
4
module Main where import Control.Monad (forM_) import System.Posix.Time import System.IO import VectorTest ntry = 10 :: Int nloop = 2000000 :: Int main :: IO () main = do let v1 = initVec 2.1 4.5 8.2 let v2 = initVec 1.1 2.5 7.2 let s = 4.7 tryN "noop " (\x -> v1) ntry tryN "new " (\x -> genVec x) ntry...
eijian/raytracer
test/Main-t7.hs
bsd-3-clause
1,032
0
14
272
503
251
252
32
1
----------------------------------------------------------------------------- -- | -- Module : System.LXC.AttachOptions -- Copyright : (c) Nickolay Kudasov 2014 -- License : BSD-style (see the file LICENSE) -- -- Maintainer : nickolay.kudasov@gmail.com -- -- Options and structures to run commands inside...
fizruk/lxc
src/System/LXC/AttachOptions.hs
bsd-3-clause
1,004
0
5
142
85
65
20
12
0
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 -} {-# LANGUAGE DeriveDataTypeable, DeriveFunctor, DeriveFoldable, DeriveTraversable #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE UndecidableInstances #-} -- Note [Pass...
ezyang/ghc
compiler/hsSyn/HsDecls.hs
bsd-3-clause
86,255
0
18
25,069
14,068
7,672
6,396
1,009
7
module Main (main) where import Autoencoder import Control.Applicative import Control.Monad import Control.Monad.ST import Data.Array.ST import Data.Char import Data.Classifier (Classifier) import Data.Classifier.NaiveBayes (NaiveBayes) import Data.Counter (Counter) import Data.Maybe import Data.Monoid import Data.ST...
intolerable/project-utilities
produce-results/Main.hs
bsd-3-clause
9,015
0
23
1,913
3,355
1,701
1,654
-1
-1
----------------------------------------------------------------------------- -- | -- Module : Data.SBV.SMT.SMT -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Abstraction of SMT solvers ---------------------------------------------...
TomMD/cryptol
sbv/Data/SBV/SMT/SMT.hs
bsd-3-clause
24,164
0
33
8,480
5,930
3,102
2,828
316
8
{-# OPTIONS_GHC -Wno-orphans #-} {-| Module : AERN2.MP.Enclosure Description : Enclosure operations Copyright : (c) Michal Konecny License : BSD3 Maintainer : mikkonecny@gmail.com Stability : experimental Portability : portable Enclosure classes and operations. -} ...
michalkonecny/aern2
aern2-mp/src/AERN2/MP/Enclosure.hs
bsd-3-clause
9,754
7
11
1,983
2,556
1,364
1,192
-1
-1
{-| Module : Database.Relational.Unique Description : Definition of UNIQUE Copyright : (c) Alexander Vieth, 2015 Licence : BSD3 Maintainer : aovieth@gmail.com Stability : experimental Portability : non-portable (GHC only) -} {-# LANGUAGE AutoDeriveTypeable #-} module Database.Relational.Unique ( ...
avieth/Relational
Database/Relational/Unique.hs
bsd-3-clause
376
0
6
75
28
19
9
4
0
module Language.Lambda.Common.Arbitrary where import Test.QuickCheck -- | Generates a string like "x_{n}" where n is positive integer sym_arbitrary :: Gen String sym_arbitrary = do index <- suchThat (arbitrary :: Gen Int) (>0) return $ ("x_" ++ (show index))
jfischoff/LambdaPrettyQuote
src/Language/Lambda/Common/Arbitrary.hs
bsd-3-clause
272
0
11
51
72
40
32
6
1
module Baum.BinHeap.Ops where import Baum.BinHeap.Type import Baum.Heap.Op ( Position ) import qualified Baum.Heap.Class as C import Control.Monad ( guard ) import Data.List ( inits, tails ) instance C.Heap BinHeap where empty = BinHeap [] isEmpty h = null $ roots h insert h x = BinHeap $ me...
Erdwolf/autotool-bonn
src/Baum/BinHeap/Ops.hs
gpl-2.0
2,640
0
15
1,048
1,140
583
557
68
3
import CpiLib import CpiTest import CpiODE import CpiSemantics import CpiLogic import System.Environment (getArgs) -- Time points --tps = (100,(0,25)) -- Basic f1 = Pos (0,infty) (ValGT (Conc (Def "P" [])) (R 0.05)) f2 = Pos (0,infty) (ValLE (Conc (Def "S" ["s"])) (R 0.01)) f3 = Nec (0,infty) (ValGT (Conc (Def "E" [...
chrisbanks/cpiwb
profileMC4.hs
gpl-3.0
5,096
0
14
1,857
1,866
982
884
144
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="fa-IR"> <title>Tips and Tricks | ZAP Extension</title> <maps> <homeID>top</homeID> <ma...
veggiespam/zap-extensions
addOns/tips/src/main/javahelp/org/zaproxy/zap/extension/tips/resources/help_fa_IR/helpset_fa_IR.hs
apache-2.0
986
84
64
161
413
209
204
-1
-1
-- Copyright (c) 2014 Eric McCorkle. All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions -- are met: -- 1. Redistributions of source code must retain the above copyright -- notice, this list of conditions...
saltlang/compiler-toolbox
src/Control/Monad/Genpos/Class.hs
bsd-3-clause
3,204
0
8
607
451
263
188
39
0
{-# language ForeignFunctionInterface #-} {-# language GADTSyntax #-} {-# language KindSignatures #-} {-# language MagicHash #-} {-# language UnboxedTuples #-} {-# language UnliftedFFITypes #-} {-# language UnliftedNewtypes #-} {-# OPTIONS_GHC -O2 #-} import Data.Kind (Type) import Data.Word import GHC.Exts import GH...
sdiehl/ghc
testsuite/tests/ffi/should_run/UnliftedNewtypesByteArrayOffset.hs
bsd-3-clause
1,402
0
14
239
344
181
163
-1
-1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- -- Code generation for foreign calls. -- -- (c) The University of Glasgow 2004-2006 -- ----------------------------------------------------------------------------- module StgCmmForeign ( cgForeignCall, emitPrimC...
ezyang/ghc
compiler/codeGen/StgCmmForeign.hs
bsd-3-clause
19,895
0
22
5,456
3,475
1,776
1,699
286
6
{-# LANGUAGE CPP #-} #if __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE DeriveGeneric #-} #endif -- (c) 1999 - 2002 by Martin Erwig [see file COPYRIGHT] -- | Tree-based implementation of 'Graph' and 'DynGraph' -- -- You will probably have better performance using the -- "Data.Graph.Inductive.PatriciaTree" implementation ...
scolobb/fgl
Data/Graph/Inductive/Tree.hs
bsd-3-clause
4,669
0
15
1,413
1,749
944
805
79
1
-- [ ghc-Bugs-1249226 ] runInteractiveProcess and closed stdin. -- Fixed in rev 1.9 of fptools/libraries/base/cbits/runProcess.c -- This test doesn't work in GHCi, because FD 0 gets re-allocated to -- the IO manager pipe, which isn't set to non-blocking mode, and the -- interactive prompt ends up blocking on a read f...
DavidAlphaFox/ghc
libraries/process/tests/process003.hs
bsd-3-clause
961
0
12
174
203
99
104
15
1
{-# LANGUAGE CPP, BangPatterns, NondecreasingIndentation, ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} -- NB: we specifically ignore deprecations. GHC 7.6 marks the .QSem module as -- deprecated, although it became un-deprecated later. As a result, using 7.6 -- as your bootstrap compiler ...
rahulmutt/ghcvm
compiler/Eta/Main/GhcMake.hs
bsd-3-clause
96,167
0
35
30,280
15,718
8,035
7,683
-1
-1
-- | PCP instances of very special form module PCP.Form where import PCP.Type form :: String -> PCP Char form w = [(w, "0"), ("0","1"), ("1", w)] -- | use additional letter w, -- only increasing rules iform :: String -> PCP Char iform w = [ (w, "0"), ("0","1"), ("1", "w"), ("w", "0") ] -- | only increasing rules d...
Erdwolf/autotool-bonn
src/PCP/Form.hs
gpl-2.0
580
0
16
149
269
154
115
14
2
module Main where import Control.Monad import Database.HDBC import Database.HDBC.MySQL connectDatabase :: IO Connection connectDatabase = connectMySQL defaultMySQLConnectInfo { mysqlHost = "putterwell" } go :: IO () go = do conn <- connectDatabase putStrLn $ "driver " ++ ...
beastaugh/hdbc-mysql
Test.hs
lgpl-2.1
1,098
0
15
340
311
155
156
22
1
{- This is the code extracted from "A reflection on types", by Simon PJ, Stephanie Weirich, Richard Eisenberg, and Dimitrios Vytiniotis, 2016. -} -- NB: it includes a negative-recursive function (see delta1), and -- so will give "simplifier ticks exhausted", at least with -O {-# LANGUAGE RankNTypes, PolyKinds, TypeO...
sdiehl/ghc
testsuite/tests/dependent/should_compile/dynamic-paper.hs
bsd-3-clause
10,379
0
15
2,695
3,304
1,728
1,576
-1
-1
where foo :: Monad m => Functor m => MonadIO m -> Int foo x = x
ruchee/vimrc
vimfiles/bundle/vim-haskell/tests/indent/test016/expected.hs
mit
92
4
5
44
35
17
18
-1
-1
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE CPP #-} module Yesod.Core.Dispatch ( -- * Quasi-quoted routing parseRoutes , parseRoutesNoCheck , parseRoutesFile ...
urbanslug/yesod
yesod-core/Yesod/Core/Dispatch.hs
mit
7,633
0
19
1,863
1,415
800
615
158
3
-- | Wrapper around Data.Graph with support for edge labels {-# LANGUAGE ScopedTypeVariables #-} module Distribution.Client.Utils.LabeledGraph ( -- * Graphs Graph , Vertex -- ** Building graphs , graphFromEdges , graphFromEdges' , buildG , transposeG -- ** Graph properties , vertices , edg...
Helkafen/cabal
cabal-install/Distribution/Client/Utils/LabeledGraph.hs
bsd-3-clause
3,641
0
15
918
1,082
615
467
66
3