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 |
|---|---|---|---|---|---|
module Lang.Csharp where
import Lang.Value
import Generic.Control.Function
import Generic.Data.Bool
import Generic.Data.Either
import Generic.Data.List
import Generic.Data.Maybe
import Generic.Data.Number
import Generic.Data.Tuple
import qualified Prelude
data Csharp
type Cs a = Val Csharp a
instance Prelude.Show (P... | tomlokhorst/AwesomePrelude | src/Lang/Csharp.hs | Haskell | bsd-3-clause | 2,713 |
module System.Taffybar.Widget.Text.MemoryMonitor (textMemoryMonitorNew, showMemoryInfo) where
import Control.Monad.IO.Class ( MonadIO )
import qualified Data.Text as T
import qualified Text.StringTemplate as ST
import System.Taffybar.Information.Memory
import System.Taffybar.Widget.Generic.PollingLabel ( pollingLabelN... | teleshoes/taffybar | src/System/Taffybar/Widget/Text/MemoryMonitor.hs | Haskell | bsd-3-clause | 2,323 |
module TodoFormat
(
MyTime
, hasTime
, whenToRec
, unWhen
, whenToDay
, whenToTime
, whenToDayOfMonth
, whenToDayOfWeek
, whenToDuration
, matchDay
, compareTime
, toMyTime
, toMyTimeAllDay
, daily
, monthl... | sejdm/smartWallpaper | src/TodoFormat.hs | Haskell | bsd-3-clause | 3,701 |
-- | Double-buffered storage
--
-- This module provides a safer alternative to the methods of the classes
-- 'Manifestable' and 'Manifestable2':
--
-- * 'store' instead of 'manifest'
-- * 'store2' instead of 'manifest2'
-- * 'setStore' instead of 'manifestStore'
-- * 'setStore2' instead of 'manifestStore2'
--
-- Consid... | kmate/raw-feldspar | src/Feldspar/Data/Buffered.hs | Haskell | bsd-3-clause | 6,440 |
{-|
Funsat aims to be a reasonably efficient modern SAT solver that is easy to
integrate as a backend to other projects. SAT is NP-complete, and thus has
reductions from many other interesting problems. We hope this implementation is
efficient enough to make it useful to solve medium-size, real-world problem
mappe... | dbueno/funsat | src/Funsat/Solver.hs | Haskell | bsd-3-clause | 35,895 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Bench
-- Copyright : Johan Tibell 2011
-- License : BSD3
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This is the entry point into running the benchmarks in a... | sopvop/cabal | Cabal/Distribution/Simple/Bench.hs | Haskell | bsd-3-clause | 5,187 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
module Data.Logic.Boolean.Class where
import Control.Applicative
import Data.Functor.Identity
import Data.Functor.Compose
class Boolean r where
tt :: r
ff :: r
fromBool :: Bool -> r
fromBool b = if b then tt else ff
data AnyBoolean = AnyBoolean
... | kylcarte/finally-logical | src/Data/Logic/Boolean/Class.hs | Haskell | bsd-3-clause | 1,653 |
module Paths_AutoComplete (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName
) where
import Data.Version (Version(..))
import System.Environment (getEnv)
version :: Version
version = Version {versionBranch = [0,1], versionTags = []}
bindir, libdir, datadir, libexecdir :: FilePa... | satvikc/Trie | dist/build/autogen/Paths_AutoComplete.hs | Haskell | bsd-3-clause | 1,013 |
import System.Environment
import System.Directory
import System.IO
import Control.Exception
import qualified Data.ByteString.Lazy as B
main = do
(fileName1:fileName2:_) <- getArgs
copy fileName1 fileName2
copy source dest = do
contents <- B.readFile source
bracketOnError
(openTempFile "." "tem... | ku00/h-book | src/ByteStringCopy.hs | Haskell | bsd-3-clause | 575 |
{-# LANGUAGE DeriveDataTypeable #-}
import System.Console.CmdArgs
import Data.Word
import Contract.Types
import Contract.Symbols
data Arguments = Arguments { symbol :: Symbol
, startTime :: TimeOffset
, startRate :: Rate
, points :... | thlorenz/Pricetory | src/spikes/CmdArgsSample.hs | Haskell | bsd-3-clause | 830 |
{-# LANGUAGE TemplateHaskell, ScopedTypeVariables#-}
module UUTReader where
import Control.Monad
import Data.String.Utils
import Language.Haskell.TH
import GHC.Generics
import Sized
import Arbitrary
import TemplateAllv
import TemplateArbitrary
import TemplateSized
import UUT
import UUTReaderUtilities
import UUTReader... | pegartillo95/CaseGenerator | src/UUTReader.hs | Haskell | bsd-3-clause | 1,873 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
module Application (
app
) where
import Control.Exception
import Control.Monad (when)
import Data.Default.Class
import Data.Int (Int64)
import Data.Monoid
import Data.Pool (Pool)
import Data.Text.Lazy as Text
impo... | zalora/sproxy-web | src/Application.hs | Haskell | mit | 12,687 |
module Tandoori.GHC.Parse (parseMod, getDecls) where
import Tandoori.GHC.Internals
import HsSyn (hsmodDecls)
import Parser (parseModule)
import Lexer (unP, mkPState, ParseResult(..))
import StringBuffer (hGetStringBuffer)
import DynFlags (defaultDynFlags)
getDecls mod = hsmodDecls $ unLoc mod
parseM... | bitemyapp/tandoori | src/Tandoori/GHC/Parse.hs | Haskell | bsd-3-clause | 746 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.GHC
-- Copyright : Isaac Jones 2003-2007
-- License : BSD3
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This is a fairly large module. It... | seereason/cabal | Cabal/Distribution/Simple/GHC.hs | Haskell | bsd-3-clause | 50,626 |
-- (c) The University of Glasgow, 1997-2006
{-# LANGUAGE BangPatterns, CPP, MagicHash, UnboxedTuples,
GeneralizedNewtypeDeriving #-}
{-# OPTIONS_GHC -O -funbox-strict-fields #-}
-- We always optimise this, otherwise performance of a non-optimised
-- compiler is severely affected
-- |
-- There are two principal st... | olsner/ghc | compiler/utils/FastString.hs | Haskell | bsd-3-clause | 20,911 |
module Snap.App
(module Snap.Core
,module Snap.App.Types
,module Snap.App.Controller
,module Snap.App.Model)
where
import Snap.Core
import Snap.App.Types
import Snap.App.Controller
import Snap.App.Model
| lwm/haskellnews | upstream/snap-app/src/Snap/App.hs | Haskell | bsd-3-clause | 214 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE ExistentialQuantification, FlexibleContexts, FlexibleInstances, StandaloneDeriving #-}
--------------------------------------------------------------------
-- |
-- Module : XMonad.Util.NamedActions
-- Copyright : 2009 Adam Vogt <vogt.adam@gmail.com>
-- License... | pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Util/NamedActions.hs | Haskell | bsd-2-clause | 12,707 |
module FVTests where
import FVision
import GraphicsZ
import GeometryZ
import qualified GeometryStatic as GS
import qualified Graphics as G
import FRP
import FRPSignal
import FRPTask
import qualified NXVision2 as XV
import IOExts (unsafePerformIO)
dotAt c p = withColor c $ moveTo p $ stretch 10 $ circle
testF p = r... | jatinshah/autonomous_systems | project/fvision.hugs/fvtests.hs | Haskell | mit | 10,742 |
main = print $ foldl1 (+) [i | i <- [0..(1000 - 1)], i `mod` 3 == 0 || i `mod` 5 == 0]
| liuyang1/euler | 001.hs | Haskell | mit | 87 |
{-# LANGUAGE ScopedTypeVariables #-}
-- | Effectful functions that create and convert disk image files.
module B9.DiskImageBuilder
( materializeImageSource,
substImageTarget,
preferredDestImageTypes,
preferredSourceImageTypes,
resolveImageSource,
createDestinationImage,
resizeImage,
impor... | sheyll/b9-vm-image-builder | src/lib/B9/DiskImageBuilder.hs | Haskell | mit | 19,278 |
module Graphics.Urho3D.UI.Internal.FileSelector(
FileSelector
, fileSelectorCntx
, sharedFileSelectorPtrCntx
, weakFileSelectorPtrCntx
, SharedFileSelector
, WeakFileSelector
, FileSelectorEntry(..)
, HasName(..)
, HasDirectory(..)
) where
import Control.Lens
import GHC.Generics
import Graphics.U... | Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/UI/Internal/FileSelector.hs | Haskell | mit | 1,165 |
module Main where
import System.Environment
import Lib
main :: IO ()
main = do
env <- getEnvironment
let port = maybe 3000 read $ lookup "PORT" env
startApp port
| aaronshim/whenisbad | app/Main.hs | Haskell | mit | 170 |
module System.AtomicWrite.Writer.Text.BinarySpec (spec) where
import Test.Hspec (Spec, describe, it,
shouldBe)
import System.AtomicWrite.Writer.Text.Binary (atomicWriteFile,
... | stackbuilders/atomic-write | spec/System/AtomicWrite/Writer/Text/BinarySpec.hs | Haskell | mit | 5,286 |
module Oracles.Flag (
Flag (..), flag, platformSupportsSharedLibs,
ghcWithSMP, ghcWithNativeCodeGen, supportsSplitObjects
) where
import Hadrian.Oracles.TextFile
import Base
import Oracles.Setting
data Flag = ArSupportsAtFile
| CrossCompiling
| GccIsClang
| GccLt44
... | izgzhen/hadrian | src/Oracles/Flag.hs | Haskell | mit | 2,920 |
module Language.Binal.StyleGuidance where
import Control.Applicative
import Control.Monad
import Control.Monad.Trans
import Control.Monad.State
import qualified Text.Trifecta as T
import qualified Text.Trifecta.Delta as D
import Language.Binal.Types
import qu... | pasberth/binal1 | Language/Binal/StyleGuidance.hs | Haskell | mit | 3,787 |
module Phb.Db
( module Phb.Db.Internal
, module Phb.Db.Esqueleto
, module Phb.Db.Event
, module Phb.Db.Backlog
, module Phb.Db.Customer
, module Phb.Db.Action
, module Phb.Db.Person
, module Phb.Db.PersonLogin
, module Phb.Db.Project
, module Phb.Db.Heartbeat
, module Phb.Db.Success
, module Phb... | benkolera/phb | hs/Phb/Db.hs | Haskell | mit | 965 |
{-# LANGUAGE OverloadedStrings #-}
-- | Style attributes.
--
-- See http://www.graphviz.org/doc/info/attrs.html#k:style for more info on graphviz styles
module Text.Dot.Attributes.Styles where
import Text.Dot.Types.Internal
-- * Style attributes
style :: AttributeName
style = "style"
-- * Style attribute... | NorfairKing/haphviz | src/Text/Dot/Attributes/Styles.hs | Haskell | mit | 760 |
module Main where
import Control.Concurrent
import Control.Monad
import Network
import System.IO
main = do
putStrLn "aclick client"
forever $ do
h <- connectTo "localhost" (PortNumber (fromIntegral 6666))
hGetLine h
getLine >>= hPutStrLn h
hGetLine h >>= putStrLn
hClose h
| ZerglingRush/aclick | src/Client.hs | Haskell | mit | 299 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as BC
import Data.FileEmbed (embedFile)
import Data.Foldable (traverse_)
import Data.List ... | genos/online_problems | advent_of_code_2016/day3/src/Main.hs | Haskell | mit | 1,041 |
{-# LANGUAGE ScopedTypeVariables #-}
module TruthTable.Logic where
import TruthTable.Types
import TruthTable.Mapping
import Data.List (nub)
import qualified Data.Map.Strict as Map
uniqueVariables :: Statement -> [Variable]
uniqueVariables = nub . vars
where vars (StatementResult _) = []
vars (NestedSta... | tjakway/truth-table-generator | src/TruthTable/Logic.hs | Haskell | mit | 3,033 |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.SQLTransaction (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.SQLTransaction
#else
#endif
) where
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
import GHCJS.DOM.JSFFI.SQLTransactio... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/SQLTransaction.hs | Haskell | mit | 335 |
-- |Netrium is Copyright Anthony Waite, Dave Hewett, Shaun Laurens & Contributors 2009-2018, and files herein are licensed
-- |under the MIT license, the text of which can be found in license.txt
--
{-# LANGUAGE DeriveFunctor, GADTs, PatternGuards #-}
module DecisionTreeSimplify (
decisionTreeSimple,
decision... | netrium/Netrium | src/DecisionTreeSimplify.hs | Haskell | mit | 5,104 |
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -O0 -fno-warn-missing-signatures -fno-warn-partial-type-signatures #-}
module Example.Extras where
name = "plugin"
| sboosali/simple-plugins | executables/Example/Extras.hs | Haskell | mit | 165 |
module Jhc.ForeignPtr(
ForeignPtr(),
newPlainForeignPtr_,
newForeignPtr_,
mallocPlainForeignPtrAlignBytes,
mallocForeignPtrAlignBytes,
unsafeForeignPtrToPtr,
castForeignPtr,
touchForeignPtr
) where
import Jhc.Addr
import Jhc.IO
import Jhc.Prim.Rts
import Jhc.Basics
type FinalizerPt... | m-alvarez/jhc | lib/jhc/Jhc/ForeignPtr.hs | Haskell | mit | 2,928 |
module Main where
import Control.Monad
import Control.Concurrent
import Control.Concurrent.STM
import Data.List
import System.Random
fromYear :: Integer
fromYear = 1900
toYear :: Integer
toYear = 1920
supportedYears :: [Integer]
supportedYears = [fromYear .. toYear]
randomYear :: IO Integer
randomYear =
do
g... | hnfmr/beginning_haskell | ex8.2/src/Main.hs | Haskell | mit | 1,268 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
module Text.Inflections.UnderscoreSpec (spec) where
import Test.Hspec
import Text.Inflections
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative
#endif
spec :: Spec
spec = describe "underscore" $
it "converts a word list to snake case" $ d... | stackbuilders/inflections-hs | test/Text/Inflections/UnderscoreSpec.hs | Haskell | mit | 451 |
module Example.Sorting where
import Control.Category hiding ((>>>),(<<<))
import Control.Applicative
import Prelude hiding ((.), id)
import Melchior.Control
import Melchior.Data.String
import Melchior.Dom
import Melchior.Dom.Events
import Melchior.Dom.Html
import Melchior.Dom.Selectors
import Melchior.EventSources.Mo... | kjgorman/melchior | example/assets/hs/sorting.hs | Haskell | mit | 1,565 |
{-# htermination ($!) :: (a -> b) -> a -> b #-}
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Prelude_DOLLARBANG_1.hs | Haskell | mit | 48 |
module JobReport.Insert where
import Control.Monad
import Database.HDBC
import Database.HDBC.Sqlite3
import JobReport.Database
newtype InsertOptions = InsertOptions Working
deriving (Read, Show)
data Job = Job
{ jobName :: String
} deriving (Read, Show)
data Payment = Payment
{ paymentJob :: Job
... | haliner/jobreport | src/JobReport/Insert.hs | Haskell | mit | 2,126 |
import Data.List
import Data.Char
vowels = "aeiou"
doubles = [ [c, c] | i <- [0..25], let c = chr (ord 'a' + i) ]
bad = ["ab", "cd", "pq", "xy"]
good s = hasVowels && hasDoubles && notBad
where hasVowels = length (filter (`elem` vowels) s) >= 3
hasDoubles = any (`isInfixOf` s) doubles
notBad = not ... | msullivan/advent-of-code | 2015/A5a.hs | Haskell | mit | 434 |
module Main where
-- • How many different ways can you find to write allEven?
allEvenComprehension :: [Integer] -> [Integer]
allEvenComprehension list = [x | x <- list, even x]
allEvenFilter :: [Integer] -> [Integer]
allEvenFilter list = filter even list
-- • Write a function that takes a list and returns the... | hemslo/seven-in-seven | haskell/day1/day1.hs | Haskell | mit | 1,400 |
-- From a blog post: http://www.jonmsterling.com/posts/2012-01-12-unifying-monoids-and-monads-with-polymorphic-kinds.html
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances, FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
... | ghcjs/ghcjs | test/ghc/polykinds/monoidsTF.hs | Haskell | mit | 4,111 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
-- Type definitions to avoid circular imports.
module Language.K3.Codegen.CPP.Materialization.Hints where
import Control.DeepSeq
import Data.Binary
import Data.Hashable
import Data.Serialize
import Data.Typeable
import GHC.Generics (Generic)
data Met... | DaMSL/K3 | src/Language/K3/Codegen/CPP/Materialization/Hints.hs | Haskell | apache-2.0 | 805 |
module Str.String where
import Prelude hiding (null)
import qualified Prelude as P
type Str = String
null :: Str -> Bool
null = P.null
singleton :: Char -> Str
singleton c = [c]
splits :: Str -> [(Str, Str)]
splits [] = [([], [])]
splits (c:cs) = ([], c:cs):[(c:s1,s2) | (s1,s2) <- splits cs]
parts :: Str -> [[Str... | DanielG/cabal-helper | tests/bkpregex/str-impls/Str/String.hs | Haskell | apache-2.0 | 423 |
module IndentInBracesAgain where
f = r{ render = do make
return f } | Atsky/haskell-idea-plugin | data/indentTests/IndentInBracesAgain.hs | Haskell | apache-2.0 | 87 |
-- | Settings are centralized, as much as possible, into this file. This
-- includes database connection settings, static file locations, etc.
-- In addition, you can configure a number of different aspects of Yesod
-- by overriding methods in the Yesod typeclass. That instance is
-- declared in the Foundation.hs file.... | tmiw/4peas | Settings.hs | Haskell | bsd-2-clause | 2,645 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QGraphicsSceneHelpEvent.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:21
Warning : this file is machine gene... | keera-studios/hsQt | Qtc/Gui/QGraphicsSceneHelpEvent.hs | Haskell | bsd-2-clause | 4,319 |
{-# LANGUAGE TupleSections #-}
{-| Auto-repair tool for Ganeti.
-}
{-
Copyright (C) 2013 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the... | apyrgio/snf-ganeti | src/Ganeti/HTools/Program/Harep.hs | Haskell | bsd-2-clause | 20,587 |
{-# LANGUAGE OverloadedStrings #-}
module CurrentCmd where
import Data.Text (Text)
import qualified Data.Text as T
import Text.Printf
-- friends
import Time
import Record
import RecordSet
-- This command doesn't actually use any command line arguments
-- but still respects the spec.
currentCmd :: ZonedTime -> [Strin... | sseefried/task | src/CurrentCmd.hs | Haskell | bsd-3-clause | 627 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIO... | adinapoli/myo | src/Myo/WebSockets/Types.hs | Haskell | bsd-3-clause | 11,449 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
module Test.Tasty.Hspec (
-- * Test
testSpec
-- * Options
-- | === Re-exported from <https://hackage.haskell.org/package/tasty-smallcheck tasty-smallcheck>
, SmallCheckDepth(..)
-- | === Re-exported from <https://hackage.haskell.org/pac... | markus1189/tasty-hspec | Test/Tasty/Hspec.hs | Haskell | bsd-3-clause | 3,986 |
{-
- 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 DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
module Data.C... | ti1024/claq | src/Data/ClassicalCircuit.hs | Haskell | bsd-3-clause | 805 |
module Graphics.UI.SDL.Basic (
-- * Initialization and Shutdown
init,
initSubSystem,
quit,
quitSubSystem,
setMainReady,
wasInit,
-- * Configuration Variables
addHintCallback,
clearHints,
delHintCallback,
getHint,
setHint,
setHintWithPriority,
-- * Error Handling
clearError,
getError,
setError,
-- ... | ekmett/sdl2 | Graphics/UI/SDL/Basic.hs | Haskell | bsd-3-clause | 3,737 |
module EarleyExampleSpec where
import EarleyExample (grammar, NumberWord, Expected)
import qualified Text.Earley as E
import qualified Data.List.NonEmpty as NonEmpty
import Test.Hspec (Spec, hspec, describe, it, shouldMatchList)
-- | Required for auto-discovery.
spec :: Spec
spec =
describe "EarleyExample" $ do
... | FranklinChen/twenty-four-days2015-of-hackage | test/EarleyExampleSpec.hs | Haskell | bsd-3-clause | 665 |
module Consts where
import Data.Text
-- | TODO: move to SDL module
type WindowName = Text
mainWindowName :: WindowName
mainWindowName = "mainWindow" | Teaspot-Studio/gore-and-ash-game | src/client/Consts.hs | Haskell | bsd-3-clause | 153 |
{-# LANGUAGE TypeFamilies, ExistentialQuantification,
FlexibleInstances, UndecidableInstances, FlexibleContexts,
ScopedTypeVariables, MultiParamTypeClasses #-}
-- | The Signal module serves as a representation for the combined shallow and
-- deep embeddings of sequential circuits. The shallow portion is repren... | andygill/kansas-lava | Language/KansasLava/Signal.hs | Haskell | bsd-3-clause | 18,502 |
{-# LANGUAGE MultiParamTypeClasses #-}
-- Standard modules.
import Control.Monad
import Control.Monad.Trans
import Data.List
import qualified Data.Map as M
import Data.Maybe
import System.Random
-- Modules provided by this library.
import Control.Monad.Dist
import Control.Monad.Maybe
import Control.Monad.Perhaps
impo... | emk/haskell-probability-monads | examples/Probability.hs | Haskell | bsd-3-clause | 7,598 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE... | AlexaDeWit/haskellsandboxserver | src/db/Schema.hs | Haskell | bsd-3-clause | 1,356 |
{-# LANGUAGE CPP, DeriveDataTypeable #-}
-----------------------------------------------------------------------------
-- |
-- Module : Language.Python.Common.SrcLocation
-- Copyright : (c) 2009 Bernie Pope
-- License : BSD-style
-- Maintainer : bjpop@csse.unimelb.edu.au
-- Stability : experimental
-- P... | jb55/language-javascript | src/Language/JavaScript/Parser/SrcLocation.hs | Haskell | bsd-3-clause | 9,900 |
module Data.Name.Iso where
import Data.Name
import Control.Lens
import qualified Language.Haskell.TH as TH
nameIso :: Iso String String (Maybe Name) Name
nameIso = iso nameMay unName
-- | unsafe
-- >>> "hello" ^. nameIso'
-- hello
nameIso' :: Iso' String Name
nameIso' = iso toName unName
-- | there are lack of info... | kmyk/proof-haskell | Data/Name/Iso.hs | Haskell | mit | 414 |
{-
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://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | alphalambda/codeworld | codeworld-auth/src/CodeWorld/Auth/Util.hs | Haskell | apache-2.0 | 1,685 |
{-|
Module : Base
Description : Base/radix module for the MPL DSL
Copyright : (c) Rohit Jha, 2015
License : BSD2
Maintainer : rohit305jha@gmail.com
Stability : Stable
Functionality for:
* Converting decimal numbers to binary, octal, hexadecimal or any other base/radix
* Converting numbers from binary, ... | rohitjha/DiMPL | src/Base.hs | Haskell | bsd-2-clause | 5,416 |
{-# LANGUAGE ScopedTypeVariables #-}
module Properties.Layout.Tall where
import Test.QuickCheck
import Instances
import Utils
import XMonad.StackSet hiding (filter)
import XMonad.Core
import XMonad.Layout
import Graphics.X11.Xlib.Types (Rectangle(..))
import Data.Maybe
import Data.List (sort)
import Data.Ratio
---... | Happy-Ferret/xmonad | tests/Properties/Layout/Tall.hs | Haskell | bsd-3-clause | 3,761 |
{-|
Module : Fit
Copyright : Copyright 2014-2015, Matt Giles
License : Modified BSD License
Maintainer : matt.w.giles@gmail.com
Stability : experimental
-}
module Fit (
-- * Messages API
-- $messages
readMessages,
readFileMessages,
parseMessages,
Messages(..),
Message(..),
Field(..),
Va... | bitemyapp/fit | src/Fit.hs | Haskell | bsd-3-clause | 1,671 |
module Data.Tiled
( module X
, module Data.Tiled
) where
import Data.Tiled.Load as X
import Data.Tiled.Types as X
import Data.Vector (Vector, force, slice)
-- | Yield a slice of the tile vectors without copying it.
--
-- The vectors must be at least x+w wide and y+h tal... | chrra/htiled | src/Data/Tiled.hs | Haskell | bsd-3-clause | 822 |
{-# LANGUAGE FlexibleInstances #-}
module Kalium.Nucleus.Vector.Show where
import Kalium.Prelude
import Kalium.Nucleus.Vector.Program
deriving instance Show NameSpecial
deriving instance Show Literal
instance Show Name where
show = \case
NameSpecial op -> show op
NameGen n -> "_" ++ show n
insta... | rscprof/kalium | src/Kalium/Nucleus/Vector/Show.hs | Haskell | bsd-3-clause | 952 |
module Data.IP.Op where
import Data.Bits
import Data.IP.Addr
import Data.IP.Mask
import Data.IP.Range
----------------------------------------------------------------
{-|
>>> toIPv4 [127,0,2,1] `masked` intToMask 7
126.0.0.0
-}
class Eq a => Addr a where
{-|
The 'masked' function takes an 'Addr' and a con... | greydot/iproute | Data/IP/Op.hs | Haskell | bsd-3-clause | 3,378 |
{-# LANGUAGE Haskell2010 #-}
{-# LINE 1 "Control/Concurrent/STM/TBQueue.hs" #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# LANGUAGE CPP, DeriveDataTypeable #-}
{-# LANGUAGE Trustworthy #-}
--------------------------------------------------------------------------... | phischu/fragnix | tests/packages/scotty/Control.Concurrent.STM.TBQueue.hs | Haskell | bsd-3-clause | 6,106 |
{-# LANGUAGE CPP #-}
-- | Groups black-box tests of cabal-install and configures them to test
-- the correct binary.
--
-- This file should do nothing but import tests from other modules and run
-- them with the path to the correct cabal-install binary.
module Main
where
-- Modules from Cabal.
import Distributi... | garetxe/cabal | cabal-install/tests/IntegrationTests.hs | Haskell | bsd-3-clause | 12,691 |
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module: Web.Twitter.Conduit
-- Copyright: (c) 2014 Takahiro Himura
-- License: BSD
-- Maintainer: Takahiro Himura <taka@himura.jp>
-- Stability: experimental
-- Portability: portable
--
-- A client library for Twitter APIs (see <ht... | johan--/twitter-conduit | Web/Twitter/Conduit.hs | Haskell | bsd-2-clause | 6,423 |
module Test.Tests where
import Test.Framework
import Test.AddDays
import Test.ClipDates
import Test.ConvertBack
import Test.LongWeekYears
import Test.TestCalendars
import Test.TestEaster
import Test.TestFormat
import Test.TestMonthDay
import Test.TestParseDAT
import Test.TestParseTime
import Test.TestTime
import Test... | bergmark/time | test/Test/Tests.hs | Haskell | bsd-3-clause | 619 |
module RmOneParameter.D2 where
{-remove parameter 'ys' from function 'sumSquares'. This refactoring
affects module 'D1', and 'A1'. This aims to test removing a
parameter from a recursion function-}
sumSquares (x:xs) = sq x + sumSquares xs
sumSquares [] = 0
sq x = x ^ pow
pow =2
| RefactoringTools/HaRe | test/testdata/RmOneParameter/D2.expected.hs | Haskell | bsd-3-clause | 289 |
-- | This is mostly dummy, JHC does not support inexact exceptions.
module Control.Exception where
import Prelude hiding(catch)
import qualified Prelude as P
type IOException = IOError
data Exception = IOException IOException
-- throw :: Exception -> a
assert :: Bool -> a -> a
assert True x = x
assert False _ = e... | m-alvarez/jhc | lib/haskell-extras/Control/Exception.hs | Haskell | mit | 1,617 |
import Test.HUnit (Assertion, (@=?), runTestTT, Test(..), Counts(..))
import Accumulate (accumulate)
import System.Exit (ExitCode(..), exitWith)
import Data.Char (toUpper)
exitProperly :: IO Counts -> IO ()
exitProperly m = do
counts <- m
exitWith $ if failures counts /= 0 || errors counts /= 0 then ExitFailure 1 ... | ullet/exercism | haskell/accumulate/accumulate_test.hs | Haskell | mit | 1,400 |
import Map
import P
import Q
main = do
x <- foo
print (mymember 5 x)
| mfine/ghc | testsuite/tests/cabal/sigcabal02/Main.hs | Haskell | bsd-3-clause | 78 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module T13674 where
import Data.Proxy
import Dat... | sdiehl/ghc | testsuite/tests/indexed-types/should_fail/T13674.hs | Haskell | bsd-3-clause | 1,544 |
{-# LANGUAGE TemplateHaskell, StandaloneDeriving, GeneralizedNewtypeDeriving,
DeriveDataTypeable, TypeFamilies, FlexibleInstances,
MultiParamTypeClasses, BangPatterns #-}
module Distribution.Server.Features.DownloadCount.State where
import Data.Time.Calendar (Day(..))
import Data.Version (Ver... | ocharles/hackage-server | Distribution/Server/Features/DownloadCount/State.hs | Haskell | bsd-3-clause | 10,210 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Program.Strip
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This module provides an library interface to the @strip@ program.
module Distribution.Simple.Program.Strip... | tolysz/prepare-ghcjs | spec-lts8/cabal/Cabal/Distribution/Simple/Program/Strip.hs | Haskell | bsd-3-clause | 2,876 |
{-# LANGUAGE DeriveDataTypeable #-}
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Actions.DynamicWorkspaceOrder
-- Copyright : (c) Brent Yorgey 2009
-- License : BSD-style (see LICENSE)
--
-- Maintainer : <byorgey@gmail.com>
-- Stability : expe... | pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Actions/DynamicWorkspaceOrder.hs | Haskell | bsd-2-clause | 6,450 |
{-
Haskell version of ...
! Text of rule base for Boyer benchmark !
! Started by Tony Kitto on 6th April 1988 !
! Changes Log !
! 07-04-88 ADK Corrected errors in rules
! 08-04-88 ADK Modified "or" rule to remove extra f... | philderbeast/ghcjs | test/nofib/spectral/boyer2/Rulebasetext.hs | Haskell | mit | 15,416 |
module A where
data A = A
other :: Int
other = 2
-- | Doc for test2
test2 :: Bool
test2 = False
-- | Should show up on the page for both modules A and B
data X = X -- ^ Doc for consructor
-- | Should show up on the page for both modules A and B
reExport :: Int
reExport = 1
| DavidAlphaFox/ghc | utils/haddock/html-test/src/A.hs | Haskell | bsd-3-clause | 279 |
module Main where
import Control.Concurrent
main = do
c <- newChan
let writer = writeList2Chan c "Hello World\n"
forkIO writer
let reader = do char <- readChan c
if (char == '\n')
then return ()
else do putChar char; reader
reader
| urbanslug/ghc | testsuite/tests/concurrent/should_run/conc002.hs | Haskell | bsd-3-clause | 262 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE TupleSections #-}
module Stutter.Parser where
import Control.Applicative
import Control.Monad
import Text.Read (readMaybe)
import Data.Attoparsec.Text ((<?>))
import qualified Data.Attoparsec.Text as Atto
import qualified Data.Text as T
import Stutter.Producer hiding (Produc... | nmattia/stutter | src/Stutter/Parser.hs | Haskell | mit | 5,112 |
-- This source code is distributed under the terms of a MIT license,
-- Copyright (c) 2016-present, SoundCloud Ltd.
-- All rights reserved.
--
-- This source code is distributed under the terms of a MIT license,
-- found in the LICENSE file.
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOp... | soundcloud/haskell-kubernetes | server/Main.hs | Haskell | mit | 519 |
module Euler008 (euler8) where
import Common
import Data.Char
euler8 :: Int
euler8 = maximum [product adjacents | adjacents <- sliding 13 num]
num :: [Int]
num = map digitToInt "\
\73167176531330624919225119674426574742355349194934\
\96983520312774506326239578318016984801869478851843\
\8586156078911294... | TrustNoOne/Euler | haskell/src/Euler008.hs | Haskell | mit | 1,324 |
module Types(
Matrix(..),
Point(..),
Point3d(..),
IntPoint,
IntPoint3d,
GLPoint,
GLPoint3d,
Line(..),
Line3d(..),
Viewport(..),
Axis,
mkViewport,
translateMatrix,
scaleMatrix,
rotationMatrix,
translate3d,
scale3d,
rotate3d
) where
import Graphics.Rendering.OpenGL.Raw.Core31
data Ma... | 5outh/Haskell-Graphics-Projects | Project3/Types.hs | Haskell | mit | 1,881 |
module Y2017.M07.D04.Exercise where
{--
Another Mensa-puzzler from the Genius Mensa Quiz-a-Day Book by Dr. Abbie F. Salny.
July 2 problem:
Jemima has the same number of brothers as she has sisters, but her brother,
Roland, has twice as many sisters as he has brothers. How many boys and girls
are there in this family... | geophf/1HaskellADay | exercises/HAD/Y2017/M07/D04/Exercise.hs | Haskell | mit | 805 |
{-# LANGUAGE FlexibleContexts #-}
module Metropolis (arb) where
import Data.Random
arb :: (Distribution Uniform a, Distribution Uniform b, Ord a, Num b, Ord b) => (a->b) -> (a,a) -> b -> RVar a
arb f (low, high) top = do
site <- uniform low high
test <- uniform 0 top
if f site > test
then return site
else a... | rprospero/NeutronPipe | Metropolis.hs | Haskell | mit | 341 |
ans s [] = if s == 0 then "YES" else "NO"
ans s (l:ls) =
case l of
"A" -> ans (s+1) ls
"Un" -> if s == 0 then "NO" else ans (s-1) ls
main = do
_ <- getLine
c <- getContents
let i = lines c
o = ans 0 i
putStrLn o
| a143753/AOJ | 2738.hs | Haskell | apache-2.0 | 241 |
{-# LANGUAGE ForeignFunctionInterface #-}
{-# OPTIONS_GHC -O2 #-}
-- | * Author: Jefferson Heard (jefferson.r.heard at gmail.com)
--
-- * Copyright 2008 Renaissance Computing Institute < http://www.renci.org >
--
-- * License: GNU LGPL
--
-- * Compatibility GHC (I could change the data declarations to not be... | ghc-ios/FTGLES | Graphics/Rendering/FTGL.hs | Haskell | bsd-2-clause | 13,564 |
{-# LANGUAGE OverloadedStrings #-}
module Scoutess.Service.Source.Dir (fetchDir, fetchVersionsDir) where
import Control.Monad.Trans (MonadIO, liftIO)
import Data.Monoid ((<>))
import Data.Set (singleton)
import Data.Text (pack)
import Data.Version (showVersion)
import Distribution.PackageDescription.Parse (readPackag... | cartazio/scoutess | Scoutess/Service/Source/Dir.hs | Haskell | bsd-3-clause | 1,631 |
{-#LANGUAGE ScopedTypeVariables, QuasiQuotes, OverloadedStrings #-}
module Web.Horse.Forms.Basic where
import Control.Arrow
import Data.Monoid
textField :: String -> Maybe String -> String -> String -> String
textField label err val name =
mconcat $ [
maybe "" (\x -> mconcat ["<span class=\"error\">", x, ... | jhp/on-a-horse | Web/Horse/Forms/Basic.hs | Haskell | bsd-3-clause | 1,334 |
import Control.Concurrent
import Control.Concurrent.STM.TChan
import Control.Monad
import Control.Monad.STM
import Quant.MatchingEngine.BasicTypes
import Quant.MatchingEngine.Book
import Quant.MatchingEngine.Feed
import Quant.MatchingEngine... | tdoris/StockExchange | Main.hs | Haskell | bsd-3-clause | 4,420 |
-----------------------------------------------------------------------------
--
-- Module : Language.Haskell.Parser.ParsePostProcess
-- Copyright :
-- License : AllRightsReserved
--
-- Maintainer :
-- Stability :
-- Portability :
--
-- Description: Post processing for the Haskell Parser suite.
--
-- ... | emcardoso/CTi | src/Haskell/Parser/ParsePostProcess.hs | Haskell | bsd-3-clause | 8,149 |
{-# LANGUAGE BangPatterns, CPP, OverloadedStrings #-}
-- |
-- Module: Data.Aeson.Parser.Internal
-- Copyright: (c) 2011, 2012 Bryan O'Sullivan
-- (c) 2011 MailRank, Inc.
-- License: Apache
-- Maintainer: Bryan O'Sullivan <bos@serpentine.com>
-- Stability: experimental
-- Portability: portabl... | beni55/aeson | Data/Aeson/Parser/Internal.hs | Haskell | bsd-3-clause | 12,821 |
module Language.SOS.Data.Rule where
newtype Rule =
Rule Name [Premiss] Conclusion [CompileTimeCondition] [RuntimeCondidtion]
deriving (Eq, Ord, Show)
type Name = String
type Premiss = Transformation
type Conclusion = Transformation
newtype CompileTimeCondition = CTC
newtype RuntimeCondition = RTC
| JanBessai/hsos | src/Language/SOS/Data/Rule.hs | Haskell | bsd-3-clause | 309 |
module Math.Probably.Student where
import Numeric.LinearAlgebra
import Math.Probably.FoldingStats
import Text.Printf
--http://www.haskell.org/haskellwiki/Gamma_and_Beta_function
--cof :: [Double]
cof = [76.18009172947146,-86.50532032941677,24.01409824083091,
-1.231739572450155,0.001208650973866179,-0.000005395... | glutamate/probably-baysig | src/Math/Probably/Student.hs | Haskell | bsd-3-clause | 2,739 |
{-# LANGUAGE TemplateHaskell #-}
module Gifter.Giveaway.Internal where
import Control.Lens
import qualified Data.Text as T
type Points = Integer
data GiveawayStatus =
Open Points
| Closed
| ContributorsOnly
| AlreadyOwn
| NoLogin
| Entered
| MissingBaseGame
... | arjantop/gifter | src/Gifter/Giveaway/Internal.hs | Haskell | bsd-3-clause | 674 |
{-
This file is part of the Haskell package cassava-streams. It is
subject to the license terms in the LICENSE file found in the
top-level directory of this distribution and at
git://pmade.com/cassava-streams/LICENSE. No part of cassava-streams
package, including this file, may be copied, modified, propagated, or
dist... | pjones/cassava-streams | bin/tutorial.hs | Haskell | bsd-3-clause | 938 |
{-
Lets.RoseTree
A Rose Tree (or multi-way tree) is a tree structure with a variable and unbounded
number of branches at each node. This implementation allows for an empty tree.
References
[1] Wikipedia, "Rose Tree", http://en.wikipedia.org/wiki/Rose_tree
[2] Jeremy Gibbons, "Origami Programming", appears in The F... | peterson/lets-tree | src/Lets/RoseTree.hs | Haskell | bsd-3-clause | 1,983 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.