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 Main where
import System.Environment
import WoofParse
import WoofToBC
import IO
main :: IO ()
main = do s <- hGetContents stdin
ast <- return $ readAST s
case ast of
ASTNull errMsg -> do putStr errMsg
otherwise -> emitBC ast
| aemoncannon/woof | compiler/woof_main.hs | Haskell | mit | 295 |
{-# LANGUAGE OverloadedStrings #-}
{-|
Controls host muting in Datadog.
-}
module Network.Datadog.Host
( muteHost
, unmuteHost
) where
import Control.Monad (void)
import Data.Aeson
import Data.Text (Text, unpack)
import Data.Time.Clock
import Data.Time.Clock.POSIX
import Network.HTTP.Types
import Network.Datadog.... | iand675/datadog | src/Network/Datadog/Host.hs | Haskell | mit | 1,139 |
{-# LANGUAGE NoImplicitPrelude, DeriveFunctor #-}
module IHaskell.Flags (
IHaskellMode(..),
Argument(..),
Args(..),
LhsStyle(..),
NotebookFormat(..),
lhsStyleBird,
parseFlags,
help,
) where
import IHaskellPrelude
import qualified Data.Text as T
import qualified Data.Text.... | beni55/IHaskell | src/IHaskell/Flags.hs | Haskell | mit | 7,280 |
module Git.Sanity.Internal where
import Data.Machine
-- TODO Contribute to machine?
slide :: Process a (a, a)
slide = f Nothing where
f Nothing = await (\x -> f $ Just x)
f (Just x) = await (\y -> machine $ Yield (x, y) $ f $ Just y)
await f = machine $ Await f Refl stopped
machine = MachineT . return
| aloiscochard/git-sanity | src/Git/Sanity/Internal.hs | Haskell | apache-2.0 | 316 |
{- | A BSON document is a JSON-like object with a standard binary encoding defined at bsonspec.org. This implements version 1.0 of that spec.
Use the GHC language extension /OverloadedStrings/ to automatically convert String literals to UString (UTF8) -}
{-# LANGUAGE OverloadedStrings, TypeSynonymInstances, FlexibleI... | mongodb/bson-haskell | Data/Bson.hs | Haskell | apache-2.0 | 14,020 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE UndecidableInstances #-}
module Tersus.DataTypes.TError where
import Control.Exception.Base
import Data.Text
import Data.Typeable
import Prelude
import Tersus.DataTypes.TypeSynonyms
import Yesod.Handler
import GHC.Generics (Generic)
import Data.Aeson (FromJSON, ToJSON, dec... | kmels/tersus | Tersus/DataTypes/TError.hs | Haskell | bsd-2-clause | 867 |
{-# LANGUAGE BangPatterns, PatternGuards #-}
module Data.BTree
( -- * Types
BTree
-- * Creation
, empty
, singleton
, fromList
-- * Queries
, size
, lookup
, minimumKey
-- * Insertion
, insert
, insertWith
-- * Debugging
, showBTree
) where
... | jaspervdj/b-tree | src/Data/BTree.hs | Haskell | bsd-3-clause | 6,073 |
module HM.Normal where
import HM.Types
import HM.Monad
import Data.IORef
import Data.List( (\\) )
import Debug.Trace
import Text.PrettyPrint.HughesPJ
typecheck :: Term -> Tc Sigma
typecheck e = do { ty <- inferSigma e
; zonkType ty }
data Expected a = Infer (IORef a) | Check a
checkRho :: Ter... | MnO2/hindley-milner | src/HM/Normal.hs | Haskell | bsd-3-clause | 2,533 |
import Data.Function
import Data.List
import Data.Monoid
import qualified Data.Set as S
import Data.Foldable.Strict
import qualified Data.Map.Strict as M
import Control.Lens
import MinIR.CorpusStats as CS
import MinIR.TermIndex as TI
import MinIR.OrderedIndex as OI
import MinIR.UnorderedIndex as UI
import MinIR.Sequen... | bgamari/minir | Test.hs | Haskell | bsd-3-clause | 940 |
module Util
( untilFixed
, untilFixedBy
, untilFixedM
, mapFst
, mapSnd
, commonPrefix
, replaceOne
, replaceAll
) where
-- Yields the result of applying f until a fixed point is reached.
untilFixedBy :: (a -> a -> Bool) -> (a -> a) -> a -> a
untilFixedBy eq f x = fst . head . filter (uncurry eq) $
zip (iterat... | akerber47/train | Util.hs | Haskell | bsd-3-clause | 1,785 |
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -F -pgmF htfpp #-}
-- | test documents
module Web.MangoPay.DocumentsTest where
import Web.MangoPay
import Web.MangoPay.TestUtils
import Data.Default
import Test.Framework
import Test.HUnit (Assertion)
import Data.Maybe (isJust, fromJust)
import qualified Data.ByteStr... | prowdsponsor/mangopay | mangopay/test/Web/MangoPay/DocumentsTest.hs | Haskell | bsd-3-clause | 2,439 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
-- | This module provides some functions to use Linux
-- terminals
module Haskus.System.Linux.Terminal
( stdin
, stdout
, stderr
, writeStr
, writeStrLn
, readChar
)
where
import Haskus.System.Linux.ErrorCode
import Haskus.System.Linux.... | hsyl20/ViperVM | haskus-system/src/lib/Haskus/System/Linux/Terminal.hs | Haskell | bsd-3-clause | 1,363 |
module Main where
import Control.Monad
import System.Exit (exitFailure)
import System.Environment
import L3.ParL
import L3.ErrM
import L3ToL2.Compile
import L2.PrintL
main :: IO ()
main = do
args <- getArgs
when (length args /= 1) $ do
putStrLn "usage: filename"
exitFailure
ts <- liftM myLex... | mhuesch/scheme_compiler | src/L3ToL2/Main.hs | Haskell | bsd-3-clause | 561 |
{-# Language BangPatterns,FlexibleContexts,TypeFamilies #-}
module Numeric.Utilities.GaussElimination {-(
-- gaussElem
)-} where
import Control.Arrow((&&&))
import Data.Array.Repa as R
import Data.Array.Repa.Unsafe as R
import qualified Data.Vector as V
impor... | felipeZ/OptimizationAlgorithms | Numeric/Utilities/GaussElimination.hs | Haskell | bsd-3-clause | 4,258 |
{-# LANGUAGE TypeFamilies #-}
module Network.TwoPhase.STM
where
import Control.Applicative
import Control.Concurrent.STM
import Data.ByteString
import Data.Map (Map)
import qualified Data.Map as M
import Network.TwoPhase
type Message = (Addr STMNetwork, ByteString, Addr STMNetwork)
data STMNetwork = STMNetwork (B... | qnikst/2pc-haskell | Network/TwoPhase/STM.hs | Haskell | bsd-3-clause | 1,104 |
{-# LANGUAGE RecordWildCards #-}
module HLint(hlint, Suggestion, suggestionLocation, suggestionSeverity, Severity(..)) where
import Control.Applicative
import Control.Monad
import System.Console.CmdArgs.Verbosity
import Data.List
import System.Exit
import CmdLine
import Settings
import Report
import Idea
import Appl... | bergmark/hlint | src/HLint.hs | Haskell | bsd-3-clause | 5,099 |
--------------------------------------------------------------------------------
-- | The LLVM Metadata System.
--
-- The LLVM metadata feature is poorly documented but roughly follows the
-- following design:
-- * Metadata can be constructed in a few different ways (See below).
-- * After which it can either be attach... | ekmett/ghc | compiler/llvmGen/Llvm/MetaData.hs | Haskell | bsd-3-clause | 3,383 |
module Util.Handlebars
( module Util.JSON
, compile
, render
, render'
, Collection
) where
import UHC.Ptr
import Util.JSON
import Util.String
compile :: forall a. String -> IO (Ptr a -> IO PackedString)
compile source = __compile (pack source) >>= return . __mkFun
render :: (ToJSON a) => (P... | johanneshilden/liquid-epsilon | Util/Handlebars.hs | Haskell | bsd-3-clause | 882 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
-- | Common types for actions
module VK.API.Actions.Types where
import Data.List (stripPrefix)
import Data.Maybe (fromMaybe, maybeToList)
import qualified Data.Text as T
import GHC.Generic... | eryx67/vk-api | src/VK/API/Actions/Types.hs | Haskell | bsd-3-clause | 8,527 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE TypeFamilies #-}
-- ---------------------------------------------------------------------------
-- |
-- Module : Data.Vector.Algorithms.Search
-- Copyright : (c) 2009-2015 Dan Doel, 2015 Tim Baumann
-- Maintainer : Dan Doel <dan.doel@gmail.com>
-- Stability : Experi... | tolysz/vector-algorithms | src/Data/Vector/Algorithms/Search.hs | Haskell | bsd-3-clause | 9,078 |
module Text.WikiEngine
( RenderCfg (..)
, LinkType(..)
, CodeRenderType(..)
, defaultRenderCfg
-- * parsed types
, Block(..)
, Inline(..)
, parseDocument
-- * renderer
, renderAsHtml
) where
import Text.WikiEngine.Configuration
import Text.WikiEngine.HTML
import Text.WikiEngine.Parse
import Text.WikiEngine... | vincenthz/wikiengine | Text/WikiEngine.hs | Haskell | bsd-3-clause | 349 |
module BaseSpec where
import Test.Hspec (Spec, describe, it, hspec)
import Test.Hspec.HUnit ()
import Test.Hspec.Expectations
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "Prelude.head" $ do
it "returns the first element of a list" $ do
head [23 ..] `shouldBe` (23 :: Int)
... | jwiegley/script-template | test/BaseSpec.hs | Haskell | bsd-3-clause | 345 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE PatternGuards #-}
#if MIN_VERSION_base(4,9,0)
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
#endif
-----------------------------------------------------------------------------
-- |
-- Module : Text.CSL.Proc.Disamb
-- Copyright : (c) Andrea Rossato
-- Licen... | adunning/pandoc-citeproc | src/Text/CSL/Proc/Disamb.hs | Haskell | bsd-3-clause | 18,750 |
module NoteScript
( module N
) where
import NoteScript.LendingClub as N
import NoteScript.Prosper as N
import NoteScript.Syntax as N
| WraithM/notescript | src/NoteScript.hs | Haskell | bsd-3-clause | 181 |
module Grid
( Grid
, makeGrid
, getSize
, getRows
, getCols
, getCell
, setCell
, update
-- Only functions are exported but not Data.Matrix module.
-- These functions might not be used always. So no need to
-- export module for that. It would be better to export it
-- manually when it is needed.
, toMatrix
, fromMatrix... | wowofbob/gol | src/Grid.hs | Haskell | bsd-3-clause | 3,002 |
{-# LANGUAGE OverloadedStrings, TemplateHaskell #-}
module Web.Slack.Types.Error where
import Data.Aeson
import Control.Lens.TH
data SlackError = SlackError deriving Show
makeLenses ''SlackError
instance FromJSON SlackError where
parseJSON = withObject "SlackError" (\_ -> return SlackError)
| mpickering/slack-api | src/Web/Slack/Types/Error.hs | Haskell | mit | 299 |
{-# LANGUAGE TupleSections, ParallelListComp #-}
-- | Convert the concrete syntax into the syntax of cubical TT.
module Concrete where
import Exp.Abs
import qualified CTT as C
import Pretty
import Control.Applicative
import Control.Arrow (second)
import Control.Monad.Trans
import Control.Monad.Trans.Reader
import Co... | simhu/cubical | Concrete.hs | Haskell | mit | 9,974 |
{-# LANGUAGE CPP #-}
import Control.Monad
import Data.IORef
import Control.Exception (SomeException, catch)
import Distribution.Simple
import Distribution.Simple.BuildPaths (autogenModulesDir)
import Distribution.Simple.InstallDirs as I
import Distribution.Simple.LocalBuildInfo as L
import qualified Distribution.Simp... | Heather/Idris-dev | Setup.hs | Haskell | bsd-3-clause | 12,556 |
{-# LANGUAGE DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-}
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Hooks.ScreenCorners
-- Copyright : (c) 2009 Nils Schweinsberg, 2015 Evgeny Kurnevsky
-- License : BSD3-style (see LICENSE)
--
... | CaptainPatate/xmonad-contrib | XMonad/Hooks/ScreenCorners.hs | Haskell | bsd-3-clause | 6,431 |
{-# LANGUAGE RankNTypes, TypeFamilies #-}
-- Unification yielding a coercion under a forall
module Data.Vector.Unboxed where
import Control.Monad.ST ( ST )
import Data.Kind (Type)
data MVector s a = MV
data Vector a = V
type family Mutable (v :: Type -> Type) :: Type -> Type -> Type
type instance Mutable Vecto... | sdiehl/ghc | testsuite/tests/indexed-types/should_compile/T4120.hs | Haskell | bsd-3-clause | 719 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
module Aws.Iam.Commands.DeleteUserPolicy
( DeleteUserPolicy(..)
, DeleteUserPolicyResponse(..)
) where
import Aws.Core
import Aws.Iam.Core
import Aws.Iam.Intern... | Soostone/aws | Aws/Iam/Commands/DeleteUserPolicy.hs | Haskell | bsd-3-clause | 1,647 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash #-}
{-# OPTIONS_HADDOCK hide #-}
module Take (
take0
, take
) where
import Data.Maybe
import GHC.Base
import Language.Haskell.Liquid.Prelude (liquidAssert, liquidError)
{-@ assert take0 :: n: {v: Int | 0 <= v} -> [a] -> {v:[a] ... | mightymoose/liquidhaskell | tests/pos/take.hs | Haskell | bsd-3-clause | 1,130 |
{-# LANGUAGE BangPatterns, OverloadedStrings #-}
-- |
-- Module: Data.Aeson.Parser
-- Copyright: (c) 2012-2015 Bryan O'Sullivan
-- (c) 2011 MailRank, Inc.
-- License: Apache
-- Maintainer: Bryan O'Sullivan <bos@serpentine.com>
-- Stability: experimental
-- Portability: portable
--
-- Efficie... | abbradar/aeson | Data/Aeson/Parser.hs | Haskell | bsd-3-clause | 2,097 |
module Resources (
GameData(..)
, Glyph(..)
, Lump(..)
, loadPalette
, loadSignon
, loadGameData
, module WL6
) where
import qualified Data.ByteString as B
import qualified Data.Bitstream as BS
import Data.Binary.Get
import Data.Word
im... | vTurbine/w3dhs | src/Resources.hs | Haskell | mit | 5,377 |
-----------------------------------------------------------------------------
--
-- Module : Graphics.GPipe.Orphans
-- Copyright : Tobias Bexelius
-- License : MIT
--
-- Maintainer : Tobias Bexelius
-- Stability : Experimental
-- Portability : Portable
--
-- |
-- Orphan boolean instances for linear ... | Teaspot-Studio/GPipe-Core | src/Graphics/GPipe/Orphans.hs | Haskell | mit | 687 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveGeneric #-}
module Codec.Xlsx.Types (
-- * The main types
Xlsx(..)
, Styles(..)
, DefinedNames(..)
, ColumnsProperti... | qrilka/xlsx | src/Codec/Xlsx/Types.hs | Haskell | mit | 10,888 |
module Example15 where
import qualified WeightedLPA as WLPA
import Graph
import qualified Data.Map as M
import qualified Data.Set as S
import Polynomial
import LaurentPolynomial
weighted_graph_F :: WeightedGraph String String
weighted_graph_F = WeightedGraph (buildGraphFromEdges [("e",("v","u")),("f",("v","u")),("g"... | rzil/honours | LeavittPathAlgebras/Example15.hs | Haskell | mit | 2,186 |
{-# htermination filterFM :: (() -> b -> Bool) -> FiniteMap () b -> FiniteMap () b #-}
import FiniteMap
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/FiniteMap_filterFM_2.hs | Haskell | mit | 104 |
{-|
Module : Language.Java.Lexer.Internal
Description : Lexer for Java program.
Copyright : (c) Evan Sebastian 2014
License : MIT
Maintainer : evan.sebastian@u.nus.edu
Stability : experimental
Portability : GHC 7.8.2
This module defines lexer for Java program.
Use lexJava to break a string into a list of... | evansb/jasper | src/Language/Java/Lexer.hs | Haskell | mit | 1,207 |
module Mish.Config where
import Mish.HexagonalGrid
data Config =
Config { radius :: Radius
, roomAttempts :: Int
, minRoomRadius :: Int
, maxRoomRadius :: Int
, doubleConnectorChance :: Float
}
deriving Show
defaultCon... | halvorgb/mish | src/Mish/Config.hs | Haskell | mit | 1,507 |
module Rebase.Data.ByteString.Lazy.Internal
(
module Data.ByteString.Lazy.Internal
)
where
import Data.ByteString.Lazy.Internal
| nikita-volkov/rebase | library/Rebase/Data/ByteString/Lazy/Internal.hs | Haskell | mit | 131 |
module Feature.AuthSpec where
import Network.Wai (Application)
import Network.HTTP.Types
import Test.Hspec
import Test.Hspec.Wai
import Test.Hspec.Wai.JSON
import PostgREST.Config.PgVersion (PgVersion, pgVersion112)
import Protolude hiding (get)
import SpecHelper
spec :: PgVersion -> SpecWith ((), Application)
sp... | steve-chavez/postgrest | test/Feature/AuthSpec.hs | Haskell | mit | 9,003 |
import Control.Applicative
import Control.Monad
import Data.List
import System.IO
rotate :: Int -> [a] -> [a]
rotate _ [] = []
rotate n xs = zipWith const (drop n (cycle xs)) xs
main :: IO ()
main = do
n_temp <- getLine
let n_t = words n_temp
let n = read $ n_t!!0 :: Int
let k = read $ n_t!!1 :: Int
... | nbrendler/hackerrank-exercises | array-left-rotation/Main.hs | Haskell | mit | 451 |
{-# LANGUAGE NoImplicitPrelude, ViewPatterns, DeriveDataTypeable #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE DeriveGeneric #-}
module Graphics.Caramia.Buffer.Internal where
import Data.Data
import qua... | Noeda/caramia | src/Graphics/Caramia/Buffer/Internal.hs | Haskell | mit | 3,087 |
{- Seth Brown
2014-12-13
GHC 7.8.3
sethbrown AT drbunsen DOT ORG
Copyright 2014 Seth Brown. All rights reserved.
data from: http://www.beeradvocate.com/lists/top/
$ runghc ba-top-breweries.hs < data.txt
======================================
Hill Farmstead Brewery,24
Brasserie Cantillon,11... | drbunsen/Beer-Advocate-Top-Breweries | ba-top-breweries.hs | Haskell | mit | 1,738 |
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-- A weaker version of State, where updates are restricted to addition for some
-- monoid.
module Philed.Control.Monad.Rec... | Chattered/PhilEdCommon | Philed/Control/Monad/Record.hs | Haskell | mit | 2,403 |
module WhenView.Process (process) where
import Control.Monad (join)
import WhenView.Stage1.Parser (entries)
import WhenView.Stage1.Serializer (calTokens)
import WhenView.Stage2.Parser (years)
import WhenView.I18n (Months)
import Text.ParserCombinators.Parsec (runParser, ParseError)
import WhenView.Html (calendarPage)
... | zenhack/whenview | src/WhenView/Process.hs | Haskell | mit | 609 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
module Main where
import Game.Halma.TelegramBot.CmdLineOptions
import Game.Halma.TelegramBot.Controller (halmaBot)
import Game.Halma.TelegramBot.Controller.BotM (evalGl... | timjb/halma | halma-telegram-bot/ServerMain.hs | Haskell | mit | 1,207 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE CPP #-}
-- | Field functions allow you to easily create and validate forms, cleanly handling the uncer... | s9gf4ult/yesod | yesod-form/Yesod/Form/Fields.hs | Haskell | mit | 35,208 |
module Handler.Thread where
import Authentification (isModeratorBySession, getValidNickBySession)
import Captcha
import CustomForms (postMForm)
import Helper (minusToSpaces, updatePosts)
import Import
import Widgets (accountLinksW, postWidget, threadWidget)
getThreadR :: Text -> Handler Html
getThreadR title = do
... | cirquit/HaskellPie | HaskellPie/Handler/Thread.hs | Haskell | mit | 3,300 |
-- Ссылка на задание: https://gist.github.com/astynax/1eb88e195c4bab2b8d31d04921b18dd0
-- Это тоже самое задание, что в части 1, только сделанное прямо на занятии по-другому
module Main where
data Row a = Row a a a a
data Color = Red | Blue
data Field =
Field (Row (Row (Maybe Color)))
empty :: Field
empty = ... | aquatir/remember_java_api | code-sample-haskell/typed_fp_basics_cource/02_function_in_haskell/task.hs | Haskell | mit | 981 |
-- | This module re-exports all you need in order to /read/ package
-- databases and module info files created by compilers that use
-- haskell-packages.
--
-- If you are writing a compiler, i.e. a program that creates or writes
-- package databases or module info files — then take a look at
-- "Distribution.HaskellSui... | haskell-suite/haskell-packages | src/Distribution/HaskellSuite.hs | Haskell | mit | 624 |
module IHaskell.Eval.Util (
-- * Initialization
initGhci,
-- * Flags and extensions
-- ** Set and unset flags.
extensionFlag, setExtension,
ExtFlag(..),
setFlags,
-- * Code Evaluation
evalImport,
isImportSafe,
evalDeclarations,
getType,
-- * Pretty printing
doc,
) where
-- GHC imports.... | aostiles/LiveHaskell | src/IHaskell/Eval/Util.hs | Haskell | mit | 7,996 |
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE UndecidableInstances #-}
module Type.Sequence where
import Prelude
import GHC.TypeLits
type family Succ (a :: k) :: k
type instance Succ (a :: Nat) = a + 1
type family Empty :: k
type instance Empty = '[]
type family Zero :: k
type instance Zero = 0
type family Range... | wdanilo/typelevel | src/Type/Sequence.hs | Haskell | apache-2.0 | 518 |
import Controller (withYwitter)
import Network.Wai.Handler.Warp (run)
main :: IO ()
main = withYwitter $ run 3000
| tanakh/Ywitter | production.hs | Haskell | bsd-2-clause | 115 |
module Stats (statsMiddleware) where
import Prelude
import Control.Concurrent
import Control.Concurrent.STM
import qualified Network.Wai as Wai
import qualified Data.ByteString.Char8 as BC
import Data.Maybe
import Data.Map (Map)
import qualified Data.Map as Map
import Control.Monad
import Control.Monad.Trans (liftIO)
... | jannschu/bitlove-ui | Stats.hs | Haskell | bsd-2-clause | 2,832 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE RoleAnnotations #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE Unsafe #-}
module Concurrent.Primitive.Ref
(
-- * Primitive References
PrimRef(..)
, newPrimRef
, newPinnedPrimRef
, newAlignedPinnedPrimRef
, readPrimRef
, writePrimRef
, p... | ekmett/concurrent | src/Concurrent/Primitive/Ref.hs | Haskell | bsd-2-clause | 9,700 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}
module Playlistach.Soundcloud (searchTracks, getStreamUrl) where
import Data.Coerce
import Data.Aeson
import Control.Monad (mzero)
import Control.Monad.Trans.Either (EitherT... | aemxdp/playlistach | backend/Playlistach/Soundcloud.hs | Haskell | bsd-3-clause | 1,856 |
{-# LANGUAGE OverloadedStrings #-}
module MySQL.Token where
import qualified Data.ByteString as BS
import Data.List (intersperse)
-- | MySQL tokens
data LToken = LTokAdd -- ADD (R)
| LTokAll -- ALL (R)
| LTokAlter -- ALTER (R)
| LTokAnd ... | sukwon0709/mysql | src/MySQL/Token.hs | Haskell | bsd-3-clause | 11,494 |
module Main where
import Folly.DSL
import Folly.TPTP
import Control.Monad
import Control.Applicative
p = predicate "p"
q = predicate "q"
s = relation "s"
[a,b,c,d] = map (satsbokstav . return) "abcd"
main :: IO ()
main = zipWithM_ writeTPTP [ "test" ++ show i ++ ".p" | i <- [0 :: Integer ..] ]
[ [ axiom' $... | danr/folly | examples/Test.hs | Haskell | bsd-3-clause | 1,060 |
{-# LANGUAGE QuasiQuotes #-}
import LiquidHaskell
import Language.Haskell.Liquid.Prelude
data Pair a = P a Int | D a Bool
goo z = P z z
baz = goo 10
| spinda/liquidhaskell | tests/gsoc15/unknown/pos/adt0.hs | Haskell | bsd-3-clause | 158 |
-- Copyright 2011 Wu Xingbo
-- LANGUAGE {{{
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DoAndIfThenElse #-}
-- }}}
-- module export {{{
module Eval.DServ (
aHandler, ioaHandler,
AHandler, IOHandler,
DServerInfo(..), DService(..), DServerDat... | wuxb45/eval | Eval/DServ.hs | Haskell | bsd-3-clause | 13,891 |
module Main where
import Prelude hiding (splitAt,lines,words)
import Data.Char
import Data.String hiding (lines,words)
import Data.Monoid
import Data.Bifunctor
import qualified Data.List (intersperse,splitAt)
import qualified Data.List.Split as Split
import qualified Data.Monoid.Factorial as SFM
import Test.Tasty
impo... | danidiaz/foldl-transduce | tests/tests.hs | Haskell | bsd-3-clause | 7,956 |
{-# LANGUAGE
DataKinds
, EmptyDataDecls
, KindSignatures
, Rank2Types
, RecordWildCards #-}
module Control.Monad.Trans.Ref.Integer
( Region
, Ref
, RefSupply
, runRefSupply
, RefSupplyT
, runRefSupplyT
, newRef
, readRef
, writeRef
, modi... | sonyandy/unify | src/Control/Monad/Trans/Ref/Integer.hs | Haskell | bsd-3-clause | 3,984 |
module Main (main) where
import Control.Monad
import Data.Char
import Data.List
import System.Directory
import System.Environment
import System.Process
-- | Take the arguments passed from the commandline and the filename of the
-- Shakefile, then execu... | norm2782/shake-bin | src/Main.hs | Haskell | bsd-3-clause | 1,034 |
n m=unwords[concat[(words ".- -... -.-. -.. . ..-. --. .... .. .--- -.- .-.. -- -. --- .--. --.- .-. ... - ..- ...- .-- -..- -.-- --..")!!((ord x)-65)|x<-l]|l<-words m]
| eeue56/code-golf | morsecode/morse.hs | Haskell | bsd-3-clause | 169 |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE GADTs #-}
module Duckling.Rules.AF
( defaultRules
, langRules
, localeRules
) where
impor... | facebookincubator/duckling | Duckling/Rules/AF.hs | Haskell | bsd-3-clause | 1,244 |
{-# LANGUAGE OverloadedStrings #-}
module HCSV.CSV where
import Prelude hiding (takeWhile)
import qualified Data.ByteString as BS
import Control.Applicative ((<|>), (<*), (*>), many)
import Data.Attoparsec
import Data.Attoparsec.Combinator
import Data.Conduit
import ... | thsutton/hcsv | src/HCSV/CSV.hs | Haskell | bsd-3-clause | 1,882 |
{-# LANGUAGE PackageImports #-}
module Main (main) where
import Control.Applicative ((<$>))
import Control.Monad (void, forever)
import "monads-tf" Control.Monad.State (StateT(..), runStateT, liftIO)
import Control.Concurrent (forkIO)
import System.Environment (getArgs)
import Network (listenOn, accept)
import "crypt... | YoshikuniJujo/forest | subprojects/tls-analysis/server/runServer.hs | Haskell | bsd-3-clause | 758 |
{-# LANGUAGE TupleSections #-}
module RandMonadT where
-- base
import Control.Monad.IO.Class
import Control.Applicative
import Control.Monad
-- transformers
import Control.Monad.Trans.Class
-- primitive
import Control.Monad.Primitive (PrimState)
-- mwc-random
import qualified System.Random.MWC as R
newtype Ran... | kgadek/evil-pareto-tests | src/RandMonadT.hs | Haskell | bsd-3-clause | 1,135 |
{-# LANGUAGE JavaScriptFFI, GeneralizedNewtypeDeriving, FlexibleInstances, UndecidableInstances #-}
module GHCJS.Three.Material (
Material(..), mkMaterial, IsMaterial(..),
MaterialRenderFace, materialFrontSide, materialBackSide, materialDoubleSide,
MeshBasicMaterial(..), mkMeshBasicMaterial, setWireFrame, s... | manyoo/ghcjs-three | src/GHCJS/Three/Material.hs | Haskell | bsd-3-clause | 8,769 |
-- | Parsing all context-free grammars using Earley's algorithm.
module Text.Earley
( -- * Context-free grammars
Prod, terminal, (<?>), Grammar, rule
, -- * Derived operators
satisfy, token, namedToken, list, listLike
, -- * Deprecated operators
symbol, namedSymbol, word
, -- * Parsing
Report(..... | sboosali/Earley | Text/Earley.hs | Haskell | bsd-3-clause | 489 |
-- |
-- Module : Crypto.Hash.MD5
-- License : BSD-style
-- Maintainer : Vincent Hanquez <vincent@snarc.org>
-- Stability : experimental
-- Portability : unknown
--
-- Module containing the binding functions to work with the
-- MD5 cryptographic hash.
--
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE... | tekul/cryptonite | Crypto/Hash/MD5.hs | Haskell | bsd-3-clause | 1,430 |
module Language.GroteTrap.Range (
-- * Types
Pos, Range, Ranged(..),
-- * Utility functions
distRange, inRange, includes, unionRange, size, validRange
) where
-- | A @Pos@ is a position in between two elements in a list. For example, position @0@ marks the beginning of the list, and position @length lis... | MedeaMelana/GroteTrap | Language/GroteTrap/Range.hs | Haskell | bsd-3-clause | 2,122 |
{-# LANGUAGE CPP, MagicHash, UnboxedTuples, ForeignFunctionInterface, GHCForeignImportPrim, UnliftedFFITypes #-}
#if __GLASGOW_HASKELL__ >= 701
{-# LANGUAGE Trustworthy #-}
#endif
module Control.ChunkedTL2.STM
(
readTVar,
writeTVar,
atomically,
STM(..),
printStats,
newTVar,
module Control.... | ml9951/ghc | libraries/pastm/Control/ChunkedTL2/STM.hs | Haskell | bsd-3-clause | 1,748 |
module Web.Client.Capacity.Internal
(
) where
| athanclark/client-capacity | src/Web/Client/Capacity/Internal.hs | Haskell | bsd-3-clause | 54 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Lens hiding (children)
import Graphics.Svg
import Linear.V2
import VirtualHom.Element
import VirtualHom.Html hiding (content, main)
import VirtualHom.Rendering(renderingOptions)
import VirtualHom.Bootstrap(container, row, btnDefault)
import VirtualHo... | j-mueller/iso-svg | examples/simple/Main.hs | Haskell | bsd-3-clause | 774 |
module Pos.Infra.Communication.Relay.Util
( expectInv
, expectData
) where
import Universum
import Pos.Infra.Communication.Relay.Types
(RelayError (UnexpectedData, UnexpectedInv))
import Pos.Infra.Communication.Types.Relay (DataMsg, InvMsg,
... | input-output-hk/pos-haskell-prototype | infra/src/Pos/Infra/Communication/Relay/Util.hs | Haskell | mit | 654 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE OverloadedStrings #-}
module Language.LSP.Test.Files
( swapFiles
, rootDir
)
where
import Language.LSP.Types
import Language.LSP.Types.L... | alanz/haskell-lsp | lsp-test/src/Language/LSP/Test/Files.hs | Haskell | mit | 4,962 |
{-# Language RebindableSyntax #-}
{-# Language TypeOperators #-}
{-# Language FlexibleContexts #-}
{-# Language ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
module PingMulti02 where
import Prelude hiding ((>... | abakst/symmetry | checker/tests/pos/PingMulti02.hs | Haskell | mit | 1,069 |
module Idris.REPL.Commands where
import Idris.AbsSyntaxTree
import Idris.Colours
import Idris.Core.TT
-- | REPL commands
data Command = Quit
| Help
| Eval PTerm
| NewDefn [PDecl] -- ^ Each 'PDecl' should be either a type declaration (at most one) or a clause defining the same na... | jmitchell/Idris-dev | src/Idris/REPL/Commands.hs | Haskell | bsd-3-clause | 2,668 |
module Control.Concurrent.MVar.YC (
modifyMVarPure, writeMVar
) where
import Control.Applicative ()
import Control.Concurrent.MVar (MVar, modifyMVar_)
modifyMVarPure :: MVar a -> (a -> a) -> IO ()
modifyMVarPure mvar = modifyMVar_ mvar . fmap return
writeMVar :: MVar a -> a -> IO ()
writeMVar mvar = modifyMV... | yairchu/peakachu | src/Control/Concurrent/MVar/YC.hs | Haskell | bsd-3-clause | 341 |
-- -----------------------------------------------------------------------------
-- ALEX TEMPLATE
--
-- This code is in the PUBLIC DOMAIN; you may copy it freely and use
-- it for any purpose whatsoever.
-- -----------------------------------------------------------------------------
-- INTERNALS and main scanner engi... | hvr/alex | templates/GenericTemplate.hs | Haskell | bsd-3-clause | 7,074 |
{-# OPTIONS -fno-warn-orphans #-}
module Network.BitTorrent.Internal.ProgressSpec (spec) where
import Control.Applicative
import Test.Hspec
import Test.QuickCheck
import Network.BitTorrent.Internal.Progress
instance Arbitrary Progress where
arbitrary = Progress <$> arbitrary <*> arbitrary <*> arbitrary
spec :: Spe... | DavidAlphaFox/bittorrent | tests/Network/BitTorrent/Internal/ProgressSpec.hs | Haskell | bsd-3-clause | 339 |
module Tuura.Library (Library, libraryFile, loadLibrary) where
newtype Library = Library FilePath
libraryFile :: Library -> FilePath
libraryFile (Library file) = file
loadLibrary :: FilePath -> Library
loadLibrary = Library
| allegroCoder/scenco-1 | src/Tuura/Library.hs | Haskell | bsd-3-clause | 227 |
-----------------------------------------------------------------------------
-- |
-- Module : Window
-- Copyright : (c) 2011-13 Jose A. Ortega Ruiz
-- : (c) 2012 Jochen Keil
-- License : BSD-style (see LICENSE)
--
-- Maintainer : Jose A. Ortega Ruiz <jao@gnu.org>
-- Stability : unstable... | tsiliakis/xmobar | src/Window.hs | Haskell | bsd-3-clause | 6,866 |
module Data.JSTarget.Op where
import Prelude hiding (GT, LT)
data BinOp
= Add
| Mul
| Sub
| Div
| Mod
| And
| Or
| Eq
| StrictEq
| Neq
| StrictNeq
| LT
| GT
| LTE
| GTE
| Shl
| ShrL
| ShrA
| BitAnd
| BitOr
| BitXor
deriving (Eq)
instance Show BinOp where
show Add ... | beni55/haste-compiler | src/Data/JSTarget/Op.hs | Haskell | bsd-3-clause | 1,653 |
{-# LANGUAGE ScopedTypeVariables
, MultiParamTypeClasses
, FlexibleInstances
, FunctionalDependencies
, FlexibleContexts
, UndecidableInstances
, KindSignatures
, GADTs
, OverlappingInstances
, EmptyDataDecls
, DeriveDataTypeable #-}
module Control.Distributed.Process.Internal.Closure.Explicit
(
... | qnikst/distributed-process | src/Control/Distributed/Process/Internal/Closure/Explicit.hs | Haskell | bsd-3-clause | 5,218 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, PatternGuards, TypeSynonymInstances #-}
-- --------------------------------------------------------------------------
-- |
-- Module : XMonad.Operations
-- Copyright : (c) Spencer Janssen 2007
-- License : BSD3-s... | atupal/xmonad-mirror | xmonad/src/XMonad/Operations.hs | Haskell | mit | 24,176 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE PatternGuards #-}
-- This is the runner for the package-tests suite. The actual
-- tests are in in PackageTests.Tests
module Main where
import PackageTests.Options
import PackageTests.PackageTester
import PackageTests.Tests
import Distribution.Simple.Configure
... | kolmodin/cabal | Cabal/tests/PackageTests.hs | Haskell | bsd-3-clause | 15,012 |
module IfFrom where
{- map2 xs = map (if xs == [] then (+) else (-)) [ 1 ,2 .. 5] -}
map2 xs = (case ((+), [1,2..5]) of
(f, []) -> []
(f, (x : xs)) -> (f x) : (map (if xs == [] then (+) else (-))
[1,2 .. 5]))
| SAdams601/HaRe | old/testing/generativeFold/IfFrom.hs | Haskell | bsd-3-clause | 287 |
module Main where
import qualified MsgGen
import qualified TopicTest
import Test.Tasty
main :: IO ()
main = do genTests <- MsgGen.tests
defaultMain $ testGroup "roshask" [
testGroup "roshask executable"
[ genTests ]
, testGroup "roshask library"
[ T... | bitemyapp/roshask | Tests/AllTests.hs | Haskell | bsd-3-clause | 342 |
import qualified Data.ByteString.Char8 as B
import Parse
import Gen
main = do parseResult <- parseMsg "LaserScan.msg"
let txt = case parseResult of
Right msg -> generateMsgType msg
Left err -> error err
putStr (B.unpack txt)
B.writeFile "LaserSc... | bitemyapp/roshask | src/executable/Test.hs | Haskell | bsd-3-clause | 330 |
module Bug (tst) where
tst :: Float -> Bool
tst x = truncate x > (0::Int)
| urbanslug/ghc | testsuite/tests/codeGen/should_compile/T1916.hs | Haskell | bsd-3-clause | 74 |
-- re-exporting m2 outside of C(..)
module Mod118_A( C(m1), m2) where
class C a where
m1 :: a -> Int
m2 :: a -> Bool
instance C Int where
m1 _ = 1
m2 _ = True
| urbanslug/ghc | testsuite/tests/module/Mod118_A.hs | Haskell | bsd-3-clause | 170 |
-- https://www.hackerrank.com/challenges/grading/problem
-- Constants
threshold = 3
lowerLimit = 38
toInt :: String -> Int
toInt string = read string :: Int
calculateNextMultipleOfFive :: Int -> Int
calculateNextMultipleOfFive grade = grade + 5 - (grade `mod` 5)
gradeStudent :: Int -> Int
gradeStudent grade
| gr... | julianespinel/training | hackerrank/Grading.hs | Haskell | mit | 667 |
{-# LANGUAGE FlexibleContexts #-}
module Server (
server, authServerContext, AuthMap
) where
import Servant
import API
import Config
import Server.Main
import Server.Login
import Server.Swagger
import Server.Static
server :: AuthMap -> Config -> Server API
server m cfg = convertServer cfg (mainServer :<|> loginSer... | lierdakil/markco | server/src/Server.hs | Haskell | mit | 378 |
module FRP.Jalapeno.Sample where
-------------
-- Imports --
import Control.Concurrent
import Data.Time.Clock
import FRP.Jalapeno.Behavior
----------
-- Code --
{--- | Sampling a @'Behavior'@ in real time at a maximum number of times per-}
{--- second.-}
{-intermittentSample :: (Monad m, Show a) => Behavior m a -... | crockeo/jalapeno | src/lib/FRP/Jalapeno/Sample.hs | Haskell | mit | 1,219 |
module U.Codebase.Sqlite.Branch.Format where
import Data.Vector (Vector)
import U.Codebase.Sqlite.Branch.Diff (LocalDiff)
import U.Codebase.Sqlite.Branch.Full (LocalBranch)
import U.Codebase.Sqlite.DbId (CausalHashId, BranchObjectId, ObjectId, PatchObjectId, TextId)
import Data.ByteString (ByteString)
-- |you can use... | unisonweb/platform | codebase2/codebase-sqlite/U/Codebase/Sqlite/Branch/Format.hs | Haskell | mit | 872 |
module Problem0012 where
import Data.List
--http://www.mathsisfun.com/algebra/triangular-numbers.html
nthTriangleNumber nth =
round
$(nth * ( nth + 1)) / 2
infiniteListOfTriangleNumbers = [nthTriangleNumber x | x <- [1..]]
--http://rosettacode.org/wiki/Factors_of_an_integer#Haskell
factors n = l... | Sobieck00/practice | pe/nonvisualstudio/haskell/OldWork/Implementation/Problem0012.hs | Haskell | mit | 570 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.