code
stringlengths
2
1.05M
repo_name
stringlengths
5
101
path
stringlengths
4
991
language
stringclasses
3 values
license
stringclasses
5 values
size
int64
2
1.05M
{-# LANGUAGE OverloadedStrings #-} module Network.XMPP.Auth where import Network.XMPP.XMLParse import Network.XMPP.XMPPMonad import Network.XMPP.Stanzas import Data.Text (Text) -- |Non-SASL authentication, following XEP-0078. startAuth :: Text -- ^Username (part before \@ in JID) -> Text ...
drpowell/XMPP
Network/XMPP/Auth.hs
Haskell
bsd-3-clause
1,862
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ScopedTypeVariables #-} module Language.JavaScript.SpiderMonkey.Parser where import Data.Aeson import Data.Aeson.Types import Data.Aeson.TH import Data.Int import Control.Applicative import Data.Monoid() import Control.Monad import Data....
jswebtools/mozilla-js-parser-api
src/Language/JavaScript/SpiderMonkey/Parser.hs
Haskell
bsd-3-clause
17,968
{-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_GHC -fno-warn-deprecations #-} module Test.Pos.Util.Tripping where import qualified Prelude import Universum import Data.Aeson (FromJSON, ToJSON, eitherDecode, encode) import Data.Text.Internal.Builder (fromText, toLazyText) import ...
input-output-hk/pos-haskell-prototype
util/test/Test/Pos/Util/Tripping.hs
Haskell
mit
5,502
{-# OPTIONS_GHC -funbox-strict-fields #-} {-# LANGUAGE Strict #-} {-# LANGUAGE StrictData #-} {-| Core Noun Implementation Each cell has a pre-calculated hash and a `size` field. The size is the total number of nodes under the tree of the cell. This is used as a heuristic to choose a hash-table si...
jfranklin9000/urbit
pkg/hs/urbit-king/lib/Urbit/Noun/Core.hs
Haskell
mit
4,789
{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} -- | Part of GState DB which stores data necessary for update system. module Pos.DB.Update.GState ( -- * Getters getAdoptedBV , getAdoptedBVData , getAdoptedBVFull , getBVState , getConsensusEra ...
input-output-hk/pos-haskell-prototype
db/src/Pos/DB/Update/GState.hs
Haskell
mit
13,678
{-# LANGUAGE CPP #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} -- | Auxx plugin. module Plugin ( auxxPlugin , rawExec ) where import Universum #if !(defined(mingw32_HOST_OS)) import System.Exit (ExitCode (ExitSuccess)) import Sys...
input-output-hk/pos-haskell-prototype
auxx/src/Plugin.hs
Haskell
mit
6,746
-- We need 'FlexibleInstances to instance 'ArgVal' for 'Maybe Exp' and -- '( String, Exp )'. {-# LANGUAGE FlexibleInstances #-} module Arith where import Prelude hiding ( exp ) import System.Console.CmdTheLine hiding ( eval ) import Control.Applicative hiding ( (<|>) ) import Control.Monad ( guard ) import Data...
glutamate/cmdtheline
test/Arith.hs
Haskell
mit
4,544
<?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="zh-CN"> <title>Authentication Statistics | ZAP Extension</title> <maps> <homeID>top</homeID...
veggiespam/zap-extensions
addOns/authstats/src/main/javahelp/org/zaproxy/zap/extension/authstats/resources/help_zh_CN/helpset_zh_CN.hs
Haskell
apache-2.0
987
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} -- | Test suite for Stack.Dot module Stack.DotSpec where import Control.Monad (filterM) import Data.Foldable as F import Data.Functor.Identity import Data.List ((\\)) import qualified Data.Map...
AndrewRademacher/stack
src/test/Stack/DotSpec.hs
Haskell
bsd-3-clause
5,515
import Test.HUnit (Assertion, (@=?), runTestTT, Test(..), Counts(..)) import System.Exit (ExitCode(..), exitWith) import Prime (nth) exitProperly :: IO Counts -> IO () exitProperly m = do counts <- m exitWith $ if failures counts /= 0 || errors counts /= 0 then ExitFailure 1 else ExitSuccess testCase :: String ->...
pminten/xhaskell
nth-prime/nth-prime_test.hs
Haskell
mit
751
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Simple.Program.Db -- Copyright : Isaac Jones 2006, Duncan Coutts 2007-2009 -- -- Maintainer : cabal-devel@haskell.org -- Portability : po...
DavidAlphaFox/ghc
libraries/Cabal/Cabal/Distribution/Simple/Program/Db.hs
Haskell
bsd-3-clause
17,834
<?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="id-ID"> <title>DOM XSS Aktif Memindai Aturan | ZAP Ekstensi</title> <maps> <homeID>top</home...
kingthorin/zap-extensions
addOns/domxss/src/main/javahelp/org/zaproxy/zap/extension/domxss/resources/help_id_ID/helpset_id_ID.hs
Haskell
apache-2.0
986
<?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="sr-CS"> <title>Requester</title> <maps> <homeID>requester</homeID> <mapref location="ma...
thc202/zap-extensions
addOns/requester/src/main/javahelp/help_sr_CS/helpset_sr_CS.hs
Haskell
apache-2.0
960
module SubstituteBaseStruct where import Substitute import Recursive import HasBaseStruct import BaseSyntax substE = substE' r substE' r s e0 = case mapEI id (subst s) id (esubst s) id id e0 of HsId (HsVar x) -> s x HsInfixApp e1 (HsVar x) e2 -> s x `hsApp` e1 `hsApp` e2 HsLeftSection e (HsVar x...
forste/haReFork
tools/base/transforms/SubstituteBaseStruct.hs
Haskell
bsd-3-clause
877
import Map import MapAsSet main = do let x = insert 0 "foo" . delete 1 . insert 1 undefined . insert (6 :: Int) "foo" $ empty print (member 1 x) print (keysSet x) print (toList x) print x
ghc-android/ghc
testsuite/tests/driver/sigof02/Double.hs
Haskell
bsd-3-clause
249
{- arch-tag: Tests for GZip module Copyright (C) 2004-2011 John Goerzen <jgoerzen@complete.org> All rights reserved. For license and copyright information, see the file LICENSE -} module GZiptest(tests) where import Test.HUnit import System.FileArchive.GZip import System.FilePath import Data.Compression.Inflate impo...
haskellbr/missingh
missingh-all/testsrc/GZiptest.hs
Haskell
mit
2,896
module Sandbox (tryProblem) where import Problems (problems, Problem(..), Test) import System.Process import System.Timeout import System.IO import Control.Monad (void) import Control.Concurrent.Async import Data.Unique import System.Directory import Data.List import Data.Aeson hiding (json) import Data.Text (pack) d...
bramgg/99haskell
Sandbox.hs
Haskell
mit
3,624
{-# LANGUAGE DataKinds #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE Strict #-} module SmallGL.SelectorObject ( SelectorObject (..) , initSelectorObject , releaseSelectorObjectRes , updateSelectorSizeIfNeeded ) where import Numeric.DataFrame.IO import Unsafe.Co...
achirkin/qua-view
src/SmallGL/SelectorObject.hs
Haskell
mit
2,480
import Control.Monad main = print (perms [0..9] !! 999999) others _ [] = [] others xs (y:zs) = (y, xs ++ zs) : others (xs ++ [y]) zs perms [] = [[]] perms list = do (x, yz) <- others [] list zy <- perms yz return (x : zy) -- perms :: [a] -> [a] -> [[a]] -- perms [] [] = [[]] -- perms xs [y] = liftM (y:)...
nickspinale/euler
complete/024.hs
Haskell
mit
402
{-# LANGUAGE FlexibleInstances, TypeSynonymInstances, OverlappingInstances #-} module Path where import Data.List import ListUtil type Path = String class Pathy a where pathOf :: a -> Path instance Pathy Path where pathOf path = path samePath :: Pathy a => Pathy b => a -> b -> Bool samePath a b = ...
raimohanska/oegysync
Path.hs
Haskell
mit
1,182
{-# LANGUAGE OverloadedStrings #-} import qualified SDL import Control.Concurrent (threadDelay) import Linear (V2(..), V4(..)) import Linear.Affine (Point(P)) import Control.Monad (unless) import Foreign.C.Types import Data.Foldable (traverse_) import System.IO (hPutStrLn, stderr) main :: IO () main = do SDL.init...
nitrix/lasers
src/Main.hs
Haskell
mit
2,783
-- | The recommended process for exporting plugins is to create a new module -- that exports a single function currying the first three arguments to -- 'Plugin'. The remaining argument, the Slack secret token, can be -- supplied in a separate file exporting the list of installed commands for -- Haskbot. This en...
Jonplussed/haskbot-core
src/Haskbot/Plugin.hs
Haskell
mit
3,764
module Unison.Util.TQueue where import Unison.Prelude import UnliftIO.STM hiding (TQueue) import qualified Control.Concurrent.Async as Async import qualified Data.Sequence as S import Data.Sequence (Seq((:<|)), (|>)) data TQueue a = TQueue (TVar (Seq a)) (TVar Word64) newIO :: MonadIO m => m (TQueue a) newIO = TQu...
unisonweb/platform
parser-typechecker/src/Unison/Util/TQueue.hs
Haskell
mit
2,669
{-# LANGUAGE PatternSynonyms #-} -- For HasCallStack compatibility {-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} module JSDOM.Generated.Crypto (getRandomValues, getRandomValues_, getSubtle, getWebkitSubtle, Crypto(..), gTypeCrypto) wh...
ghcjs/jsaddle-dom
src/JSDOM/Generated/Crypto.hs
Haskell
mit
2,276
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.ScriptProfileNode (js_children, children, js_getId, getId, js_getFunctionName, getFunctionName, js_getUrl, getUrl, js_getLineNumber, getLineNumber, js_getColumnNumber, getColumnNumber, ...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/ScriptProfileNode.hs
Haskell
mit
3,610
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codedeploy-deploymentgroup-targetgroupinfo.html module Stratosphere.ResourceProperties.CodeDeployDeploymentGr...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/CodeDeployDeploymentGroupTargetGroupInfo.hs
Haskell
mit
1,707
{-# LANGUAGE ExistentialQuantification #-} module Light.Camera ( Camera(..), CameraBox, cameraBox ) where import Light.Film import Light.Geometry class Camera a where cameraTransform :: a -> Transform cameraFilm :: a -> Film cameraRay :: a -> (Double, Double) -> Ray data CameraBox = forall c. (...
jtdubs/Light
src/Light/Camera.hs
Haskell
mit
786
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectcache.html module Stratosphere.ResourceProperties.CodeBuildProjectProjectCache where...
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/CodeBuildProjectProjectCache.hs
Haskell
mit
2,531
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE CPP #-} module Hpack.Run ( run , renderPackage , RenderSettings(..) , Alignment(..) , CommaStyle(..) , defaultRenderSettings #ifdef TEST , renderConditional , renderFlag , render...
yamadapc/hpack-convert
src/Hpack/Run.hs
Haskell
mit
9,779
module CAH.Cards.Import where import CAH.Cards.Types import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.IO as T import qualified Data.ByteString.Lazy as BS import Data.Aeson import Data.Set (Set) import qualified Data.Set as S import Sys...
EXio4/ircah
src/CAH/Cards/Import.hs
Haskell
mit
1,430
import Data.List.Split import Data.Char import Control.Arrow palindromeMoveCnt :: String -> Int palindromeMoveCnt s = sum diffs where [start, restM1] = (chunksOf $ (length s + 1) `div` 2) s rest = if length s `mod` 2 /= 0 then last start : restM1 else restM1 f a b = abs $ ord b - ord a diffs ...
Dobiasd/HackerRank-solutions
Algorithms/Warmup/The_Love-Letter_Mystery/Main.hs
Haskell
mit
460
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TupleSections #-} -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volumeattachment.html module Stratosphere.Resources.EC2VolumeAttachment where import Stratosphere.Re...
frontrowed/stratosphere
library-gen/Stratosphere/Resources/EC2VolumeAttachment.hs
Haskell
mit
2,521
{- Copyright 2014 David Farrell <shokku.ra@gmail.com> - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or...
shockkolate/lambdircd
plugins.old/Whois.hs
Haskell
apache-2.0
3,121
-- Copyright (c) 2013, Finn Espen Gundersen -- All rights reserved -- Licensed under the 2-clause Simplified BSD (FreeBSD) License -- | Pure module for encoding and decoding Google Polyline format as specified in -- https://developers.google.com/maps/documentation/utilities/polylinealgorithm module GPolyline (en...
fegu/gpolyline
GPolyline.hs
Haskell
bsd-2-clause
5,497
{-| An implementation of the queue from <http://zookeeper.apache.org/doc/trunk/recipes.html#sc_recipes_Queues>. The queue node will be automatically created and removed as necessary, and must not be used for any other purposes. The parent node of the queue node must already exist. Queues may contain both n...
jnb/zookeeper
src/Zookeeper/Queue.hs
Haskell
bsd-2-clause
3,824
module C(C.bla) where import D bla :: Test bla = undefined
nominolo/haddock2
examples/hide-bug/C.hs
Haskell
bsd-2-clause
62
{-# LANGUAGE ExtendedDefaultRules #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} module Bucket ( uploadObjectFromFile , uploadObject , deleteObject , bucketExists , createBucket , deleteBucket ) where import ...
lbodor/amazonia
src/Bucket.hs
Haskell
bsd-3-clause
1,974
module Core.Typecheck ( QName(..) , QType , QTyCon , QTypes , QExpr , QMeta , QPat , Renamed , typecheck ) where import Control.Arrow (second) import Data.Map (Map) import qualified Data.Map as M import Data.Set (Set) import qualified Data.Set as S ...
abbradar/dnohs
src/Core/Typecheck.hs
Haskell
bsd-3-clause
16,102
{-# LANGUAGE ForeignFunctionInterface, CPP #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.Rendering.OpenGL.Raw.ARB.ShaderSubroutine -- Copyright : (c) Sven Panne 2014 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- ...
mfpi/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/ARB/ShaderSubroutine.hs
Haskell
bsd-3-clause
3,916
{-# LANGUAGE CPP #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DefaultSignatures #-} module Data.Var.Boxed ( MonadVar (..) , contents , modify ) where import Control.Applicative import Control.Lens import qualified Control.Monad.ST.Lazy.Safe as Lazy import Control.Monad.ST.Safe import Cont...
sonyandy/wart-var
src/Data/Var/Boxed.hs
Haskell
bsd-3-clause
3,430
{-| Module : Database.Taxi.Segment.Types Description : Type definitions Stability : Experimental Maintainer : guha.rabishankar@gmail.com -} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE RecordWildCards #-} module Database.Taxi.Segment.Types where import Control.Applicative ((<$>)...
rabisg/taxi
Database/Taxi/Segment/Types.hs
Haskell
bsd-3-clause
1,720
{-#LANGUAGE MonoLocalBinds #-} module LambdaF2 where import Name import Value import Lambda as Lam import Data.Bifunctor data LamTermF i j n a = LambdaF [(i, Name)] a | ApplF a [a] | VarF j n | ValF j Value | LetF j [Def i a] a deriving (Eq, Show) instance ...
kwibus/myLang
src/LambdaF2.hs
Haskell
bsd-3-clause
3,321
module LessWrong.COC.Error where import Data.Text (unpack) import LessWrong.COC.Type import LessWrong.COC.Pretty data CalculusError = ParsingError String | UnknownVariable Var | CannotEqualize Term Term | InvalidType Term ...
zmactep/less-wrong
src/LessWrong/COC/Error.hs
Haskell
bsd-3-clause
702
module Minimax where import Debug.Trace import Data.List import Data.Ord class GameState a where evaluateState :: a -> Int terminalState :: a -> Bool genSuccessors :: a -> [Int] makeSuccessor :: a -> Int -> a isMaximizing :: a -> Bool minimax :: (GameState a) => a -> Bool -> Int ...
tylerprete/haskell-minimax-games
src/minimax.hs
Haskell
bsd-3-clause
4,358
{-# OPTIONS_GHC -Wall #-} module Main where import Graphics.Gloss import Physics.Learn.CarrotVec import Physics.Learn.Position import Physics.Learn.Curve import Physics.Learn.Charge import Physics.Learn.Visual.GlossTools pixelsPerMeter :: Float pixelsPerMeter = 40 pixelsPerVPM :: Float pixelsPerVPM = 5.6 scalePoin...
walck/learn-physics
examples/src/eFieldLine2D.hs
Haskell
bsd-3-clause
1,252
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-} module Evaluate(normalise) where import Debug.Trace import Core normalise :: Context -> TT Name -> TT Name normalise ctxt t = quote 0 (eval ctxt (hoas [] t)) -- We just evaluate HOAS terms. Any de Bruijn indices will refer to higher -- level things, so, if w...
jxwr/hdep
src/Evaluate.hs
Haskell
bsd-3-clause
2,525
{-# LANGUAGE CPP, ForeignFunctionInterface #-} {- A large and somewhat miscellaneous collection of utility functions used throughout the rest of libfaction and in other tools that use it, like @faction@. It has a very simple set of logging actions. It has low level functions for running programs, a bunch of wrappers fo...
IreneKnapp/Faction
libfaction/Distribution/Simple/Utils.hs
Haskell
bsd-3-clause
40,229
{-# LANGUAGE TypeOperators, TupleSections #-} {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} {-# OPTIONS_GHC -Wall #-} ---------------------------------------------------------------------- -- | -- Module : Data.StateTrie -- Copyright : (c) Conal Elliott 2012 -- License : BSD3 -- -- Maintain...
conal/state-trie
src/Data/StateTrie.hs
Haskell
bsd-3-clause
3,506
module Test.OCanrenize where import OCanrenize import Test.Helper (test) import Syntax unit_OCanrenizeTerm = do test ocanren (C "fst" [] :: Term X) "(fst_ ())" test ocanren (C "snd" [] :: Term X) "(snd_ ())" test ocanren (C "fill" [] :: Term X) "(fill ())"
kajigor/uKanren_transformations
test/auto/Test/OCanrenize.hs
Haskell
bsd-3-clause
270
----------------------------------------------------------------------------- -- -- The register liveness determinator -- -- (c) The University of Glasgow 2004 -- ----------------------------------------------------------------------------- {-# OPTIONS -Wall -fno-warn-name-shadowing #-} module RegAlloc.Liveness ( ...
mcmaniac/ghc
compiler/nativeGen/RegAlloc/Liveness.hs
Haskell
bsd-3-clause
34,755
-- Copyright (c) 2016-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. {-# LANGUAGE Over...
rfranek/duckling
Duckling/Duration/NB/Corpus.hs
Haskell
bsd-3-clause
1,172
module System.IO.Streams.Serialize where import Data.ByteString import Data.Serialize import System.IO.Streams as Streams decodeFromStream :: Serialize a => InputStream ByteString -> IO (InputStream a) decodeFromStream = Streams.map (fromEither . decode) where fromEither (Left s) =...
WraithM/peertrader-backend
src/System/IO/Streams/Serialize.hs
Haskell
bsd-3-clause
473
{-# LANGUAGE OverloadedStrings, DeriveDataTypeable, GeneralizedNewtypeDeriving #-} {-# OPTIONS_HADDOCK not-home #-} -- |Internal functions used to implement the functions exported by -- "Test.WebDriver.Commands". These may be useful for implementing non-standard -- webdriver commands. module Test.WebDriver.Commands.In...
zerobuzz/hs-webdriver
src/Test/WebDriver/Commands/Internal.hs
Haskell
bsd-3-clause
3,893
import Control.Monad (void) import qualified Graphics.UI.Threepenny as UI import Graphics.UI.Threepenny.Core {----------------------------------------------------------------------------- Enabled ------------------------------------------------------------------------------} main :: IO () main = startGUI defaultC...
yuvallanger/threepenny-gui
samples/InputElements.hs
Haskell
bsd-3-clause
1,143
{-# LANGUAGE CPP #-} {-# LANGUAGE TupleSections #-} module Eta.DeSugar.DsUsage ( -- * Dependency/fingerprinting code (used by MkIface) mkUsageInfo, mkUsedNames, mkDependencies ) where #include "HsVersions.h" import Eta.Main.DynFlags import Eta.Main.HscTypes import Eta.TypeCheck.TcRnTypes import Eta.Basic...
rahulmutt/ghcvm
compiler/Eta/DeSugar/DsUsage.hs
Haskell
bsd-3-clause
11,256
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, DeriveFunctor, DeriveDataTypeable, PatternGuards #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} {-| TT is the core language of Idris. The language has: * Full dependent types * A hierarchy of universes, with cumulativity: Type : Type1...
Enamex/Idris-dev
src/Idris/Core/TT.hs
Haskell
bsd-3-clause
71,139
module L01.Optional where -- class Optional<A> { -- Optional(A a) {} // Full -- Optional() {} // Empty -- } data Optional a = Full a | Empty deriving (Eq, Show) mapOptional :: (a -> b) -> Optional a -> Optional b mapOptional _ Empty = Empty mapOptional f (Full a) = Full (f a) bindOptional :: Optional a ->...
juretta/course
src/L01/Optional.hs
Haskell
bsd-3-clause
559
module LetIn1 where --A definition can be demoted to the local 'where' binding of a friend declaration, --if it is only used by this friend declaration. --Demoting a definition narrows down the scope of the definition. --In this example, demote the local 'pow' to 'sq' --This example also aims to test the demoting a ...
mpickering/ghc-exactprint
tests/examples/transform/LetIn1.hs
Haskell
bsd-3-clause
517
module Jhc.Prim.Bits where -- this declares the built in unboxed types. -- no code is brought in by this module, it just -- brings the names into scope, so it is okay to -- have platform specific definitions here. -- The CTYPE of the raw types is declared in src/DataConstructors.hs data Bits1_ :: # data Bits8_ :: ...
hvr/jhc
lib/jhc-prim/Jhc/Prim/Bits.hs
Haskell
mit
1,176
<?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="fr-FR"> <title>Eval Villain Add-On</title> <maps> <homeID>evalvillain</homeID> <mapref ...
kingthorin/zap-extensions
addOns/evalvillain/src/main/javahelp/org/zaproxy/addon/evalvillain/resources/help_fr_FR/helpset_fr_FR.hs
Haskell
apache-2.0
972
{-# LANGUAGE GADTs #-} ----------------------------------------------------------------------------- -- -- Debugging data -- -- Association of debug data on the Cmm level, with methods to encode it in -- event log format for later inclusion in profiling event logs. -- --------------------------------------------------...
mcschroeder/ghc
compiler/cmm/Debug.hs
Haskell
bsd-3-clause
14,390
{-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} {-# LANG...
wherkendell/diagrams-contrib
src/Diagrams/Lens.hs
Haskell
bsd-3-clause
3,351
import Control.Exception as E -- This test shows what hpc can really do. main = do print ("Hello") foo "Hello" E.catch (print (badCase 22 44)) (\ e -> print (e :: E.ErrorCall)) E.catch (print (badCase 22 (error "Foo"))) (\ e -> print (e :: E.ErrorCall)) E.catch (print "Bark") (...
ttuegel/hpc
tests/function/tough.hs
Haskell
bsd-3-clause
1,059
{-# LANGUAGE DataKinds, PolyKinds, RankNTypes, GADTs #-} module T7481 where import Data.Kind (Type) import Data.Proxy data D a where D1 :: a -> D a D2 :: (a~Int) => D a D3 :: forall k (a::k) b. Proxy a -> D b data Foo :: D Type -> Type
sdiehl/ghc
testsuite/tests/polykinds/T7481.hs
Haskell
bsd-3-clause
247
module Test20 where f y xs = [x | x <- xs] + y
SAdams601/HaRe
old/testing/refacSlicing/Test20_TokOut.hs
Haskell
bsd-3-clause
49
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} module Web.Slack.WebAPI ( SlackConfig(..) , makeSlackCall -- * Methods , rtm_start , chat_postMessage , reactions_add_message ) where import Control.Lens hiding ((??)) import Control.Mo...
mpickering/slack-api
src/Web/Slack/WebAPI.hs
Haskell
mit
3,177
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ViewPatterns #-} module ChaostreffScheduler where import Protolude import Data.Time import Data.List ((!!), groupBy, concat, head) import Lektor import Event import AppCfg import Git schedule :: (MonadIO m, MonadReader AppCfg m) => m ()...
section77/chaostreff-scheduler
src/ChaostreffScheduler.hs
Haskell
mit
4,121
-- Exercise 1 toDigits :: Integer -> [Integer] toDigits 0 = [] toDigits n = toDigits (n `div` 10) ++ [n `mod` 10] toDigitsRev :: Integer -> [Integer] toDigitsRev 0 = [] toDigitsRev n = [n `mod` 10] ++ toDigitsRev (n `div` 10) --Exercise 2 doubleEveryOther :: [Integer] -> [Integer] doubleEveryOther reverse' :: [Int...
diminishedprime/.org
reading-list/cis194/homework_01.hs
Haskell
mit
393
module Main where import System.Environment import Commands data Command = Help |Β List | Freeze | Install | Uninstall | Error instance Show Command where show Help = "Help" show List = "List" show Freeze = "Freeze" show Install = "Ins...
pepegar/vkg-haskell
src/Main.hs
Haskell
mit
861
module Main (main) where import Test.Framework (Test, defaultMain) import qualified OptCrackerTests as OptCrackerTests import qualified UserManagementTests as UserManagementTests main :: IO () main = defaultMain testSuite testSuite :: [Test] testSuite = [ OptCrackerTests.suite , UserManagementTests.suite...
AstralMining/astral-mining-server
test/TestMain.hs
Haskell
mit
323
module Main where import System.Environment import System.IO import System.Console.ANSI import Data.Char import Data.Maybe import Data.List import Data.Either import Control.Monad import Text.Megaparsec import Text.Megaparsec.Expr import Text.Megaparsec.String import qualified Text.Megaparsec.Lexer as L import Parse....
akindle/hdlint
Parse.hs
Haskell
mit
4,229
{-| Module: Y2015.D05 Description: Advent of Code Day 05 Solutions. License: MIT Maintainer: @tylerjl Solutions to the day 05 set of problems for <adventofcode.com>. -} module Y2015.D05 ( clean , isNice , isNicer , thriceVoweled , twiceRow ) where import Y2015.Util ((<&&>)) import Data.List (gr...
tylerjl/adventofcode
src/Y2015/D05.hs
Haskell
mit
1,839
callmin = min 9 10 callmax = max 9 10 -- These two are equivalent. evaluate1 = succ 9 + max 5 4 + 1 evaluate2 = (succ 9) + (max 5 4) + 1 -- infix notation divide1 = div 92 10 divide2 = 92 `div` 10
v0lkan/learning-haskell
session-002/prefix.hs
Haskell
mit
198
-- | -- Implementation of dumb random AI module Agent.Random ( RandomAgent ) where import Control.Monad.State.Strict import System.Random import ToServer import FromServer import Agent -- | Contains a generator for random moves data RandomAgent = AS { gen :: StdGen } instance Agent RandomAgent where newAgent ...
adamse/mmc2
src/Agent/Random.hs
Haskell
mit
460
-- Fibo akin -- https://www.codewars.com/kata/5772382d509c65de7e000982 module Codewars.G964.Fibkind(comp, lengthSupUK) where s = 1 : 1 : zipWith3 f s (tail s) [2..] where f a b i = s !! (i - a) + s !! (i - b) lengthSupUK :: Int -> Int -> Int lengthSupUK n k = length . filter (>= k) . take n $ s comp :: Int -> I...
gafiatulin/codewars
src/5 kyu/Fibkind.hs
Haskell
mit
396
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Monad (replicateM) import Control.Monad.IO.Class (liftIO) import qualified Data.ByteString.Char8 as BC import Data.Text.Encoding (decodeUtf8, encodeUtf8) import qualified Data.Text.Lazy as TL import qualified Database.Redis as R import Network.URI (U...
JustinUnger/haskell-book
ch22/shawty.hs
Haskell
mit
2,602
{-# htermination (>=) :: Ord a => a -> a -> Bool #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_GTEQ_1.hs
Haskell
mit
53
import Common -- Since I don't know how many numbers there are, any of the answers might be correct. main = print $ scanl (+) 0 [ x | x <- [10..], sum [ product [1..y] | y <- (toDigits x) ] == x]
lekto/haskell
Project-Euler-Solutions/problem0034.hs
Haskell
mit
197
module Miscellaneous.A259439 (a259439) where import HelperSequences.A143482 (a143482) a259439 :: Integral a => a -> a a259439 n = a143482 n `div` n
peterokagey/haskellOEIS
src/Miscellaneous/A259439.hs
Haskell
apache-2.0
149
{-# LANGUAGE TemplateHaskell, NoMonomorphismRestriction, FlexibleContexts, RankNTypes #-} {-| The WConfd functions for direct configuration manipulation This module contains the client functions exported by WConfD for specific configuration manipulation. -} {- Copyright (C) 2014 Google Inc. All rights reserve...
bitemyapp/ganeti
src/Ganeti/WConfd/ConfigModifications.hs
Haskell
bsd-2-clause
30,541
module Exercises181 where import Control.Monad (join) bind :: Monad m => (a -> m b) -> m a -> m b bind f x = join $ fmap f x
pdmurray/haskell-book-ex
src/ch18/Exercises181.hs
Haskell
bsd-3-clause
126
module Module5.Task18 where import Data.Monoid (Sum(..)) import Control.Monad.Writer (Writer, execWriter, writer) -- system code type Shopping = Writer (Sum Integer) () shopping1 :: Shopping shopping1 = do purchase "Jeans" 19200 purchase "Water" 180 purchase "Lettuce" 328 -- solution code purchase :: S...
dstarcev/stepic-haskell
src/Module5/Task18.hs
Haskell
bsd-3-clause
447
module Exercises.FindMissingNumbers (findMissingPair) where findMissingPair :: [Integer] -> Maybe (Integer, Integer) findMissingPair [] = Nothing findMissingPair s = findMP (1, []) s where findMP (_, [a,b]) _ = Just (a,b) findMP _ [] = Nothing findMP (i, missings...
WarKnife/exercises
src/Exercises/FindMissingNumbers.hs
Haskell
bsd-3-clause
629
{-# LANGUAGE OverloadedStrings #-} -- | Bindings to the Docker Remote API. -- TODO Should be Network.Docker.Remote. module Network.Docker.Remote where import Control.Applicative ((<$>), (<*>)) import Control.Monad (mzero) import Data.Aeson (object, FromJSON(..), ToJSON(..), Value(..), (.=), (.:), (.:?)) import Data.By...
noteed/rescoyl-checks
Network/Docker/Remote.hs
Haskell
bsd-3-clause
2,502
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} module Web.ISO.Murv where import Control.Concurrent.STM (atomically) import Control.Concurrent.STM.TQueue (TQueue, newTQueue, readTQueue, writeTQueue) import Control.Monad.Trans (MonadIO(..)) import Data.Text (Text) import Data.JSString.Text (text...
stepcut/isomaniac
Web/ISO/Murv.hs
Haskell
bsd-3-clause
5,917
{-# LANGUAGE BangPatterns, OverloadedStrings, ScopedTypeVariables, CPP #-} {-# LANGUAGE NamedFieldPuns #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} -- | Utilities for reading PBBS data files, etc. -- TODO: -- * It is probably a better strategy to shift the slices around to match number -- boundaries than it...
adk9/pbbs-haskell
PBBS/FileReader.hs
Haskell
bsd-3-clause
16,918
{-# LANGUAGE OverloadedStrings #-} module Buildsome.Print ( posText ) where import Data.String (IsString(..)) import Text.Parsec (SourcePos) posText :: (Monoid s, IsString s) => SourcePos -> s posText _ = ""
da-x/buildsome-tst
app/Buildsome/Print.hs
Haskell
bsd-3-clause
242
{-# LANGUAGE PackageImports #-} module System.Exit (module M) where import "base" System.Exit as M
silkapp/base-noprelude
src/System/Exit.hs
Haskell
bsd-3-clause
104
{-# LANGUAGE PatternSynonyms #-} -------------------------------------------------------------------------------- -- | -- Module : Graphics.GL.NV.ShaderBufferLoad -- Copyright : (c) Sven Panne 2019 -- License : BSD3 -- -- Maintainer : Sven Panne <svenpanne@gmail.com> -- Stability : stable -- Portabil...
haskell-opengl/OpenGLRaw
src/Graphics/GL/NV/ShaderBufferLoad.hs
Haskell
bsd-3-clause
1,160
-- 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 OverloadedStrings #-} {-# LANGUAGE NoRebindableSyntax #-} module Duckling.Nu...
facebookincubator/duckling
Duckling/Numeral/Rules.hs
Haskell
bsd-3-clause
1,227
{-# LANGUAGE ScopedTypeVariables #-} -- | This module provides convenience functions for interfacing @io-streams@ -- with @HsOpenSSL@. It is intended to be imported @qualified@, e.g.: -- -- @ -- import qualified "OpenSSL" as SSL -- import qualified "OpenSSL.Session" as SSL -- import qualified "System.IO.Streams.SSL" a...
snapframework/openssl-streams
src/System/IO/Streams/SSL.hs
Haskell
bsd-3-clause
6,187
module Snap.Snaplet.Environments ( module Data.Configurator , lookupConfig , lookupConfigDefault , lookupEnv , lookupEnvDefault , module Snap.Snaplet.Environments.Instances ) where import Control.Monad.Reader import Data.Maybe (fromMaybe) import Data.Configura...
kamilc/Snaplet-Environments
src/Snap/Snaplet/Environments.hs
Haskell
bsd-3-clause
3,002
{- - Claq (c) 2013 NEC Laboratories America, Inc. All rights reserved. - - This file is part of Claq. - Claq is distributed under the 3-clause BSD license. - See the LICENSE file for more details. -} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} module Compile (prepareExprCoherent, p...
ti1024/claq
src/Compile.hs
Haskell
bsd-3-clause
2,573
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Test.Unit where import Prelude (($), (.)) import Data.Foldable (mapM_) import Data.Text hiding (toTitle) import Data.Text.Titlecase import ...
nkaretnikov/titlecase
tests/Test/Unit.hs
Haskell
bsd-3-clause
2,760
{-# LANGUAGE TemplateHaskell #-} module NotCPP.Utils where import Control.Applicative ((<$>)) import Language.Haskell.TH -- | Turns 'Nothing' into an expression representing 'Nothing', and -- @'Just' x@ into an expression representing 'Just' applied to the -- expression in @x@. liftMaybe :: Maybe Exp -> Exp liftMaybe...
bmillwood/notcpp
NotCPP/Utils.hs
Haskell
bsd-3-clause
1,046
import Data.STM.LinkedList (LinkedList) import qualified Data.STM.LinkedList as LinkedList import Control.Concurrent import Control.Concurrent.STM import Control.Exception import Control.Monad (forM_, forever) import Foreign.Marshal.Error (void) type Event = String type EventHandler = (Event -> IO ()) withEventHandl...
joeyadams/haskell-stm-linkedlist
testing/event-handler.hs
Haskell
bsd-3-clause
1,705
module Lucid.Foundation.Typography ( module Lucid.Foundation.Typography.Types , module Lucid.Foundation.Typography.InlineList , module Lucid.Foundation.Typography.Labels ) where import Lucid.Foundation.Typography.Types import Lucid.Foundation.Typography.InlineList import Lucid.Foundation.Typography.Labels
athanclark/lucid-foundation
src/Lucid/Foundation/Typography.hs
Haskell
bsd-3-clause
316
module Database.Hitcask( get , put , delete , Hitcask() , connect , connectWith , close , compact , listKeys , standardSettings ) where import Control.Concurrent.STM import System.IO import System.Directory import Database.Hitcask.Types import Database.Hitcask.Restore import Database.Hitcask.Get i...
tcrayford/hitcask
Database/Hitcask.hs
Haskell
bsd-3-clause
1,366
module Internal.BitOps ( fixedXOR , repeatingKeyXOR , hamming ) where import qualified Data.ByteString as BS import Data.Bits import Internal.Uncons import Data.Monoid import Data.Word import Debug.Trace fixedXOR :: BS.ByteString -> BS.ByteString -> Maybe BS.ByteString fixedXOR bs1 bs2 | BS.length bs1 /= BS.lengt...
caneroj1/Crypto-hs
src/Internal/BitOps.hs
Haskell
bsd-3-clause
775
{-# LANGUAGE OverloadedStrings #-} module Network.YAML.Snap (handleApi, handleApiPost) where import qualified Data.ByteString as B import qualified Data.Text.Encoding as TE import Network.YAML import qualified Data.Aeson as Json import Snap errorMsg :: Int -> B.ByteString -> Snap () errorMsg status msg = do modify...
portnov/yaml-rpc
yaml-rpc-snap/Network/YAML/Snap.hs
Haskell
bsd-3-clause
1,280