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
<?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="az-AZ"> <title>Encode/Decode/Hash Add-on</title> <maps> <homeID>encoder</homeID> <mapre...
kingthorin/zap-extensions
addOns/encoder/src/main/javahelp/org/zaproxy/addon/encoder/resources/help_az_AZ/helpset_az_AZ.hs
apache-2.0
974
77
69
156
419
212
207
-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="it-IT"> <title>Common Library</title> <maps> <homeID>commonlib</homeID> <mapref locatio...
thc202/zap-extensions
addOns/commonlib/src/main/javahelp/help_it_IT/helpset_it_IT.hs
apache-2.0
965
77
66
156
407
206
201
-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="hi-IN"> <title>SVN Digger Files</title> <maps> <homeID>svndigger</homeID> <mapref locat...
thc202/zap-extensions
addOns/svndigger/src/main/javahelp/help_hi_IN/helpset_hi_IN.hs
apache-2.0
967
77
66
157
409
207
202
-1
-1
--- This uses PrettyM, rather than Pretty, as its starting point. module OldPrettyPrint(module PrettyM,module OldPrettyPrint) where import PrettyM import Ratio -- class Printable is defined in PrettyM -- A class to make it easier to print Haskell infix operators correctly: class Printable a => PrintableOp a where ...
forste/haReFork
tools/base/pretty/OldPrettyPrint.hs
bsd-3-clause
2,790
2
9
636
962
520
442
-1
-1
{-# LANGUAGE QuantifiedConstraints, PolyKinds, ScopedTypeVariables , StandaloneDeriving, RoleAnnotations, TypeApplications , UndecidableInstances, InstanceSigs , GeneralizedNewtypeDeriving #-} module T9123a where import Data.Coerce class MyMonad m where join :: m (m a) -> m a newt...
sdiehl/ghc
testsuite/tests/quantified-constraints/T9123a.hs
bsd-3-clause
1,047
0
12
284
302
161
141
-1
-1
{-# LANGUAGE TypeFamilies #-} module OverloadedRecFldsFail10_A where data family F a data instance F Int = MkFInt { foo :: Int }
ezyang/ghc
testsuite/tests/overloadedrecflds/should_fail/OverloadedRecFldsFail10_A.hs
bsd-3-clause
130
0
8
23
30
19
11
4
0
{-# LANGUAGE OverloadedStrings #-} module LR where import Control.Monad.Identity import Control.Monad.Writer -- import Data.Tree import Data.List (intersperse) import Text.LaTeX import Text.LaTeX.Base.Syntax (LaTeX(TeXRaw,TeXEnv), TeXArg(FixArg,OptArg)) import Text.LaTeX.Base.Class (LaTeXC, fromLaTeX, liftL) import T...
romildo/gsynt
src/LRconstruction.hs
isc
7,593
0
23
2,461
3,565
1,947
1,618
199
6
{-# LANGUAGE OverloadedStrings #-} import qualified Data.ByteString as B import qualified Data.ByteString.Char8 as C import qualified Data.ByteString.Lazy as L import System.Environment (getArgs) import qualified Data.Enumerator as E import qualified Data.Enumerator.Binary as EB import Text.XML.Ex...
f-me/xlsx-parser
temp/hexpat.hs
mit
882
0
11
182
276
151
125
23
1
{- Copyright (c) 2015 Nils 'bash0r' Jonsson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distr...
project-horizon/framework
src/lib/Language/JavaScript/DSL/Operators/Comparison.hs
mit
5,096
0
8
1,193
1,341
737
604
58
1
module Dusky.Locality where type Latitude = Float type Longitude = Float type Radius = Int type Point = (Int, Int) data RegionShape = Rectangle Point Point | Circle Point Radius deriving (Show, Eq) seattleCoords :: (Latitude, Longitude) seattleCoords = (47.6097, -122.3331) seattleArea...
cmwilhelm/dusky
src/Dusky/Locality.hs
mit
2,709
0
11
654
838
471
367
62
1
module CPS.DiffList where type DiffList a = [a] -> [a] abs :: DiffList a -> [a] abs a = a [] rep :: [a] -> DiffList a rep = (++) (+++) :: DiffList a -> DiffList a -> DiffList a (+++) = (.)
atzeus/reflectionwithoutremorse
CPS/DiffList.hs
mit
194
0
7
48
106
61
45
8
1
------------------------------------------------------------------------------- -- | -- Module : System.Hardware.Arduino.SamplePrograms.Pulse -- Copyright : (c) Levent Erkok -- License : BSD3 -- Maintainer : erkokl@gmail.com -- Stability : experimental -- -- Demonstrates 'pulseIn_hostTiming' and 'pul...
aufheben/lambda-arduino
packages/hArduino-0.9/System/Hardware/Arduino/SamplePrograms/Pulse.hs
mit
2,911
0
16
612
323
175
148
26
2
{- Copyright (c) 2008-2015 the Urho3D project. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publis...
Teaspot-Studio/Urho3D-Haskell
app/sample02/Main.hs
mit
8,830
0
12
1,540
1,685
772
913
-1
-1
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Handler.RemoteAccessSpec (spec) where import TestImport spec :: Spec spec = withApp $ do describe "getComputerApiJsonR" $ it "returns 501 Not Implemented" $ do get ComputerApiJsonR statusIs 501...
cliffano/swaggy-jenkins
clients/haskell-yesod/generated/test/Handler/RemoteAccessSpec.hs
mit
3,384
0
12
1,085
670
269
401
86
1
module LambdaWithSynonymsSpec (spec) where import Data.Either () import Test.Hspec import LambdaWithSynonyms import Lambda (Expr(..)) import Data.Map as Map spec :: Spec spec = describe "LambdaWithSynonyms" $ do describe "Expr' show" $ do it "should show var...
hughfdjackson/abattoir
test/LambdaWithSynonymsSpec.hs
mit
1,544
0
23
399
569
285
284
32
1
-- Handles all `-L` operations {- Copyright 2012, 2013, 2014 Colin Woodbury <colingw@gmail.com> This file is part of Aura. Aura 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 of the License, ...
vigoos/Farrago-OS
aura-master/aura-master/src/Aura/Commands/L.hs
gpl-2.0
2,599
0
15
609
584
310
274
42
1
-- -*- mode: haskell -*- {-# LANGUAGE TemplateHaskell #-} module Control.Gruppe.Typ where import Control.Types import Autolib.Reader import Autolib.ToDoc import Data.Typeable -- | das sollte exactly das sein, was auch in DB-tabelle steht data Gruppe = Gruppe { gnr :: GNr , vnr :: VNr , name ...
florianpilz/autotool
src/Control/Gruppe/Typ.hs
gpl-2.0
472
2
9
123
101
62
39
14
0
{-# LANGUAGE DeriveDataTypeable, FlexibleInstances #-} module ArrayBonn.Value where import qualified ArrayBonn.Environment as E import Autolib.TES.Identifier import Autolib.Reader import Autolib.ToDoc import Autolib.Util.Zufall import Data.List ( nub ) import Data.Typeable -- | multidimensional array data Value =...
Erdwolf/autotool-bonn
src/ArrayBonn/Value.hs
gpl-2.0
3,275
26
18
1,041
1,225
628
597
104
3
import H2V_Compat concatTest :: Int -> Int -> [Int] concatTest a b = [a .. a + 3] ++ [b .. b + 3] concatTest2 :: Int -> [Int] concatTest2 a = [0, 1] ++ [2, 3] ++ [4, 5] rangeTest :: Int -> Int -> [Int] rangeTest m n = [m,m+2 .. n] basicTest :: Int -> [Int] basicTest x = [1, x, 2] consTest1 :: Int -> [Int] consTes...
rdnetto/H2V
H2V/tests/lists.hs
gpl-2.0
450
0
7
108
270
153
117
15
1
module Chap05.Data.SplayHeap where import Chap03.Data.Heap (Heap(..), arbHeap) import Data.Foldable import Prelude hiding (foldr) import Control.Applicative (liftA2, liftA3, pure) import Test.QuickCheck (Arbitrary(..), sized, choose) data SplayHeap a = E | T (SplayHeap a) a (SplayHeap a) ...
stappit/okasaki-pfds
src/Chap05/Data/SplayHeap.hs
gpl-3.0
2,147
0
13
793
1,064
537
527
53
5
import Data.Char twoDigits2Int :: Char -> Char -> Int twoDigits2Int x y = if isDigit x && isDigit y then digitToInt x * 10 + digitToInt y else 100
devtype-blogspot-com/Haskell-Examples
TwoDigits2Int/TwoDigits2Int.hs
gpl-3.0
146
0
8
28
61
30
31
3
2
module DL3033 (tests) where import Helpers import Test.Hspec tests :: SpecWith () tests = do let ?rulesConfig = mempty describe "DL3033 - Specify version with `yum install -y <package>-<version>`" $ do it "not ok wihout yum version pinning" $ do ruleCatches "DL3033" "RUN yum install -y tomcat && yum cl...
lukasmartinelli/hadolint
test/DL3033.hs
gpl-3.0
764
0
13
165
119
53
66
-1
-1
{- This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. - If a copy of the MPL was not distributed with this file, - You can obtain one at http://mozilla.org/MPL/2.0/. -} module Sublist ( Sublist, -- this is the type, not the data constructor sCo...
Zimmi48/gps-bank-data-analysis
Sublist.hs
mpl-2.0
4,793
0
13
1,693
1,335
687
648
89
3
-- "Dao/Predicate.hs" provides 'PredicateT' which combines the Maybe and -- Either types into a single monad. -- -- Copyright (C) 2008-2015 Ramin Honary. -- -- Dao 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 -- Foun...
printedheart/Dao
src/Dao/Predicate.hs
agpl-3.0
19,022
0
17
3,791
3,915
2,059
1,856
-1
-1
import System.Plugins import API -- an example where we just want to load an object and run it main = do m_v <- load_ "../Null.o" ["../api",".."] "resource" t <- load_ "../Dep.o" ["../api"] "resource" case m_v of LoadFailure err -> error (unlines err) LoadSuccess m v -> do print $ a...
Changaco/haskell-plugins
testsuite/unloadAll/null/prog/Main.hs
lgpl-2.1
514
0
13
143
159
74
85
11
3
module Hastistics.Data.CSV where import Hastistics import Hastistics.Fields() import Hastistics.Types import Text.ParserCombinators.Parsec {-| Represents file that consists of a list of rows -} type CSV = [Record] {-| Represents row that consists of a list of fields -} type Record = [Field] {-| Represents field tha...
fluescher/hastistics
src/Hastistics/Data/CSV.hs
lgpl-3.0
2,765
0
11
688
618
323
295
50
1
{-# OPTIONS_GHC -O2 -optc-O3 #-} import Data.List import Control.Monad import Data.Ord (comparing) import System.Random (randomRIO) import qualified Data.Map.Strict as M import Control.Monad.State import Debug.Trace import Text.Printf (printf) import Data.Time data Move = LEFT | RIGHT | UP | DOWN deriving (Eq, Show, ...
scturtle/2048AI
2048st.hs
unlicense
7,227
0
19
3,231
2,333
1,197
1,136
143
5
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {- Copyright 2019 The CodeWorld Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http...
alphalambda/codeworld
codeworld-compiler/src/CodeWorld/Compile/Requirements/LegacyLanguage.hs
apache-2.0
4,186
0
11
864
920
458
462
106
1
module ContentTypes where import Yesod.Content import Prelude ctypeDic :: [(String, ContentType)] ctypeDic = [(".xhtml", typeHtml) ,(".html", typeHtml) ,(".htm", typeHtml) ,(".json", typeJson) ,(".xml", typeXml) ,(".atom", typeAtom) ,(".rss", typeRss) ...
konn/gitolist
ContentTypes.hs
bsd-2-clause
1,050
0
8
266
310
188
122
33
1
{- | These positions restrict moves and queries to only valid positions, which helps to keep the interface cleaner. Coordinates can be used but it is up to the client to create a position out of them via coordToPos before they can modify the board. Board is layed out as such (showing starting pieces as a reference): ...
benkolera/haskell-chess
src/ChessBoard/Position.hs
bsd-2-clause
2,597
0
8
907
616
343
273
56
17
-------------------------------------------------------------------- -- | -- Module : Web.Campfire.Monad -- Description : Monadic interface for communcating with the Campfire API -- Copyright : (c) Michael Xavier 2011 -- License : MIT -- -- Maintainer: Michael Xavier <michael@michaelxavier.net> -- Stability ...
MichaelXavier/Campfire
Web/Campfire/Monad.hs
bsd-2-clause
1,120
0
9
216
101
69
32
8
0
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverlappingInstances #-} {-# LANGUAGE RankNTypes #-} {-| A Collection of utilities for binary packing values into Bytestring |-} module Database.Cassandra.Pack ( CasType (..) , TAscii (.....
Soostone/cassy
src/Database/Cassandra/Pack.hs
bsd-3-clause
14,284
0
12
3,120
3,064
1,687
1,377
234
1
-- hisg - IRC stats generator. -- -- Copyright (c) 2009-2011 Antoine Kalmbach <antoine dot kalmbach at jyu dot fi> -- 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 s...
ane/hisg
src/Hisg/IRCLog.hs
bsd-3-clause
1,447
0
8
266
141
93
48
14
1
{-# LANGUAGE OverloadedStrings #-} module IptAdmin.ShowPage where import Control.Monad.Error import Control.Monad.State import Data.IORef import Data.Map hiding (filter) import Happstack.Server.SimpleHTTP import IptAdmin.Render import IptAdmin.ShowPage.Render import IptAdmin.System import IptAdmin.Template import Ipt...
etarasov/iptadmin
src/IptAdmin/ShowPage.hs
bsd-3-clause
8,868
0
22
2,613
2,470
1,228
1,242
176
11
-- | -- Module : Data.ASN1.BinaryEncoding.Parse -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : unknown -- -- Generic parsing facility for ASN1. -- module Data.ASN1.BinaryEncoding.Parse ( -- * incremental parsing interfaces ...
mboes/hs-asn1
encoding/Data/ASN1/BinaryEncoding/Parse.hs
bsd-3-clause
8,040
0
22
2,960
1,855
984
871
108
14
module Data.Char.Properties.Derivation where { import Data.Char.Properties.GeneralCategory; import Data.Char.Properties.MiscData; -- | Combining Grapheme Joiner character. ; isCGJ :: Char -> Bool; isCGJ '\x034F' = True; isCGJ _ = False; -...
seereason/unicode-properties
Data/Char/Properties/Derivation.hs
bsd-3-clause
6,173
10
11
2,664
869
496
373
77
11
{-# LANGUAGE ScopedTypeVariables, UnboxedTuples #-} module Data.TrieMap.TrieKey.Projection.Tests (tests) where import Data.TrieMap.Sized import Data.TrieMap.TrieKey import qualified Data.Map as M import Data.TrieMap.TrieKey.Tests.Utils import Test.QuickCheck testMapMaybe :: forall k . (TrieKey k, Arbitrary k, Show k...
lowasser/TrieMap
Data/TrieMap/TrieKey/Projection/Tests.hs
bsd-3-clause
957
0
16
167
379
208
171
16
2
module Map where import Player type Map = [[Tile]] data Tile = EmptyTile | PlayerTile Player deriving (Show) newMap :: Player -> Player -> Map newMap host guest = [ playerRow guest , emptyRow , emptyRow , emptyRow , playerRow host ] where playerRow p = [EmptyTile, EmptyTile, PlayerTile p, EmptyTi...
aspidites/functional
src/Map.hs
bsd-3-clause
373
0
8
85
120
69
51
13
1
module Main where import AnimatedDangerzone.Types import AnimatedDangerzone.Client.Config import Control.Concurrent import Control.Exception import Control.Lens import Control.Monad import Graphics.Vty import Network import NetworkedGame.Packet import System.Environment import System.Exit import System.IO data GameEv...
glguy/animated-dangerzone
src/Client.hs
bsd-3-clause
2,140
10
22
656
680
319
361
-1
-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. {-# LANGUAGE GADTs #-} module Duckling.Rules.LO ( defaultRules , langRules , localeRules ) where impor...
facebookincubator/duckling
Duckling/Rules/LO.hs
bsd-3-clause
1,244
0
9
196
408
216
192
31
1
module Storage.Db where import Database.SQLite (openConnection,closeConnection,SQLiteHandle,defineTable) import qualified Control.Exception as E -- Connection ------------------------------------------------------------------ -- | Run a computation in the context of a connection to the database. withStorage :: File...
elliottt/din
src/Storage/Db.hs
bsd-3-clause
426
0
9
50
82
47
35
5
1
module WeaponsSpec(spec) where import Test.Hspec import Test.QuickCheck import Data.List((\\)) import GameModes import Weapons newtype Input = Input { toStr :: String } deriving Show instance Arbitrary Input where arbitrary = do i <- choose (0, 50) return . Input . show $ (i :: Int) type IsValidInput = ...
joelchelliah/rock-paper-scissors-hs
test/WeaponsSpec.hs
bsd-3-clause
5,165
0
19
1,420
1,209
614
595
-1
-1
-- 15. PKCS#7 padding validation -- -- Write a function that takes a plaintext, determines if it has valid -- PKCS#7 padding, and strips the padding off. -- -- The string: -- -- "ICE ICE BABY\x04\x04\x04\x04" -- -- has valid padding, and produces the result "ICE ICE BABY". -- -- The string: -- -- "ICE ICE BABY\...
carletes/matasano
src/problem-15.hs
bsd-3-clause
730
0
11
139
75
52
23
5
1
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} module Corn.ODBC.Oracle ( runOracle , Oracle(..) , MonadOracle , query , query' ) where import ...
leptonyu/mint
corn-odbc/src/Corn/ODBC/Oracle.hs
bsd-3-clause
1,353
0
12
349
406
220
186
42
1
-------------------------------------------------------------------- -- | -- Module : Network.Delicious.User -- Copyright : (c) Galois, Inc. 2008 -- License : BSD3 -- -- Maintainer : Sigbjorn Finne <sigbjorn.finne@gmail.com> -- Stability : provisional -- Portability : portable -- -- Accessing a user's tag...
sof/delicious
Network/Delicious/User.hs
bsd-3-clause
7,776
0
18
2,137
2,721
1,358
1,363
190
6
{-# LANGUAGE StandaloneDeriving, DeriveGeneric #-} module SizedSeq ( SizedSeq(..) , emptySS , addToSS , addListToSS , ssElts , sizeSS ) where import Data.Binary import Data.List import GHC.Generics data SizedSeq a = SizedSeq !Word [a] deriving (Generic, Show) instance Functor SizedSeq where fmap f ...
gridaphobe/ghc
libraries/ghci/SizedSeq.hs
bsd-3-clause
809
0
8
164
333
173
160
29
1
{-# LANGUAGE OverloadedStrings #-} module TestECMWithTestSequenceCommon ( someEventsOnly, numberEventsOnly, pattern', pattern'', pattern''', pattern'''', testLookups, printOutEvents, printOutFailedPattern ) where import qualified Caching.ExpiringCacheMap.Utils.TestSequence as TestS...
elblake/expiring-cache-map
tests/TestECMWithTestSequenceCommon.hs
bsd-3-clause
3,234
0
15
786
1,009
497
512
102
5
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module Output.AMQP where import Control.Concurrent.STM (atomically) import Control.Concurrent.STM.TBQueue (TBQueue, newTBQueueIO, writeTBQueue) import Control.Concurrent (forkIO) import Control.Monad.IO.Class (MonadIO(liftIO)) import ...
r-p1e/negotians
src/Output/AMQP.hs
bsd-3-clause
1,151
0
15
311
291
160
131
34
1
----------------------------------------------------------- -- | -- Module : PrimQuery -- Copyright : Daan Leijen (c) 1999, daan@cs.uu.nl -- HWT Group (c) 2003, haskelldb-users@lists.sourceforge.net -- License : BSD-style -- -- Maintainer : haskelldb-users@lists.sourceforge.net -- Stabil...
chrisdone/haskelldb-demo
lib/haskelldb/src/Database/HaskellDB/PrimQuery.hs
bsd-3-clause
9,590
54
15
3,341
2,604
1,445
1,159
186
10
{-# LANGUAGE TemplateHaskell, QuasiQuotes, ViewPatterns, ScopedTypeVariables, TupleSections #-} module Language.Quasi.Ast.TH ( -- * Template Haskell AST Quoters -- $quoters e', p', t', d', cxt' -- * Template Haskell AST Quoters with convenience splices -- $quoters2 , ec, pc, tc, dc, cxtc ) where i...
mgsloan/quasi-extras
src/Language/Quasi/Ast/TH.hs
bsd-3-clause
4,930
0
21
1,413
1,399
777
622
94
5
{-# LANGUAGE MultiWayIf #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE RankNTypes #-} module Login ( interactiveGatherCredentials ) where import Prelude () import Prelude.MH import Brick import Brick.Focus import Brick.Forms import Brick.Widgets.Borde...
aisamanra/matterhorn
src/Login.hs
bsd-3-clause
5,349
0
17
1,602
1,478
772
706
128
4
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} -- | Main stack tool entry point. module Main where import...
mathhun/stack
src/main/Main.hs
bsd-3-clause
46,622
0
30
17,896
8,942
4,536
4,406
-1
-1
class ClassA a where duplicate :: a -> a class ClassB b where duplicate :: b -> b
roberth/uu-helium
test/typeClassesStatic/FunctionInMultipleClasses.hs
gpl-3.0
93
0
7
29
37
18
19
4
0
-- | This module provides an implementation of a trie for topic -- filters. Besides usual for trie operations it provides a function -- for matching a single topic against a trie of filters returning all -- results. module Data.TopicFilterTrie ( TopicFilterTrie , empty , insert , member , lookup , lookupWit...
rasendubi/arachne
src/Data/TopicFilterTrie.hs
bsd-3-clause
3,258
0
18
726
857
457
400
56
4
{-# LANGUAGE CPP, TupleSections #-} {-# OPTIONS_GHC -fno-cse #-} -- -fno-cse is needed for GLOBAL_VAR's to behave properly ----------------------------------------------------------------------------- -- -- Static flags -- -- Static flags can only be set once, on the command-line. Inside GHC, -- each static flag corr...
rahulmutt/ghcvm
compiler/Eta/Main/StaticFlags.hs
bsd-3-clause
8,581
0
13
1,950
1,097
624
473
-1
-1
{-# LANGUAGE CPP #-} -- | Read and write JSMods. module Haste.Module (moduleFilePath, writeModule, readModule) where import Module (moduleNameSlashes, mkModuleName) import qualified Data.ByteString.Lazy as B import Control.Shell import Control.Applicative import Haste.AST import Data.Binary import Data.List (isSuffixOf...
kranich/haste-compiler
src/Haste/Module.hs
bsd-3-clause
5,475
0
20
1,520
1,281
657
624
94
5
module Language.Brainfuck.Brainfuck where import Prelude () import Language.Brainfuck.Internals.GenericParser program :: GenericParser program = genparser Symbols { incr = "+", decr = "-", right = ">", left = "<", read = ",", print = ".", openl = "[", closel ...
remusao/Hodor
src/Language/Brainfuck/Brainfuck.hs
bsd-3-clause
356
0
7
110
89
58
31
14
1
module Main where import Csound.Base instr :: (D, D) -> SE Sig instr (amp, cps) = return $ (sig amp) * fades 0.01 0.1 * osc (sig cps) main = writeCsd "message.csd" $ trigByName "osc" instr
silky/csound-expression
examples/Api/Message.hs
bsd-3-clause
192
0
9
39
90
47
43
5
1
{-# LANGUAGE GADTs #-} module HN.Optimizer.ArgumentDeleter (runF) where import Compiler.Hoopl import Safe.Exact import HN.Optimizer.ArgumentValues import HN.Optimizer.ExpressionRewriter import HN.Optimizer.Node import HN.Optimizer.Pass import HN.Optimizer.Utils cp :: DefinitionNode -> AFType -> Maybe DefinitionNode ...
kayuri/HNC
HN/Optimizer/ArgumentDeleter.hs
lgpl-3.0
989
6
11
162
355
190
165
25
2
{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Main (main) where import Test.Framework (Test, defaultMain, testGroup) import Test.Framework.Providers.QuickCheck2 (testProperty) import Test.Framework.Providers.HUnit (testCase) import Test.QuickCheck (Arbitrary(..)) import Control.Mon...
DmitriyHetman/gentoo
dev-haskell/base64-bytestring/files/Tests.hs
gpl-3.0
4,556
0
12
1,561
936
540
396
89
2
<?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="si-LK"> <title>ToDo-List</title> <maps> <homeID>todo</homeID> <mapref location="map.jhm...
thc202/zap-extensions
addOns/todo/src/main/javahelp/help_si_LK/helpset_si_LK.hs
apache-2.0
955
77
67
155
408
207
201
-1
-1
{- (c) The University of Glasgow 2006 (c) The AQUA Project, Glasgow University, 1993-1998 \section[TcDefaults]{Typechecking \tr{default} declarations} -} module TcDefaults ( tcDefaults ) where import HsSyn import Name import Class import TcRnMonad import TcEnv import TcHsType import TcSimplify import TcMType import ...
tjakway/ghcjvm
compiler/typecheck/TcDefaults.hs
bsd-3-clause
3,677
0
13
992
824
426
398
63
1
module FSMOpt where import FSM import GraphOps import MUtils(collectByFst,collectBySnd,mapFst,mapSnd,usort) import qualified IntMap as M import qualified IntSet as S import qualified OrdMap as OM import List(sort,partition) rmeqstate (n,NFA m) = (n',NFA (M.fromList m')) where (n',m') = repeat' rmeqstate1 (n,M.toList...
forste/haReFork
tools/base/parse2/LexerGen/FSMOpt.hs
bsd-3-clause
1,682
4
13
351
964
528
436
44
3
{-# LANGUAGE TemplateHaskell, RoleAnnotations, PolyKinds #-} module TH_Roles2 where import Language.Haskell.TH $( return [ DataD [] (mkName "T") [KindedTV (mkName "a") (VarT (mkName "k"))] Nothing [] [] , RoleAnnotD (mkName "T") [RepresentationalR] ] )
ezyang/ghc
testsuite/tests/th/TH_Roles2.hs
bsd-3-clause
279
0
15
60
92
48
44
6
0
module Graphics.Cogh.Render ( clear , swapBuffers , Texture , newTexture , drawTexture , textureSize , withColorPtr , drawRect ) where import Foreign.C import Foreign.ForeignPtr import Foreign.Marshal.Array import Foreign.Ptr import Graphics.Cogh.Color import Graphics.Cogh.Matrix import Graphics.Cogh...
ivokosir/cogh
src/Graphics/Cogh/Render.hs
mit
2,157
0
10
468
730
378
352
56
1
findPrimes :: Integral a => a -> [a] findPrimes max | max < 2 = [] | otherwise = calcPrimes [2..max] calcPrimes :: Integral a => [a] -> [a] calcPrimes [] = [] calcPrimes (x:xs) = x:(calcPrimes [a | a <- xs, a`mod`x /= 0]) --sum (findPrimes 1999999)
MakerBar/haskell-euler
10/10.hs
mit
269
0
11
68
142
73
69
7
1
-- slow, but work -- sieve solution, check http://github.com/liuyang1/test/lang/haskell codebase isPrime x = all (\i -> x `mod` i /= 0) $ takeWhile (\i -> i * i <= x) (2:[3,5..(x `div` 2)]) primes n = filter isPrime [2..n] main = do print $ sum $ primes (1000 * 1000 * 2)
liuyang1/euler
010.hs
mit
282
0
11
62
129
70
59
4
1
{-# htermination notElem :: (Eq a, Eq k) => (a, k) -> [(a, k)] -> Bool #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_notElem_12.hs
mit
75
0
2
17
3
2
1
1
0
{-# LANGUAGE CPP #-} module GHCJS.DOM.WebKitCSSRegionRule ( #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) module GHCJS.DOM.JSFFI.Generated.WebKitCSSRegionRule #else #endif ) where #if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT) import GHCJS.DOM...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/WebKitCSSRegionRule.hs
mit
370
0
5
33
33
26
7
4
0
module Main where import Data.Complex main :: IO () main = mapM_ (putStrLn . line) ys where line y = map (\z -> if z < escape && not (isNaN z) then ' ' else '#') [magnitude $ man (x :+ y) | x <- xs] man = mandelbrot iters (seed :+ 0) iters = 50 seed = 0.0099 escape = 2 bresx = 50 bresy =...
Kludgy/mandeltoy-hs
mandeltoy.hs
mit
736
0
14
208
346
183
163
20
2
import Roogle import System.Environment(getArgs) rstrip :: String -> String rstrip = reverse . dropWhile (=='\n') . reverse main :: IO () main = do args <- getArgs doc <- readFile $ head args putStrLn (rstrip $ unlines $ extractTypeSignatures typeSignaturePattern1 $ lines doc)
Azabuhs/Roogle
src/Main.hs
mit
292
0
11
57
106
53
53
9
1
{-| Module : Database.Orville.PostgreSQL.Internal.Monad Copyright : Flipstone Technology Partners 2016-2018 License : MIT 'Database.Orville.PostgreSQL.ResourceT' provides 'ResourceT' instance of the Orville typeclasses for situations where you might need it. In particular, if you are using the conduit library, yo...
flipstone/orville
orville-postgresql/src/Database/Orville/PostgreSQL/ResourceT.hs
mit
2,783
0
9
384
233
140
93
-1
-1
{-# htermination (<) :: (Ord a, Ord k) => (Either a k) -> (Either a k) -> Bool #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_LT_10.hs
mit
83
0
2
19
3
2
1
1
0
{-# LANGUAGE Safe #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveFunctor #-} module FP15.Value where import GHC.Generics import Control.DeepSeq import Control.Applicative import FP15.Xtn import FP15.Disp import Text.PrettyPrint import Data.Void(Void) -- | The 'XValue' type is ...
Ming-Tang/FP15
src/FP15/Value.hs
mit
2,678
0
15
616
960
482
478
68
9
---------------------------------------------------------------- -- -- | Compilation -- Monad and combinators for quickly assembling simple -- compilers. -- -- @Control\/Compilation\/Module.hs@ -- -- State extension class and combinators for implementations -- of a state that support module name specification. ...
lapets/compilation
Control/Compilation/Module.hs
mit
1,129
0
10
182
156
89
67
16
0
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE NegativeLiterals #-} module Main where import qualified Prelude as P import Numeric.Units.Dimensional.DK.Prelude import Numeric.Units.Dimensional.DK.NonSI import Data.ByteString as B import System.RaspberryPi.GPIO import Control.Concurrent import Data.Bits import Data.Word (...
dmcclean/yellow
src/Main.hs
mit
3,271
0
10
904
1,002
518
484
90
1
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.SVGFEMorphologyElement (js_setRadius, setRadius, pattern SVG_MORPHOLOGY_OPERATOR_UNKNOWN, pattern SVG_MORPHOLOGY_OPERATOR_ERODE, pattern SVG_MORPHOLOGY_OPERATOR_DILATE, js_getIn1, getIn1, ...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/SVGFEMorphologyElement.hs
mit
3,816
34
11
577
801
459
342
65
1
{-# LANGUAGE BangPatterns #-} module BangPatterns where firstnonspace :: Ptr Word8 -> Int -> Int -> IO Int firstnonspace !ptr !n !m | n >= m = return n | otherwise = do w <- peekElemOff ptr n if isSpaceWord8 w then firstnonspace ptr (n+1) m else return n
Pnom/haskell-ast-pretty
Test/examples/BangPatterns.hs
mit
288
0
11
82
108
50
58
7
2
{-# LANGUAGE QuasiQuotes, NoMonomorphismRestriction #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} module Commands.Spiros.Templates where import Commands.Extra (displayAddress) import Text.InterpolatedString.Perl6 curl_ExampleRequest address = [qq|curl -X POST -H "Content-Type: applicat...
sboosali/commands-spiros
config/Commands/Spiros/Templates.hs
gpl-2.0
457
0
5
59
37
25
12
6
1
module DB3 where --import Context --import Query import System.Process (callCommand) import Data.Char (isUpper) import Data.Time (getCurrentTime,diffUTCTime) import Control.Exception.Base (evaluate) ------------------------------------------------------ -- Sample complex program: graph matching, query and transfor...
thiry/DComp
src/DB3.hs
gpl-2.0
3,843
0
18
755
1,163
698
465
47
4
{-# OPTIONS_GHC -fno-warn-type-defaults #-} import Control.Monad (unless) import System.Exit (exitFailure) import Test.HUnit ( (~:) , (~=?) , Counts (failures, errors) , Test (TestList) , runTestTT ) import LeapYear (isLeapYear) main :: IO () main = do counts <- runTestTT isLeap...
munyari/programming-problems
exercism.io/haskell/leap/test/Tests.hs
gpl-2.0
968
0
12
307
258
154
104
24
1
-- Adapted from a NeHe OpenGL tutorial -- -- This code was created by Jeff Molofee '99 (ported to Haskell GHC 2005) -- module Main where import qualified Graphics.UI.GLFW as GLFW -- everything from here starts with gl or GL import Graphics.Rendering.OpenGL.Raw import Graphics.Rendering.GLU.Raw ( gluPerspective ) impo...
TomHammersley/HaskellRenderer
app/src/Tests/RandomUVTest/RandomUVTest.hs
gpl-2.0
3,751
0
11
944
808
416
392
77
1
import System.Environment type Outline = [(Int, Int)] splitBy :: Char -> String -> [String] splitBy c s = case dropWhile (== c) s of "" -> [] s' -> w : splitBy c s'' where (w, s'') = break (== c) s' mergeOutlines' :: Int -> Int -> Outline -> Outline -> Outline mergeOutlines' _ _ [] o2...
cryptica/CodeEval
Challenges/120_Skyscrapers/main.hs
gpl-3.0
1,542
0
11
374
641
345
296
39
6
{-# LANGUAGE GADTs #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE UndecidableInstances #-} {-# LANG...
rnhmjoj/interlude
src/Data/Function.hs
gpl-3.0
1,149
0
8
339
83
54
29
29
1
{-# LANGUAGE FlexibleInstances #-} {-| Module : Database/Hedsql/Statements/Query.hs Description : Collection of SELECT queries. Copyright : (c) Leonard Monnier, 2014 License : GPL-3 Maintainer : leonard.monnier@gmail.com Stability : experimental Portability : portable A collection of SELECT queries to be...
momomimachli/Hedsql
tests/Database/Hedsql/Statements/Select.hs
gpl-3.0
26,033
0
15
6,230
5,484
2,971
2,513
-1
-1
module Pudding.Observables.Energy ( energy ) where import Data.Complex (Complex) import Pudding.Observables.SimpleObservable import Pudding.Types.Configuration (spinors) import Pudding.Types.PolarAngles (SpinorCoordinates, spinorProduct) import Pudding.Utilities.ComplexFunctions (cabs) import Pudding.Utilities.VectorF...
jfulseca/Pudding
src/Pudding/Observables/Energy.hs
gpl-3.0
592
0
11
69
173
99
74
13
1
{-| Module : Devel.Build Description : Attempts to compile the WAI application. Copyright : (c) License : GPL-3 Maintainer : njagi@urbanslug.com Stability : experimental Portability : POSIX compile compiles the app to give: Either a list of source errors or an ide-backend session. -} {-# LANGUAGE Packag...
bitemyapp/wai-devel
src/Devel/Compile.hs
gpl-3.0
3,982
0
17
1,004
801
410
391
61
4
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-admin-directory/gen/Network/Google/Resource/Directory/Domains/Get.hs
mpl-2.0
3,103
0
15
747
388
233
155
63
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/CloneStack.hs
mpl-2.0
19,160
0
10
3,936
1,975
1,196
779
194
1
module BoTox.Commands where import BoTox.Types import qualified Data.ByteString.Char8 as BS import Network.Tox.C runCommand :: ToxState -> Config -> Command -> IO () runCommand tox _cfg (CmdSelfSetStatus status) = do _ <- toxSelfSetStatus tox status return () ...
gordon-quad/botox
src/BoTox/Commands.hs
agpl-3.0
2,251
0
10
424
772
357
415
53
1
module Main where import qualified System.Gnome.VFS as VFS import Control.Exception ( handleJust ) import Control.Monad ( when , liftM ) import Data.Maybe ( fromMaybe ) import Text.Printf ( printf ) import System.IO import System.Exit import System.Environment handleVFSError ...
thiagoarrais/gtk2hs
demo/gnomevfs/TestXfer.hs
lgpl-2.1
3,412
0
15
1,192
716
336
380
69
3
{-| -} module Sample ( simpleSample ) where import Camera (Camera, NDC (NDC), cameraProjection) import Raster (Color, Raster, avgColor, black, fromRowMajorPixelList) import Scene (SceneObject, SimpleShader, soShade) -- | Samples a scene uniformly and produces a raster. simpleSample :: SimpleShader -- ^ defau...
lancelet/approxier
src/lib/Sample.hs
apache-2.0
2,637
0
14
816
704
395
309
47
1
module Index ( InMemoryIndex , empty , addTerm , wildcard , Index.lookup ) where import Control.Monad (forM) import Data.List (foldl1') import qualified Data.Map.Strict as M import qualified Data.Text as T import qualified Postings as PS import qualified Trie as TR ...
jagg/search
src/Index.hs
apache-2.0
2,275
0
12
1,032
590
311
279
42
3
-- | Miscellaneous general functions and Show, Eq, and Ord instances for PortID {-# LANGUAGE FlexibleInstances, UndecidableInstances, StandaloneDeriving #-} {-# LANGUAGE CPP #-} -- PortID instances {-# OPTIONS_GHC -fno-warn-orphans #-} module Database.MongoDB.Internal.Util where import Control.Applicative ((<$>)) im...
selectel/mongoDB-haskell
Database/MongoDB/Internal/Util.hs
apache-2.0
4,851
0
14
1,009
1,744
936
808
84
5
-- | A word frequency count using the different string types -- -- Tested in this benchmark: -- -- * Splitting into words -- -- * Converting to lowercase -- -- * Comparing: Eq/Ord instances -- module Benchmarks.WordFrequencies ( initEnv , benchmark ) where import Test.Tasty.Bench (Benchmark, bench, bgroup,...
bos/text
benchmarks/haskell/Benchmarks/WordFrequencies.hs
bsd-2-clause
1,153
0
12
268
379
213
166
26
1
module Handler.List where import Import import qualified Data.Text as T import Data.Maybe (listToMaybe) import Control.Arrow ((***)) import Data.List (last) paginateSelect :: (PersistEntity val, PersistQuery (PersistEntityBackend val) m) => Int -- How many items in a page -> Int -- Which page we're looking at...
MasseR/introitu
Handler/List.hs
bsd-2-clause
1,370
0
13
278
467
241
226
-1
-1
import qualified Data.Map as Map phoneBook = [("betty", "555-2938") ,("bonnie", "453-2989") ,("wendy", "200-9090") ,("bonnie", "450-2989") ] -- wired style findKey :: (Eq k) => k -> [(k, v)] -> v findKey key xs = snd . head . filter (\(k, v) -> key == k) $ xs -- snd (3, 4) => 4 -- Function co...
sharkspeed/dororis
languages/haskell/LYHGG/7-modules/2-play-with-map.hs
bsd-2-clause
1,904
0
10
441
629
368
261
34
2
{-# LANGUAGE GADTs, FlexibleInstances, TypeSynonymInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_HADDOCK hide #-} -- | -- Module : Data.Array.Accelerate.Pretty -- Copyright : [2008..2011] Manuel M T Chakravarty, Gabriele Keller, Sean Lee -- [2009..2012] Manuel M T Chakravarty, Gabr...
robeverest/accelerate
Data/Array/Accelerate/Pretty.hs
bsd-3-clause
1,253
0
7
231
230
131
99
18
1
-- Copyright 2021 Google LLC -- -- Use of this source code is governed by a BSD-style -- license that can be found in the LICENSE file or at -- https://developers.google.com/open-source/licenses/bsd {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LAN...
google-research/dex-lang
src/lib/Builder.hs
bsd-3-clause
53,103
0
25
12,424
21,307
10,447
10,860
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Applicative import Web.Scotty import RandomHandler import GetInfo (getPortNum) import qualified Data.ByteString.Lazy as B import Control.Monad.IO.Class (liftIO) import System.IO (FilePath,readFile) import Network.Wai.Middleware.Cors -- define static...
JKiely/Totes-Random
src/Main.hs
bsd-3-clause
1,344
0
13
331
320
160
160
40
1