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 MagicHash #-}
module Main (main) where
import GHC.Exts (Double(D#), Float(F#), word2Double#, word2Float#)
main :: IO ()
main = do
print (D# (word2Double# 0##))
-- 9007199254740992 is 2^53, which is the largest integer which
-- can be stored in a 64-bit IEEE floating-point value without
--... | beni55/ghcjs | test/ghc/codeGen/word2Float64.hs | Haskell | mit | 738 |
-- |
-- Module: BigE.Model
-- Copyright: (c) 2017 Patrik Sandahl
-- Licence: MIT
-- Maintainer: Patrik Sandahl <patrik.sandahl@gmail.com>
-- Stability: experimental
-- Portability: portable
-- Utilities to read Wavefront model files and produce vectors that can be
-- used to create meshes.
module BigE.Model
( vert... | psandahl/big-engine | src/BigE/Model.hs | Haskell | mit | 2,315 |
{-# LANGUAGE OverloadedStrings #-}
module Model.InitDB
( initDBSpecs
) where
import TestImport
import qualified Data.List as L
initDBSpecs :: Spec
initDBSpecs =
ydescribe "Initial DB should be empty" $ do
-- user/article/comment/image tables are empty when initial.
yit "leaves the article table empt... | cosmo0920/Ahblog | tests/Model/InitDB.hs | Haskell | mit | 1,102 |
{-# OPTIONS_GHC -fno-warn-partial-type-signatures #-}
{-# LANGUAGE
PartialTypeSignatures
, OverloadedStrings
, RecordWildCards
#-}
module XMonad.Javran.Config
( myConfig
) where
-- TODO: xmonad restarter
import Data.Monoid
import System.IO
import XMonad
import XMonad.Layout.Fullscreen
import XMonad.Hooks.M... | Javran/xmonad-javran | src/XMonad/Javran/Config.hs | Haskell | mit | 1,960 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{- |
Module : Control.SIArrow
Description : Categories of reversible computations.
Copyright : (c) Paweł Nowak
License : MIT
Maintainer : Pa... | pawel-n/semi-iso | Control/SIArrow.hs | Haskell | mit | 6,380 |
module SimpleNoun where
import ClassyPrelude
import Numeric.Natural
import qualified Urbit.Noun as N
type Atom = Natural
type Noun = Tree Atom
data Tree a
= A !a
| C !(Tree a) !(Tree a)
deriving (Eq, Ord, Read, Functor, Generic)
instance Hashable a => Hashable (Tree a)
data Fern a
= FernA !a
| FernF [Fe... | urbit/urbit | pkg/hs/proto/lib/SimpleNoun.hs | Haskell | mit | 2,478 |
{-# LANGUAGE OverloadedStrings #-}
module Engine.Probing where
import Control.Monad.IO.Class
import Data.Carthage.TargetPlatform
import Data.List ( intersect )
import Data.Romefile ( _frameworkPlatforms )
import ... | blender/Rome | src/Engine/Probing.hs | Haskell | mit | 3,364 |
{-# LANGUAGE BangPatterns, RecordWildCards, FlexibleContexts #-}
module AI.Funn.Optimizer.SGD (SGDState, initSGD, extractSGD, updateSGD) where
import Control.Monad
import Data.Foldable
import AI.Funn.Space
type LearningRate = Double
type Momentum = Double
data SGDState m d p = SGDState {
sgdStepSize :: LearningRa... | nshepperd/funn | AI/Funn/Optimizer/SGD.hs | Haskell | mit | 1,355 |
{-# LANGUAGE OverloadedStrings #-}
module Database.Hasqueue.Store.SimpleSpec ( spec ) where
import Control.Concurrent.STM.Class
import Control.Monad
import Database.Hasqueue
import Data.List (sort)
import Pipes
import qualified Pipes.Prelude as P
import Pipes.Concurrent
import Test.Hspec
spec :: Spec
spec = do
l... | nahiluhmot/hasqueue | spec/Database/Hasqueue/Store/SimpleSpec.hs | Haskell | mit | 20,475 |
{-# LANGUAGE Arrows #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Control.Auto
import Data.Profunctor
import Data.Serialize
import Data.Traversable
import Debug.Trace
import Linear.Matrix
import Linear.Metric
import Linear.V1
import Linear.V2
import Linear.V3
import ... | mstksg/auto-examples | src/Experimental/Neural.hs | Haskell | mit | 4,299 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE OverloadedStrings #-}
module Yesod.Content
( -- * Content
Content (..)
, emptyContent
, ToContent (..)
-- * Mime types
-- ** Data type
, ContentType
, typeHtml
, ty... | chreekat/yesod | yesod-core/Yesod/Content.hs | Haskell | bsd-2-clause | 7,002 |
{-# LANGUAGE TypeFamilies, FlexibleInstances, FlexibleContexts,
DeriveDataTypeable, StandaloneDeriving #-}
module HEP.Automation.MadGraph.Model.ZpH where
import Data.Typeable
import Data.Data
import Text.Printf
import Text.Parsec
import Control.Monad.Identity
import Text.StringTemplate
import Text.St... | wavewave/madgraph-auto-model | src/HEP/Automation/MadGraph/Model/ZpH.hs | Haskell | bsd-2-clause | 2,229 |
-----------------------------------------------------------------------------
-- |
-- Copyright : (C) 2015 Dimitri Sabadie
-- License : BSD3
--
-- Maintainer : Dimitri Sabadie <dimitri.sabadie@gmail.com>
-- Stability : experimental
-- Portability : portable
-----------------------------------------------------... | apriori/luminance | src/Graphics/Luminance/Shader/Program.hs | Haskell | bsd-3-clause | 3,276 |
{-# LANGUAGE CPP #-}
module Text.Search.Sphinx.Types (
module Text.Search.Sphinx.Types
, ByteString ) where
import Data.ByteString.Lazy (ByteString)
import Data.Int (Int64)
import Data.Maybe (Maybe, isJust)
import Data.Text (Text,empty)
-- | Data structure representing one query. It can be sent with 'runQueries... | gregwebs/haskell-sphinx-client | Text/Search/Sphinx/Types.hs | Haskell | bsd-3-clause | 6,681 |
{-#LANGUAGE MultiParamTypeClasses #-}
{-#LANGUAGE OverloadedStrings #-}
{-#LANGUAGE ViewPatterns #-}
module Twilio.Transcription
( -- * Resource
Transcription(..)
, Twilio.Transcription.get
-- * Types
, PriceUnit(..)
, TranscriptionStatus(..)
) where
import Control.Applicative
import Control.Error.S... | seagreen/twilio-haskell | src/Twilio/Transcription.hs | Haskell | bsd-3-clause | 2,632 |
{-# LANGUAGE GADTs, TypeOperators, PolyKinds, RankNTypes, CPP #-}
#include "macros.h"
LANGUAGE_TRUSTWORTHY
LANGUAGE_AUTODERIVETYPEABLE
{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-orphans #-}
-- | Kind-polymorphic functions for manipulating type equality evidence.
--
-- This module is available only if @Po... | glaebhoerl/type-eq | Type/Eq/Poly.hs | Haskell | bsd-3-clause | 2,487 |
module Database.Algebra.Rewrite.Traversal
( preOrder
, postOrder
, applyToAll
, topologically
, iteratively
, sequenceRewrites
) where
import Control.Monad
import qualified Data.IntMap as M
import qualified Data.Set ... | ulricha/algebra-dag | src/Database/Algebra/Rewrite/Traversal.hs | Haskell | bsd-3-clause | 6,370 |
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ViewPatterns #-}
-- | Implementation of the @dhall to-directory-tree@ subcommand
module Dhall.DirectoryTree
( -- * Filesystem
toDirectoryTree
, FilesystemError(..)
) where
impor... | Gabriel439/Haskell-Dhall-Library | dhall/src/Dhall/DirectoryTree.hs | Haskell | bsd-3-clause | 9,987 |
-- | Usage: http-bench <total> <concurrent>
module Main where
import Control.Concurrent
import Control.Monad
import Network.HTTP
import Text.Printf
import System.Exit
import System.Environment
import Control.Exception as E
import Debug.Trace
data Stats = Stats {hits :: Int, prevHits :: Int} deriving (Show)
data In... | headprogrammingczar/http-bench | Main.hs | Haskell | bsd-3-clause | 3,858 |
{--
Another instance of Applicative is (->) r, so functions. They are rarely used with the applicative style outside of code golf, but they're still interesting as applicatives, so let's take a look at how the function instance is implemented.
instance Applicative ((->) r) where
pure x = (\_ -> x)
f <*> g = \... | jamesyang124/haskell-playground | src/Chp111.hs | Haskell | bsd-3-clause | 6,133 |
-- |
-- Functions for constructing and parsing Atom feeds for use in the
-- request and response bodies of the various web methods.
--
module Network.TableStorage.Atom (
atomNamespace, dataServicesNamespace, metadataNamespace,
qualifyAtom, qualifyDataServices, qualifyMetadata,
atomElement, atomAttr, wrapContent
... | paf31/tablestorage | src/Network/TableStorage/Atom.hs | Haskell | bsd-3-clause | 2,878 |
-- | State monad for the linear register allocator.
-- Here we keep all the state that the register allocator keeps track
-- of as it walks the instructions in a basic block.
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While wor... | nomeata/ghc | compiler/nativeGen/RegAlloc/Linear/State.hs | Haskell | bsd-3-clause | 3,775 |
module Data.Persist.Compile (compile) where
import Data.Persist.AST
import Language.Haskell.Exts.Syntax
import Data.Either (partitionEithers)
compile :: [Either Decl Relationship] -> Module
compile input = Module noLoc (ModuleName "Model") pragmas Nothing Nothing imports (compileDecls input)
where imports = map... | chriseidhof/persist | src/Data/Persist/Compile.hs | Haskell | bsd-3-clause | 4,882 |
{-- snippet all --}
import System.IO
import System.Directory(getTemporaryDirectory, removeFile)
import System.IO.Error(catch)
import Control.Exception(finally)
-- The main entry point. Work with a temp file in myAction.
main :: IO ()
main = withTempFile "mytemp.txt" myAction
{- The guts of the program. Called with ... | binesiyu/ifl | examples/ch07/tempfile.hs | Haskell | mit | 3,603 |
<?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-SP">
<title>Import Urls | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapref ... | secdec/zap-extensions | addOns/importurls/src/main/javahelp/org/zaproxy/zap/extension/importurls/resources/help_sr_SP/helpset_sr_SP.hs | Haskell | apache-2.0 | 972 |
<?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="ur-PK">
<title>Export Report | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapr... | veggiespam/zap-extensions | addOns/exportreport/src/main/javahelp/org/zaproxy/zap/extension/exportreport/resources/help_ur_PK/helpset_ur_PK.hs | Haskell | apache-2.0 | 975 |
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Hooks.EwmhDesktops
-- Copyright : (c) 2007, 2008 Joachim Breitner <mail@joachim-breitner.de>
-- License : BSD
--
-- Maintainer : Joachim Breitner <mail@joachim-breitner.de>
-- Stability : unstable
--... | eb-gh-cr/XMonadContrib1 | XMonad/Hooks/EwmhDesktops.hs | Haskell | bsd-3-clause | 9,444 |
{-# LANGUAGE TupleSections, OverloadedStrings, QuasiQuotes, TemplateHaskell, TypeFamilies, RecordWildCards,
DeriveGeneric ,MultiParamTypeClasses ,FlexibleInstances #-}
module Protocol.ROC.PointTypes (module PointTypes
,decodePTID
,fetchPointTy... | jqpeterson/roc-translator | src/Protocol/ROC/PointTypes.hs | Haskell | bsd-3-clause | 21,145 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
module Modal.Code where
import Prelude hiding (readFile, sequence, mapM, foldr1, concat, concatMap)
import Control.Applicative
import Control.Monad.Except hiding (mapM, sequence)
import Control.Monad.State hiding (mapM... | daniel-ziegler/provability | src/Modal/Code.hs | Haskell | bsd-3-clause | 17,712 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE CPP #-}
module Network.Wai.Handler.Warp.Response (
sendResponse
, sanitizeHeaderValue -- for testing
, warpVersion
, hasBody
, replaceHeader
) where
#ifndef MIN... | utdemir/wai | warp/Network/Wai/Handler/Warp/Response.hs | Haskell | mit | 16,931 |
<?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>DOM XSS Active Scan Rule | ZAP Extension</title>
<maps>
<homeID>top</homeID>
... | thc202/zap-extensions | addOns/domxss/src/main/javahelp/org/zaproxy/zap/extension/domxss/resources/help_zh_CN/helpset_zh_CN.hs | Haskell | apache-2.0 | 985 |
<?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>Technology detection | ZAP Extension</title>
<maps>
<homeID>top</homeID>
... | kingthorin/zap-extensions | addOns/wappalyzer/src/main/javahelp/org/zaproxy/zap/extension/wappalyzer/resources/help_hi_IN/helpset_hi_IN.hs | Haskell | apache-2.0 | 981 |
module Qualified2 where
-- import qualified Control.Parallel.Strategies as T
import qualified Control.Parallel.Strategies as S
-- should fail, as there are two possible qualifiers...
fib n
| n <= 1 = 1
| otherwise = n1_2 + n2_2 + 1
where
n1 = fib (n-1)
n2 = fib (n-2)
(n1_2, n2_2)... | RefactoringTools/HaRe | old/testing/evalAddEvalMon/Qualified2_TokOut.hs | Haskell | bsd-3-clause | 487 |
<?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="ur-PK">
<title>AJAX Spider | ZAP Extensions</title>
<maps>
<homeID>top</homeID>
<mapre... | ccgreen13/zap-extensions | src/org/zaproxy/zap/extension/spiderAjax/resources/help_ur_PK/helpset_ur_PK.hs | Haskell | apache-2.0 | 974 |
-- This one elicited a bug in the simplifier
-- that produces a Lint out-of-scope error
module T4345 where
isNull :: IO Bool
isNull = error "urk"
wrapMatchAll :: IO (Maybe ())
wrapMatchAll = do
nsub <- undefined
let loop True = do atEnd <- isNull
return Nothing
loop False = loop Fa... | forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/simplCore/should_compile/T4345.hs | Haskell | bsd-3-clause | 365 |
{-# LANGUAGE OverloadedStrings #-}
module Cric.PackagesSpec (
test
) where
import Test.Hspec
import SpecHelpers
import Cric
import Cric.Packages
test :: Spec
test = do
describe "getPackageManager" $ do
it "detects RPM" $ do
let sshMock = mockCommand "which rpm" (0, "/bin/rpm") defaultSshMock
r... | thoferon/cric | tests/Cric/PackagesSpec.hs | Haskell | mit | 3,007 |
module Main where
import Control.Monad
import Control.AutoUpdate
main = do
update <- mkAutoUpdate $ do
putStrLn "hello, world"
forever update
| arianvp/ghcjs-auto-update | example/Main.hs | Haskell | mit | 155 |
{-# LANGUAGE PatternSynonyms #-}
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.SVGPathSegCurvetoQuadraticAbs
(setX, getX, setY, getY, setX1, getX1, setY1, getY1,
SVGPathSegCurvetoQuadr... | ghcjs/jsaddle-dom | src/JSDOM/Generated/SVGPathSegCurvetoQuadraticAbs.hs | Haskell | mit | 3,385 |
module ZoomHub.Web.Types.EmbedConstraint
( EmbedConstraint (..),
)
where
import Data.Bifunctor (first)
import qualified Data.Text as T
import Servant (FromHttpApiData, parseUrlPiece)
import ZoomHub.Web.Types.OpenSeadragonViewerConfig (Constraint)
import qualified ZoomHub.Web.Types.OpenSeadragonViewerConfig as Cons... | zoomhub/zoomhub | src/ZoomHub/Web/Types/EmbedConstraint.hs | Haskell | mit | 773 |
{- provides 'setupGUI' the main gui initialization
function. (using the module Language.Astview.Menu to build the menu bar)
-
-}
module Language.Astview.Gui.Init(setupGUI) where
import Language.Astview.Gui.Types
import Language.Astview.Gui.Actions
import Language.Astview.Gui.Menu
import Language.Astview.Languages(la... | jokusi/Astview | src/gui/Language/Astview/Gui/Init.hs | Haskell | mit | 3,295 |
{-# LANGUAGE
StandaloneDeriving,
DeriveFunctor,
FlexibleInstances,
KindSignatures,
ConstraintKinds,
MultiParamTypeClasses,
NoImplicitPrelude
#-}
module OctoTactics.Util.ImprovedPrelude (
module Prelude,
module OctoTactics.Util.ImprovedPrelude,
module OctoTactics.Util.Combina... | Solonarv/OctoTactics | OctoTactics/Util/ImprovedPrelude.hs | Haskell | mit | 573 |
module Main where
import Control.Monad.Reader (runReaderT)
import qualified Data.Set as Set
import Web.Twitter.Conduit (newManager, tlsManagerSettings)
import Control.Monad.Base (MonadBase, liftBase)
import Web.Twitter.PleaseCaption.Config (getTWInfo)
import qualified Web.Twitter.PleaseCaption.Client as Client
main ... | stillinbeta/pleasecaption | exe/Main-unfollow.hs | Haskell | mit | 917 |
module Options ( ColourSpace(..),
Settings(..),
getSettings ) where
-- This has been cribbed from:
-- http://www.haskell.org/haskellwiki/High-level_option_handling_with_GetOpt
-- At the current stage of my Haskell development, this is basically
-- black magic to me :P I'll figure it ... | Xophmeister/tapestry | Options.hs | Haskell | mit | 2,544 |
{-# htermination (fmapMaybe :: (a -> b) -> Maybe a -> Maybe b) #-}
import qualified Prelude
data MyBool = MyTrue | MyFalse
data List a = Cons a (List a) | Nil
data Maybe a = Nothing | Just a ;
fmapMaybe :: (c -> b) -> Maybe c -> Maybe b
fmapMaybe f Nothing = Nothing;
fmapMaybe f (Just x) = Just (f x);... | ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/fmap_1.hs | Haskell | mit | 322 |
{-# LANGUAGE BangPatterns #-}
module Maze (renderGrid, genMaze) where
import Control.Monad.State
import Linear
import System.Random
-- | Alias for the maze generator
type MazeGen a = State (StdGen, Grid) a
-- | The grid is a collection of all non-wall pieces
type Grid = [Point]
-- | A position inside the grid type
... | TomSmeets/maze | src/Maze.hs | Haskell | mit | 2,276 |
import Utils
answer = goodPairs
where interval = [3..10000000]
asDigits = map numberToDigits interval
sumFactorials = foldl (\a -> \b -> a + (factorial b)) 0
sums = map sumFactorials asDigits
pairs = zip interval sums
goodPairs = filter (\(a,... | arekfu/project_euler | p0034/p0034.hs | Haskell | mit | 338 |
module Account5 where
import System.IO
import Control.Concurrent.STM
launchMissiles :: IO ()
launchMissiles = hPutStr stdout "Zzzing!"
main = do
xv <- atomically (newTVar 2)
yv <- atomically (newTVar 1)
atomically (do x <- readTVar xv
y <- readTVar yv
if x > y then ... | NickAger/LearningHaskell | ParallelConcurrent/2-BankAccount.hsproj/Account5.hs | Haskell | mit | 379 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TupleSections #-}
module Main where
import Debian.Control.ByteString
import Debian.Relation
import Data.Graph.Inductive
import Data.Tree
import Data.Set (fromList, member)
import Data.List (find, intercalate, sortOn)
import Data.Maybe
import Data.... | neilmayhew/RepoExplorer | DependencyRoots.hs | Haskell | mit | 3,900 |
{-
Copyright (c) 2008
Russell O'Connor
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, distribute... | haasn/colour | Data/Colour/CIE/Illuminant.hs | Haskell | mit | 3,431 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS_GHC -fdefer-type-errors #-}
module Handler.GameJson where
import Import
import Control.Lens (makeLenses, (^.), (^?), (.~), (&))
import qualified Data.Aeson.Lens as AL (key, _Bool, _Integer)
im... | jabaraster/minibas-web | Handler/GameJson.hs | Haskell | mit | 6,539 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html
module Stratosphere.Resources.KMSKey where
import Stratosphere.ResourceImports
import Stratospher... | frontrowed/stratosphere | library-gen/Stratosphere/Resources/KMSKey.hs | Haskell | mit | 3,564 |
-- | Popular transformation functions for the 'String' observation type.
module Control.Monad.Ox.String
( prefix
, suffix
, substr
, shape
, pack
) where
import qualified Data.Char as C
import qualified Data.List as L
-- | Prefix of the given size or 'Nothing' if the size exceeds the
-- length of the string.
prefix ... | kawu/monad-ox | Control/Monad/Ox/String.hs | Haskell | bsd-2-clause | 1,676 |
module Unit
( tests
) where
import Test.Tasty
import qualified Unit.CommitQueue
tests :: TestTree
tests = testGroup "Unit tests"
[ Unit.CommitQueue.tests
]
| sgraf812/feed-gipeda | tests/Unit.hs | Haskell | bsd-3-clause | 178 |
{-# LANGUAGE MultiParamTypeClasses, UndecidableInstances, FlexibleInstances #-}
module Database.MetaStorage.Types (MetaStorageT (..), mkMetaStorageDefault) where
import Prelude hiding (FilePath)
import Filesystem.Path.CurrentOS
import Crypto.Hash
import Filesystem
import Control.Monad.IO.Class
import Database.MetaSt... | alios/metastorage | Database/MetaStorage/Types.hs | Haskell | bsd-3-clause | 788 |
{-# LANGUAGE FlexibleContexts #-}
module Charter(singleWeightChangeChart) where
import GHC.TypeLits
import Graphics.Rendering.Chart.Easy
import Graphics.Rendering.Chart.Gtk
import Minimizer
import Control.Lens
import Data.Proxy
import Brain
import Simulator
import Convenience
import SizedL
import Control.Monad.Random
... | bmabsout/neural-swarm | src/Charter.hs | Haskell | bsd-3-clause | 1,273 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module Servant.ContentType.Processable where
import Data.ByteString.Lazy (ByteString... | notcome/liu-ms-adult | src/Servant/ContentType/Processable.hs | Haskell | bsd-3-clause | 1,111 |
module Options.Language where
import Types
languageOptions :: [Flag]
languageOptions =
[ flag { flagName = "-fconstraint-solver-iterations=⟨n⟩"
, flagDescription =
"*default: 4.* Set the iteration limit for the type-constraint "++
"solver. Typically one iteration suffices; so please "... | gridaphobe/ghc | utils/mkUserGuidePart/Options/Language.hs | Haskell | bsd-3-clause | 29,509 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DataKinds #-}
module Main
where
import SubHask
import SubHask.Algebra.Array
import SubHask.Algebra.Group
import SubHask.Algebra.Container
import SubHask.Algebra.Logic
import SubHask.Algebra.Metric
import SubHask.Algebra.Parallel
impo... | cdepillabout/subhask | test/TestSuite.hs | Haskell | bsd-3-clause | 5,624 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
module HipChat.Types.API where
import Data.Text (Text)
import Servant.API
import HipChat.Types.Auth
import HipChat.Types.Common
import HipChat.Types.Extensions
import ... | oswynb/hipchat-hs | lib/HipChat/Types/API.hs | Haskell | bsd-3-clause | 2,422 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeSynonymInstances #-}
module DataFlow.Graphviz.Renderer (
renderGraphviz
) where
import Data.Char
import Data.List.Utils
import Text.Printf
import DataFlow.PrettyRenderer
import DataFlow.Graphviz
convertNewline :: String -> String
convertNewline = replace "\n" ... | sonyxperiadev/dataflow | src/DataFlow/Graphviz/Renderer.hs | Haskell | bsd-3-clause | 2,530 |
module Day5 where
import Data.List (group, isInfixOf, tails)
threeVowels :: String -> Bool
threeVowels = (>= 3) . length . filter (`elem` "aeiouAEIOU")
doubleLetter :: String -> Bool
doubleLetter = any ((>1) . length) . group
noBadStrings :: String -> Bool
noBadStrings input = all (not . flip isInfixOf input) badst... | yarbroughw/advent | src/Day5.hs | Haskell | bsd-3-clause | 1,186 |
module Main where
import Network.C10kServer
import Network.Salvia.Handler.ColorLog
import Network.Salvia.Handler.ExtendedFileSystem
import Network.Salvia.Handlers
import Network.Salvia.Impl.C10k
import System.IO
main :: IO ()
main =
start "127.0.0.1" "root@localhost"
C10kConfig
{ initHook = ret... | sebastiaanvisser/salvia-demo | src/ServeDemo.hs | Haskell | bsd-3-clause | 813 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Network.SSH.LoadKeys
import Network.SSH.Messages
import Network.SSH.Server
import Control.Concurrent
import Control.Exception
import Control.Mo... | glguy/ssh-hans | server/Main.hs | Haskell | bsd-3-clause | 5,609 |
-------------------------------------------------------------------------------
-- |
-- Module : Generator.Printer
-- Copyright : (c) 2016 Michael Carpenter
-- License : BSD3
-- Maintainer : Michael Carpenter <oldmanmike.dev@gmail.com>
-- Stability : experimental
-- Portability : portable
--
-------... | oldmanmike/hs-minecraft-protocol | generate/src/Generator/Printer.hs | Haskell | bsd-3-clause | 637 |
module Evaluator.FreeVars (
renamingFreeVars,
inFreeVars,
pureHeapFreeVars, pureHeapOpenFreeVars,
stackFreeVars, stackFrameFreeVars,
stateFreeVars
) where
import Evaluator.Syntax
import Core.FreeVars
import Core.Renaming
import Renaming
import Utilities
import qualified Data.Map as M
import qu... | batterseapower/supercompilation-by-evaluation | Evaluator/FreeVars.hs | Haskell | bsd-3-clause | 1,724 |
module Process.PeerManager
( start
) where
{-
import Control.Applicative
import Control.Concurrent
import Control.Concurrent.STM
import Control.DeepSeq
import Control.Monad.State
import Control.Monad.Reader
import Data.Array
import qualified Data.Map as M
import qualified Network.Socket as Sock
import Syst... | artems/htorr | src/Process/PeerManager.hs | Haskell | bsd-3-clause | 7,426 |
{-# LANGUAGE StandaloneDeriving #-}
module Web.Rest.HTTP (
runRestT,Hostname,Port,RestError(..)
) where
import Web.Rest.Internal (
RestT,RestF(Rest),Method(..),
Request(..),Response(..))
import Network.HTTP (
simpleHTTP,mkHeader,lookupHeader,
HeaderName(HdrAccept,HdrContentType,HdrContentLengt... | phischu/haskell-rest | src/Web/Rest/HTTP.hs | Haskell | bsd-3-clause | 3,350 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE CPP #-}
modul... | liamoc/dixi | Dixi/API.hs | Haskell | bsd-3-clause | 4,474 |
module Genotype.Processor.KeepColumnNumbers
( process
) where
import Control.Applicative (many)
import Data.Attoparsec.Text (Parser)
import Genotype.Processor (Processor)
import qualified Data.Attoparsec.Text as P
import qualified Data.Text as T
import qualified Data.Text.IO as T
import Genotype.Types
getColumn... | Jonplussed/genotype-parser | src/Genotype/Processor/KeepColumnNumbers.hs | Haskell | bsd-3-clause | 998 |
------------------------------------------------------------------------------
-- |
-- Maintainer : Ralf Laemmel, Joost Visser
-- Stability : experimental
-- Portability : portable
--
-- This module is part of 'StrategyLib', a library of functional strategy
-- combinators, including combinators for generic traversal. ... | forste/haReFork | StrategyLib-4.0-beta/library/OverloadingTheme.hs | Haskell | bsd-3-clause | 4,178 |
module CommandLine (
optDescrs, cmdLineArgsMap, cmdFlavour, lookupFreeze1, cmdIntegerSimple,
cmdProgressInfo, cmdConfigure, cmdCompleteSetting,
cmdDocsArgs, lookupBuildRoot, TestArgs(..), TestSpeed(..), defaultTestArgs
) where
import Data.Either
import qualified Data.HashMap.Strict as Map
import Data.L... | sdiehl/ghc | hadrian/src/CommandLine.hs | Haskell | bsd-3-clause | 14,186 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
module Hchain.BlockChain (BlockChain, Hash, Block (..), content, BContent (..), isValidChain, addBlock, mkInitialChain, addValidBlock, mineBlock) where
import qualified Data.ByteString.Lazy.Char8 as C8
import Control.Lens
import ... | jesuspc/hchain | src/hchain/BlockChain.hs | Haskell | bsd-3-clause | 2,682 |
{-# LANGUAGE ImplicitParams #-}
----------------------------------------------------------------------------
-- |
-- Module : DART.Run
-- Copyright : (c) Carlos López-Camey, University of Freiburg
-- License : BSD-3
--
-- Maintainer : c.lopez@kmels.net
-- Stability : stable
--
--
-- Runs the interpr... | kmels/dart-haskell | src/DART/Run.hs | Haskell | bsd-3-clause | 7,988 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
module Lib
( getKey
, startAPI
, verboseLog
) where
import ClassyPrelude
import Types.API.Base
import Types.General
import Types.Options
getKey :: APICaller APIKey
getKey = asks apiKey
isVerbose :: APICaller Bool
isVerbose = do
verbosit... | JoeMShanahan/blizzard-haskell-api | src/Lib.hs | Haskell | bsd-3-clause | 478 |
{-# LANGUAGE CPP, NondecreasingIndentation, ScopedTypeVariables #-}
-- -----------------------------------------------------------------------------
--
-- (c) The University of Glasgow, 2005-2012
--
-- The GHC API
--
-- -----------------------------------------------------------------------------
module GHC (
... | ryantm/ghc | compiler/main/GHC.hs | Haskell | bsd-3-clause | 54,766 |
{-# LANGUAGE GADTs, RankNTypes, ScopedTypeVariables #-}
{-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleContexts, FlexibleInstances #-}
-- | 'ProgramAlt' example: simple applicative parsers
module Parser where
import Control.Applicative
import Control.Alternative.Operational
import Control.Operational.Instruction
im... | sacundim/free-operational | examples/Parser.hs | Haskell | bsd-3-clause | 5,927 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE Rank2T... | f-me/snap-core | src/Snap/Internal/Types.hs | Haskell | bsd-3-clause | 42,614 |
module Fibon.Run.BenchmarkRunner (
RunResult(..)
, RunFailure(..)
, Fibon.Run.BenchmarkRunner.run
)
where
import Control.Concurrent
import Control.Monad
import Control.Exception
import qualified Data.ByteString as B
import Data.Maybe
import Data.Time.Clock
import qualified Data.Vector.Unboxed as Vector
import ... | dmpots/fibon | tools/fibon-run/Fibon/Run/BenchmarkRunner.hs | Haskell | bsd-3-clause | 6,130 |
{-
Copyright 2012-2013 Google Inc. 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://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... | mzero/plush | src/Plush/Run/BuiltIns/Syntax.hs | Haskell | apache-2.0 | 4,587 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
module Path.CheckInstall where
import Control.Monad (unless)
import Control.Monad.Extra (anyM, (&&^))
import Control.Monad.IO.Class
import Control.Monad.Logger
import ... | mrkkrp/stack | src/Path/CheckInstall.hs | Haskell | bsd-3-clause | 2,672 |
-- this file illustrates several uses of `zoom`
-- one of them is quadratic in the length of the file
-- since it has to decode and encode repeatedly,
-- and is thus no good on long files.
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE BangPatterns#-}
{-# LANGUAGE RankNTypes #-}
import Blaze.ByteString.B... | bitemyapp/text-pipes | examples/zoom.hs | Haskell | bsd-3-clause | 5,180 |
module RunCommand (runCommandStrWait) where
import System.Process
import System.Exit
import System.IO
import Control.Concurrent
import Control.Concurrent.Chan
import Data.Either
type Pipe = Chan (Either Char ())
pipeGetContents :: Pipe -> IO String
pipeGetContents p =
do
s <- getChanContents p
return $ m... | bvdelft/parac2 | simpletestsuite/RunCommand.hs | Haskell | bsd-3-clause | 1,866 |
{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
\section{SetLevels}
***************************
Overview
***************************
1. We attach binding levels to Core bindings, in preparation for floating
outwards (@FloatOut@).
2. We also let... | shlevy/ghc | compiler/simplCore/SetLevels.hs | Haskell | bsd-3-clause | 70,015 |
{-# LANGUAGE OverloadedStrings #-}
module NativeWhitelist (read) where
import Prelude hiding (read)
import Data.Aeson as Json
import qualified Data.ByteString.Lazy as LBS
import qualified System.Directory as Dir
import System.IO
import qualified Elm.Package.Name as Name
nativeWhitelist :: FilePath
nativeWhitelist =... | Dedoig/package.elm-lang.org | backend/NativeWhitelist.hs | Haskell | bsd-3-clause | 750 |
-- Unlike the rest of xmonad, this file is copyright under the terms of the
-- GPL.
--
-- Generates man/xmonad.1 from man/xmonad.1.in by filling the list of
-- keybindings with values scraped from Config.hs
--
-- Uses cabal to grab the xmonad version from xmonad.cabal
--
-- Uses pandoc to convert the "xmonad.1.markdow... | atupal/xmonad-mirror | xmonad/util/GenerateManpage.hs | Haskell | mit | 3,525 |
<?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="ar-SA">
<title>Reveal | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapref locat... | thc202/zap-extensions | addOns/reveal/src/main/javahelp/org/zaproxy/zap/extension/reveal/resources/help_ar_SA/helpset_ar_SA.hs | Haskell | apache-2.0 | 967 |
module PatternIn3 where
sumSquares y
= let x = 1
in (case x of
0 -> 0
x -> x ^ pow) +
(sq y)
where
sq 0 = 0
sq x = x ^ pow
sumSquares_1 y
= let x = 1
in case x of
0 -> return 0
x -> return 1
where
... | kmate/HaRe | old/testing/simplifyExpr/PatternIn3AST.hs | Haskell | bsd-3-clause | 367 |
{-# LANGUAGE TemplateHaskell #-}
module T16195 where
import T16195A
main2 :: IO ()
main2 = return ()
main :: IO ()
main = $$foo
main3 :: IO ()
main3 = putStrLn ($$showC $$unitC)
| sdiehl/ghc | testsuite/tests/th/T16195.hs | Haskell | bsd-3-clause | 184 |
module A3 where
data BTree a
= Empty | T a (BTree a) (BTree a) deriving Show
buildtree :: Ord a => [a] -> BTree a
buildtree [] = Empty
buildtree ((x : xs)) = insert x (buildtree xs)
insert :: Ord a => a -> (BTree a) -> BTree a
insert val (t@(T val Empty Empty))
= T val Empty result where result = t
inse... | kmate/HaRe | old/testing/unfoldAsPatterns/A3AST.hs | Haskell | bsd-3-clause | 515 |
{-
We expect to get a suggestion to add 'type' keyword
and enable TypeOperators extension.
-}
{-# LANGUAGE TypeOperators #-}
module T11432 ((-.->)(..)) where
newtype (f -.-> g) a = Fn { apFn :: f a -> g a }
| ezyang/ghc | testsuite/tests/module/T11432.hs | Haskell | bsd-3-clause | 209 |
-- Basic Tic Tac Toe game against the AI, for testing
import Core
import Algo
import AI
runCycle :: Board -> Board
runCycle board = if checkGameOver board
then board
else
makeMove board PO
runMove :: Board -> IO (Bool, Player, Board)
runMove board = do
if checkGameOver board then do
retur... | quantum-dan/tictactoe-ai | Play.hs | Haskell | mit | 1,254 |
module Main (
main
) where
import RunDataAssocWekaApriorySimple
import DataAssociation
import System.Environment
import System.Exit
import System.IO
import Data.Maybe
import Control.Monad
main :: IO ()
main = getArgs >>= parse
maybeRead = fmap fst . listToMaybe . reads
maybeReadInUnit :: String -> Maybe Float
... | fehu/min-dat--a-priori | core/src/Main.hs | Haskell | mit | 1,197 |
module LogicProver.Prover (isValid) where
import qualified Data.Map as M
import LogicProver.Lang
-- The type of the proof tree used for determining the validity of a proposition
data ProofTree = Leaf Bool Prop -- used, prop
| Branch1 Bool Prop ProofTree -- used, prop, l... | igorii/LogicProver | LogicProver/Prover.hs | Haskell | mit | 6,837 |
-- Speed Control
-- http://www.codewars.com/kata/56484848ba95170a8000004d/
module Codewars.G964.Gps1 where
gps :: Int -> [Double] -> Int
gps _ [] = 0
gps _ [x] = 0
gps s xs = floor . maximum $ zipWith (\a b -> (b-a)*60*60 / fromIntegral s) xs (tail xs) | gafiatulin/codewars | src/7 kyu/Gps1.hs | Haskell | mit | 260 |
{-# LANGUAGE CPP #-}
module Stackage.Config where
import Control.Monad (when)
import Control.Monad.Trans.Writer (execWriter, tell)
import qualified Data.Map as Map
import Data.Set (fromList, singleton)
import Distribution.Text ... | sinelaw/stackage | Stackage/Config.hs | Haskell | mit | 13,098 |
{-# LANGUAGE RecordWildCards #-}
-- | Defines the XglImporter.
{- Importer notes:
- Ignores ambient and spherermap lights.
-}
module Codec.Soten.Importer.XglImporter (
XglImporter(..)
-- Only for testing purpose.
, transformLights
, transformMaterials
, transformToScene
) where
import Data.Lis... | triplepointfive/soten | src/Codec/Soten/Importer/XglImporter.hs | Haskell | mit | 7,173 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE UndecidableInstances #-}
module Betfair.StreamingAPI.Requests.AuthenticationMe... | joe9/streaming-betfair-api | src/Betfair/StreamingAPI/Requests/AuthenticationMessage.hs | Haskell | mit | 1,182 |
module GHCJS.DOM.WebGLCompressedTextureATC (
) where
| manyoo/ghcjs-dom | ghcjs-dom-webkit/src/GHCJS/DOM/WebGLCompressedTextureATC.hs | Haskell | mit | 55 |
import XMonad
-- LAYOUTS
import XMonad.Layout.Spacing
import XMonad.Layout.Fullscreen
import XMonad.Layout.NoBorders
import XMonad.Layout.PerWorkspace
import XMonad.Layout.SimplestFloat
import XMonad.Layout.ResizableTile
import XMonad.Layout.Circle
import XMonad.Layout.Grid
import XMonad.Layout.IM
-- WINDOW RULES
impo... | Bryan792/dotfiles | .xmonad/xmonad.hs | Haskell | mit | 13,686 |
module Rebase.System.IO.Unsafe
(
module System.IO.Unsafe
)
where
import System.IO.Unsafe
| nikita-volkov/rebase | library/Rebase/System/IO/Unsafe.hs | Haskell | mit | 92 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.