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 |
|---|---|---|---|---|---|
--
-- A very simple example application using System.MIDI.
-- It's a basic MIDI monitor: prints all the incoming messages.
--
module Main where
--------------------------------------------------------------------------------
import Control.Monad
import Control.Concurrent
import System.MIDI
import System.MIDI.Utili... | chpatrick/hmidi | examples/monitor.hs | Haskell | bsd-3-clause | 976 |
-- {-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
-- {-# LANGUAGE MultiParamTypeClasses #-}
-- {-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE RecordWildCards #-}
-- {-# LANGUAGE GeneralizedNewtypeDeriving #-}
-- {-# LANGUAGE MultiWayIf #-}
-- {-# LANGUAGE OverloadedStrings #-}
-- {-# LANGU... | reuleaux/pire | src/Pire/Refactor/Refactor.hs | Haskell | bsd-3-clause | 34,059 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
... | dorchard/camfort | src/Language/Fortran/Model/Op/Meta/Core.hs | Haskell | apache-2.0 | 1,113 |
{-# LANGUAGE TemplateHaskell, ScopedTypeVariables, TypeOperators, GADTs, EmptyDataDecls, PatternGuards #-}
module Reflex.Dynamic.TH (qDyn, unqDyn, mkDyn) where
import Reflex.Dynamic
import Language.Haskell.TH
import qualified Language.Haskell.TH.Syntax as TH
import Language.Haskell.TH.Quote
import Data.Data
import Co... | k0001/reflex | src/Reflex/Dynamic/TH.hs | Haskell | bsd-3-clause | 3,156 |
-- Command-line based Flapjax compiler. Run without any options for usage
-- information.
module Main where
import Control.Monad
import qualified Data.List as L
import System.Exit
import System.IO
import System.Console.GetOpt
import System.Environment hiding (withArgs)
import System.Directory
import BrownPLT.Html (re... | ducis/flapjax-fixed | flapjax/trunk/compiler/src/Fxc.hs | Haskell | bsd-3-clause | 4,654 |
{-# LANGUAGE CPP #-}
-- |
-- Module : Network.TLS.Backend
-- License : BSD-style
-- Maintainer : Vincent Hanquez <vincent@snarc.org>
-- Stability : experimental
-- Portability : unknown
--
-- A Backend represents a unified way to do IO on different
-- types without burdening our calling API with multiple
--... | beni55/hs-tls | core/Network/TLS/Backend.hs | Haskell | bsd-3-clause | 3,057 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Yesod.WebSockets
( -- * Core API
WebSocketsT
, webSockets
, webSocketsWith
, webSocketsOptions
, webSocketsOptionsWith
, receiveData
, receiveDataE
, receiveDataMessageE
, sendPing
, sendPi... | psibi/yesod | yesod-websockets/Yesod/WebSockets.hs | Haskell | mit | 8,878 |
module Layout00014 where
instance Indexed (Pull sh a) where
Pull ixf _ ! i = ixf i
| charleso/intellij-haskforce | tests/gold/parser/Layout00014.hs | Haskell | apache-2.0 | 88 |
{-# LANGUAGE RecordWildCards, GADTs #-}
module CmmLayoutStack (
cmmLayoutStack, setInfoTableStackMap
) where
import StgCmmUtils ( callerSaveVolatileRegs ) -- XXX layering violation
import StgCmmForeign ( saveThreadState, loadThreadState ) -- XXX layering violation
import BasicTypes
import Cmm
import ... | lukexi/ghc-7.8-arm64 | compiler/cmm/CmmLayoutStack.hs | Haskell | bsd-3-clause | 42,050 |
-----------------------------------------------------------------------------
-- |
-- Module : Graphics.X11
-- Copyright : (c) Alastair Reid, 1999-2003
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : libraries@haskell.org
-- Stability : provisional
-- Portability : p... | mgsloan/X11 | Graphics/X11.hs | Haskell | bsd-3-clause | 694 |
<?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="tr-TR">
<title>Requester</title>
<maps>
<homeID>requester</homeID>
<mapref location="ma... | kingthorin/zap-extensions | addOns/requester/src/main/javahelp/help_tr_TR/helpset_tr_TR.hs | Haskell | apache-2.0 | 960 |
{-# OPTIONS_JHC -fno-prelude #-}
module Jhc.Inst.Show() where
import Jhc.Basics
import Jhc.Class.Num
import Jhc.Class.Ord
import Jhc.Class.Real
import Jhc.Show
import Jhc.Type.C
-- we convert them to Word or WordMax so the showIntAtBase specialization can occur.
fromIntegral :: (Integral a, Num b) => a -> b
fromIn... | hvr/jhc | lib/jhc/Jhc/Inst/Show.hs | Haskell | mit | 3,166 |
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -Wall #-}
module Bug where
import Language.Haskell.TH
-- Warnings should be preserved through recover
main :: IO ()
main = putStrLn $(recover (stringE "splice failed")
[| let x = "a" in let x = "b" in x |])
| sdiehl/ghc | testsuite/tests/th/TH_recover_warns.hs | Haskell | bsd-3-clause | 284 |
{-# LANGUAGE PatternGuards, DeriveFunctor #-}
module IRTS.Lang where
import Control.Monad.State hiding (lift)
import Control.Applicative hiding (Const)
import Idris.Core.TT
import Idris.Core.CaseTree
import Data.List
import Debug.Trace
data Endianness = Native | BE | LE deriving (Show, Eq)
data LVar = Loc Int | G... | osa1/Idris-dev | src/IRTS/Lang.hs | Haskell | bsd-3-clause | 14,464 |
<?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>Getting started Guide</title>
<maps>
<homeID>top</homeID>
<mapref locat... | ccgreen13/zap-extensions | src/org/zaproxy/zap/extension/gettingStarted/resources/help_hi_IN/helpset_hi_IN.hs | Haskell | apache-2.0 | 967 |
-- Test we don't get a cycle for "phantom" superclasses
{-# LANGUAGE ConstraintKinds, MultiParamTypeClasses, FlexibleContexts #-}
module TcOK where
class A cls c where
meth :: cls c => c -> c
class A B c => B c where
| forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/typecheck/should_compile/tc259.hs | Haskell | bsd-3-clause | 223 |
{-# LANGUAGE RecordWildCards #-}
module Network.HTTP.Download.VerifiedSpec where
import Crypto.Hash
import Control.Monad (unless)
import Control.Monad.Trans.Reader
import Control.Retry (limitRetries)
import Data.Maybe
import Network.HTTP.Client.Conduit
import Network.HTTP.Download.Verified
import Path
import System.Di... | akhileshs/stack | src/test/Network/HTTP/Download/VerifiedSpec.hs | Haskell | bsd-3-clause | 6,282 |
module Main(main) where
import System.Random
tstRnd rng = checkRange rng (genRnd 50 rng)
genRnd n rng = take n (randomRs rng (mkStdGen 2))
checkRange (lo,hi) = all pred
where
pred
| lo <= hi = \ x -> x >= lo && x <= hi
| otherwise = \ x -> x >= hi && x <= lo
main :: IO ()
main = do
print (tstRnd ... | danse/ghcjs | test/pkg/base/rand001.hs | Haskell | mit | 460 |
module CodeModel.Core where
import CodeModel.Function
import CodeModel.Signature
data Core = Core String [Function]
instance Show Core where
show (Core name funs) = "core " ++ name ++ "\n" ++ unlines (map show funs)
getFunction :: Core -> String -> Maybe Function
getFunction (Core _ fs) s = (\filtered -> if null ... | MarcusVoelker/Recolang | CodeModel/Core.hs | Haskell | mit | 423 |
module Y2018.M05.D08.Exercise where
{--
Okay, now that we have the new articles downloaded from the REST endpoint and
the ArticleMetaData context from the database, let's do some triage!
So, just like with the ArticleMetaData, we have to generalize the Article-
TriageInformation type from the specific Package and (Da... | geophf/1HaskellADay | exercises/HAD/Y2018/M05/D08/Exercise.hs | Haskell | mit | 2,432 |
import Test.Hspec.Attoparsec
import Test.Tasty
import Test.Tasty.Hspec
import Data.Attoparsec.ByteString.Char8
import qualified Data.ByteString.Char8 as C8
import Data.STEP.Parsers
main :: IO ()
main = do
specs <- createSpecs
let tests = testGroup "Tests" [specs]
defaultMain tests
createSpecs = testSpec "Pars... | Newlifer/libstep | test/test.hs | Haskell | mit | 659 |
import Test.Tasty
import Test.Tasty.QuickCheck
import Coreutils
import Data.List (intersperse)
main :: IO ()
main = defaultMain tests
tests :: TestTree
tests = testGroup "Unit tests" [libTests]
libTests :: TestTree
libTests = testGroup "coreutils" [splitTests]
splitTests :: TestTree
splitTests = testGroup "split"
... | mrak/coreutils.hs | tests/unit/Main.hs | Haskell | mit | 768 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as BC
import Data.Foldable (traverse_)
input :: ByteString
input = "10001001100000001"
bitFlip :: Char -> Char
bitFlip '0' = '1'
bitFlip _ = '0'
dragon... | genos/online_problems | advent_of_code_2016/day16/hask/src/Main.hs | Haskell | mit | 1,652 |
-----------------------------------------------------------------------------
--
-- Module : Language.PureScript.CoreFn.Ann
-- Copyright : (c) 2013-14 Phil Freeman, (c) 2014 Gary Burgess, and other contributors
-- License : MIT
--
-- Maintainer : Phil Freeman <paf31@cantab.net>, Gary Burgess <gary.burge... | michaelficarra/purescript | src/Language/PureScript/CoreFn/Ann.hs | Haskell | mit | 1,048 |
import Data.List
combinations :: Int -> [a] -> [[a]]
combinations 0 _ = [ [] ]
combinations n xs = [ y:ys | y:xs' <- tails xs
, ys <- combinations (n-1) xs']
| curiousily/haskell-99problems | 26.hs | Haskell | mit | 187 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE DeriveGeneric #-}
module Codec.Xlsx.Types.Internal.CommentTable where
import Data.ByteString.Lazy (ByteString)
import qualified Data.ByteString.Lazy as LB
import qualified Data.ByteString.Lazy.Char8 as LBC8
import Data.List.Extra (nubOr... | qrilka/xlsx | src/Codec/Xlsx/Types/Internal/CommentTable.hs | Haskell | mit | 4,940 |
-- | Biegunka - configuration development library
module Control.Biegunka
( -- * Interpreters control
biegunka, Settings, defaultSettings, runRoot, biegunkaRoot
, Templates(..), templates
-- * Interpreters
, Interpreter
, pause, confirm, changes, run, check
-- * Types
, Script, Scope(..)
-- * ... | biegunka/biegunka | src/Control/Biegunka.hs | Haskell | mit | 1,687 |
module FreePalace.Handlers.Incoming where
import Control.Concurrent
import Control.Exception
import qualified System.Log.Logger as Log
import qualified FreePalace.Domain.Chat as Chat
import qualified FreePalace.Domain.GUI ... | psfblair/freepalace | src/FreePalace/Handlers/Incoming.hs | Haskell | apache-2.0 | 14,645 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ViewPatterns #-}
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
module FreezePredicateParserSpec where
import Bio.Motions.Types
import Bio.Motions.Representation.Common
import Bio.Motions.Utils.FreezePredicateParser
import GHC.Exts
import Data.Either
import Text.Parsec... | Motions/motions | test/FreezePredicateParserSpec.hs | Haskell | apache-2.0 | 3,060 |
-- "Treealize" expression terms
module OperationExtension2 where
import Data.Tree
import DataBase
import DataExtension
class ToTree x
where
toTree :: x -> Tree String
instance ToTree Lit
where
toTree (Lit i) = Node "Lit" []
instance (Exp x, Exp y, ToTree x, ToTree y) => ToTree (Add x y)
where
toTree (Add... | egaburov/funstuff | Haskell/tytag/xproblem_src/samples/expressions/Haskell/OpenDatatype1/OperationExtension2.hs | Haskell | apache-2.0 | 454 |
------------------------------------------------------------------------------
-- Copyright 2012 Microsoft Corporation.
--
-- This is free software; you can redistribute it and/or modify it under the
-- terms of the Apache License, Version 2.0. A copy of the License can be
-- found in the file "license.txt" at the root... | lpeterse/koka | src/Kind/Constructors.hs | Haskell | apache-2.0 | 4,461 |
{-# LANGUAGE OverloadedStrings #-}
module Database.HXournal.Store.Config where
import Data.Configurator as C
import Data.Configurator.Types
import Control.Applicative
import Control.Concurrent
import Control.Monad
import System.Environment
import System.Directory
import System.FilePath
data HXournalStoreConfiguratio... | wavewave/hxournal-store | lib/Database/HXournal/Store/Config.hs | Haskell | bsd-2-clause | 1,079 |
{-# LANGUAGE PackageImports #-}
import Control.Applicative hiding (many)
import qualified Data.Attoparsec as P
import Data.Attoparsec.Char8 -- as P8
import qualified Data.ByteString.Char8 as B hiding (map)
import HEP.Parser.LHEParser
import Debug.Trace
import qualified Data.Iteratee as Iter
import qualified ... | wavewave/LHEParser | test/test.hs | Haskell | bsd-2-clause | 1,490 |
import Data.List (nub)
main = print $ length $ nub [ a^b | a <- [2 .. 100], b <- [2 .. 100] ]
| foreverbell/project-euler-solutions | src/29.hs | Haskell | bsd-3-clause | 95 |
{-# LANGUAGE TypeFamilies, CPP #-}
-- | Simple interface for shell scripting-like tasks.
module Control.Shell
( -- * Running Shell programs
Shell, ExitReason (..)
, shell, shell_, exitString
-- * Error handling and control flow
, (|>), capture, captureStdErr, capture2, capture3, stream, lift
, try, orE... | valderman/shellmate | shellmate/Control/Shell.hs | Haskell | bsd-3-clause | 4,736 |
module Network.Kontiki.SerializationSpec where
import Data.Binary (Binary, decode, encode)
import Network.Kontiki.Raft
import Test.Hspec
import Test.QuickCheck
serializationSpec :: Spec
serializationSpec = do
describe "Messages" $ do
it "Message Int" $ property ... | abailly/kontiki | test/Network/Kontiki/SerializationSpec.hs | Haskell | bsd-3-clause | 1,225 |
module Language.GhcHaskell.Parser
where
import Control.Monad
import qualified Language.Haskell.Exts.Parser as P
import Language.Haskell.AST.HSE
import Language.GhcHaskell.AST
parsePat :: String -> ParseResult (Parsed Pat)
parsePat = P.parse >=> fromHsePat
parseExp :: String -> ParseResult (Parsed Exp)
parseExp = ... | jcpetruzza/haskell-ast | src/Language/GhcHaskell/Parser.hs | Haskell | bsd-3-clause | 609 |
{-# LANGUAGE Haskell2010 #-}
module Maybe1 where
instance Functor Maybe' where
fmap f m = m >>= pure . f
instance Applicative Maybe' where
pure = Just'
f1 <*> f2 = f1 >>= \v1 -> f2 >>= (pure . v1)
data Maybe' a = Nothing' | Just' a
instance Monad Maybe' where
return = pure
Nothing' >>= _ = Noth... | hvr/Hs2010To201x | testcases/H2010/Maybe1.expected.hs | Haskell | bsd-3-clause | 373 |
module Main where
import ImageFlatten
import Data.Maybe
import Data.Char
import Options.Applicative
import System.IO
import System.Environment
import System.FilePath
data Options = Options
{ input :: String,
output :: String,
combine :: Bool,
remove :: Bool,
avg :: Bool,
thre... | iansullivan88/image-flatten | app/Main.hs | Haskell | bsd-3-clause | 3,056 |
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, DeriveFunctor,
DeriveDataTypeable, TypeSynonymInstances, PatternGuards #-}
module Idris.AbsSyntaxTree where
import Idris.Core.TT
import Idris.Core.Evaluate
import Idris.Core.Elaborate hiding (Tactic(..))
import Idris.Core.Typecheck
import Idris.Docst... | MetaMemoryT/Idris-dev | src/Idris/AbsSyntaxTree.hs | Haskell | bsd-3-clause | 103,703 |
module Yesod.Helpers.Yaml (
module Yesod.Helpers.Yaml
, DefaultEnv(..)
) where
import Prelude
import Data.Yaml
import Yesod
import Data.Text (Text)
import Data.Aeson (withObject)
import qualified Data.Text as T
import Data.Maybe ... | yoo-e/yesod-helpers | Yesod/Helpers/Yaml.hs | Haskell | bsd-3-clause | 2,512 |
module QueryArrow.Control.Monad.Logger.HSLogger where
import Control.Monad.Logger
import System.Log.FastLogger
import System.Log.Logger
import qualified Data.Text as T
import Data.Text.Encoding
instance MonadLogger IO where
monadLoggerLog loc logsource loglevel msg = do
let priority = case loglevel of
... | xu-hao/QueryArrow | log-adapter/src/QueryArrow/Control/Monad/Logger/HSLogger.hs | Haskell | bsd-3-clause | 706 |
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
-- | Wiki page view.
module HL.V.Wiki where
import HL.V
import HL.V.Code
import HL.V.Template
import Data.List (isPrefixOf)
import Data.Text (unpack,pack)
import Language.Haskell.HsColour.CSS (hscolour)
import Prelud... | yogsototh/hl | src/HL/V/Wiki.hs | Haskell | bsd-3-clause | 2,130 |
module Yesod.Helpers.Auth where
import Prelude
import Yesod
import Yesod.Auth
import Control.Monad.Catch (MonadThrow)
import Control.Monad
import qualified Data.Text as T
yesodAuthIdDo :: (YesodAuth master, MonadIO m, MonadThrow m, MonadBaseControl IO m) =>
(AuthId ... | yoo-e/yesod-helpers | Yesod/Helpers/Auth.hs | Haskell | bsd-3-clause | 3,357 |
module Main where
import Language.ECMAScript3.Syntax
import Language.ECMAScript3.Syntax.Annotations
import Language.ECMAScript3.Parser
import Language.ECMAScript3.PrettyPrint
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Data (Data)
--import System.IO
import Data.Generics.Uniplate.Data
import Data... | achudnov/jsapia | Main.hs | Haskell | bsd-3-clause | 4,038 |
module Main where
import MenuIO
main :: IO ()
main = menu []
| arthurmgo/regex-ftc | app/Main.hs | Haskell | bsd-3-clause | 63 |
module OutputDirectory
(outdir) where
outdir = "_data"
| pnlbwh/test-tensormasking | config-output-paths/OutputDirectory.hs | Haskell | bsd-3-clause | 58 |
{-# LANGUAGE DeriveDataTypeable #-}
module WFF where
import qualified Data.Map as M
import Test.QuickCheck hiding ((.||.), (==>), (.&&.))
import qualified Data.Set as S
import Data.Data
import Data.Generics.Uniplate.Data
import Data.List hiding (lookup, union)
import Prelude hiding (lookup)
import Control.Applicative h... | patrikja/GRACeFUL | ConstraintModelling/WFF.hs | Haskell | bsd-3-clause | 2,457 |
#!/usr/bin/env runhaskell
{-# LANGUAGE BangPatterns
#-}
{-| The Sphere Online Judge is a collection of problems. One problem, problem
450, came up on the mailing list as a sensible benchmark for fast integer
parsing.
-}
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
htt... | solidsnack/bytestring-nums | SPOJObvious.hs | Haskell | bsd-3-clause | 1,328 |
squareM = #x -> `(,x * ,x) -- `#` indicates macro-lambda
unittest "squareM" [
(squareM 3, 9),
(let a = 3 in squareM a, 9),
]
a = "a"
unittest "macro_expand" [
(macro_expand {squareM 3}, (*) 3 3),
(macro_expand {(squareM 3) + 1}, (+) ((*) 3 3) 1),
(macro_expand {squar... | ocean0yohsuke/Simply-Typed-Lambda | Start/UnitTest/Macro.hs | Haskell | bsd-3-clause | 926 |
import Control.Arrow ((***))
import Control.Monad (join)
{-- snippet adler32 --}
import Data.Char (ord)
import Data.Bits (shiftL, (.&.), (.|.))
base = 65521
adler32 xs = helper 1 0 xs
where helper a b (x:xs) = let a' = (a + (ord x .&. 0xff)) `mod` base
b' = (a' + b) `mod` base
... | binesiyu/ifl | examples/ch04/Adler32.hs | Haskell | mit | 1,188 |
{-@ LIQUID "--no-termination" @-}
module Lec02 where
import Text.Printf (printf)
import Debug.Trace (trace)
incr :: Int -> Int
incr x = x + 1
zincr :: Int -> Int
zincr = \x -> x + 1
eleven = incr (10 + 2)
-- sumList xs = case xs of
-- [] -> 0
-- (x:xs) -> x + sumList xs
sumList ::... | ucsd-progsys/131-web | static/hs/lec-1-17-2018.hs | Haskell | mit | 1,707 |
module Main where
comb :: [([Char], [Char])]
color = ["blue", "red", "green"]
comb = [(x, y) | x <- color, y <- color, x < y] | momo9/seven-lang | haskell/src/combination.hs | Haskell | mit | 125 |
{-# LANGUAGE DataKinds, PolyKinds, TypeOperators, TypeFamilies
, TypeApplications #-}
module DumpTypecheckedAst where
import Data.Kind
data Peano = Zero | Succ Peano
type family Length (as :: [k]) :: Peano where
Length (a : as) = Succ (Length as)
Length '[] = Zero
data T f (a :: k) = MkT (f a)... | sdiehl/ghc | testsuite/tests/parser/should_compile/DumpTypecheckedAst.hs | Haskell | bsd-3-clause | 431 |
-- | 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.... | SuetakeY/nomnichi_yesod | Settings.hs | Haskell | bsd-2-clause | 2,742 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude
, RecordWildCards
, BangPatterns
, NondecreasingIndentation
, RankNTypes
#-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------... | frantisekfarka/ghc-dsi | libraries/base/GHC/IO/Handle/Internals.hs | Haskell | bsd-3-clause | 35,776 |
{-# LANGUAGE TypeOperators #-}
module Language.LSP.Server
( module Language.LSP.Server.Control
, VFSData(..)
, ServerDefinition(..)
-- * Handlers
, Handlers(..)
, Handler
, transmuteHandlers
, mapHandlers
, notificationHandler
, requestHandler
, ClientMessageHandler(..)
, Options(..)
, defau... | wz1000/haskell-lsp | lsp/src/Language/LSP/Server.hs | Haskell | mit | 1,139 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
module Data.Modable.Tests where
import Data.Maybe (isNothing)
import Data.Modable
import Test.Framework
import Test.Framework.Providers.QuickCheck2
import Test.QuickCheck
testModable :: forall a b.
( Eq a, Show a, ... | Soares/Dater.hs | test/Data/Modable/Tests.hs | Haskell | mit | 980 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
module HttpApp.BotKey.Api.Types where
import Data.Aeson (FromJSON, ToJSON)
import GHC.Generics (Generic)
import HttpApp.BotKey.Types (BotKey, Label, Secret)
data BKNewResp = BKNewResp
{ _nrespBotKey ::... | rubenmoor/skull | skull-server/src/HttpApp/BotKey/Api/Types.hs | Haskell | mit | 749 |
module Main.DB
(
session,
oneRow,
unit,
integerDatetimes,
serverVersion,
)
where
import Main.Prelude hiding (unit)
import Control.Monad.Trans.Reader
import Control.Monad.IO.Class
import qualified Database.PostgreSQL.LibPQ as LibPQ
import qualified Data.ByteString as ByteString; import Data.ByteString (ByteSt... | nikita-volkov/postgresql-binary | tasty/Main/DB.hs | Haskell | mit | 2,908 |
{-# LANGUAGE OverloadedStrings #-}
-- | Entry point to the Post Correspondence Programming Language
module Language.PCPL
( module Language.PCPL.Syntax
, module Language.PCPL.Pretty
, module Language.PCPL.CompileTM
-- * Execute PCPL programs
, runProgram
-- * Utility
, topString
-- * E... | davidlazar/PCPL | src/Language/PCPL.hs | Haskell | mit | 2,530 |
module Ch2 where
import Test.QuickCheck
import Test.Hspec
ch2 :: IO ()
ch2 = hspec $ do
describe "_______________________Chapter 2 tests_______________________" $ do
it "should have tests" $ do
True
| Kiandr/CrackingCodingInterview | Haskell/src/chapter-2/Ch2.hs | Haskell | mit | 214 |
{-# OPTIONS_HADDOCK show-extensions #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
{-|
Module : Data.Nat.Peano
Description : Peano natural numbers
Copyright : (c) Lars Brünjes, 2016
License : MIT
Maintainer : brunjlar@gmail.com
Stability ... | brunjlar/heap | src/Data/Nat/Peano.hs | Haskell | mit | 2,067 |
{-# OPTIONS_GHC -fglasgow-exts -fallow-undecidable-instances #-}
{-| This library provides a collection of monad transformers that
can be combined to produce various monads.
-}
module MonadLibMorph (
-- * Types
-- $Types
Id, Lift, ReaderT, WriterT, StateT, ExceptionT, ContT,
-- * Lifting
-- $Lifting
M... | yav/monadlib | experimental/MonadLibMorph.hs | Haskell | mit | 17,481 |
import Data.Char (digitToInt)
main = print problem40Value
problem40Value :: Int
problem40Value = d1 * d10 * d100 * d1000 * d10000 * d100000 * d1000000
where d1 = digitToInt $ list !! 0
d10 = digitToInt $ list !! 9
d100 = digitToInt $ list !! 99
d1000 = digitToInt $ list !! 999
... | jchitel/ProjectEuler.hs | Problems/Problem0040.hs | Haskell | mit | 496 |
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module Arith where
import Control.Exception
import Data.Int
import Data.Text as T
type T = Int64
zero :: T
zero = 0
neg :: T -> T
neg x | x == minBound = throw Overflow
| otherwise = -x
add :: T -> T -> T
add x y =
if | p x && p y && n sum -> t... | gip/cinq-cloches-ledger | src/Arith.hs | Haskell | mit | 1,475 |
module TestLib (mkTestSuite, run, (<$>)) where
import Test.HUnit
import AsciiMath hiding (run)
import Prelude hiding ((<$>))
import Control.Applicative ((<$>))
unComment :: [String] -> [String]
unComment [] = []
unComment ("":ss) = "" : unComment ss
unComment (('#':_):ss) = unComment ss
unComment (s:ss) = s : unComme... | Kerl13/AsciiMath | tests/TestLib.hs | Haskell | mit | 1,037 |
module Language.Egison.Typing where
import Data.Set (Set)
import qualified Data.Set as S
import Data.Map (Map)
import qualified Data.Map as M
import Language.Egison.Types
-- I will deprecate this synonym
type EgisonType = EgisonTypeExpr
type TypeVar = String
type ConsName = String
data TypeCons = TCons ConsName -- N... | tokiwoousaka/egison4 | hs-src/Language/Egison/Typing.hs | Haskell | mit | 504 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
module Spark.Core.GroupsSpec where
import Test.Hspec
import Data.Text(Text)
import Spark.Core.Context
import Spark.Core.Functions
import Spark.Core.ColumnFunctions
import Spark.Core.Column
import Spark.Core.IntegrationUtilities
import Spark.Co... | krapsh/kraps-haskell | test-integration/Spark/Core/GroupsSpec.hs | Haskell | apache-2.0 | 915 |
sequence' :: Monad m => [m a] -> m [a]
sequence' [] = return []
sequence' (m:ms) = m >>= \ a -> do as <- sequence' ms
return (a: as)
sequence'' ms = foldr func (return []) ms
where
func :: (Monad m) => m a -> m [a] -> m [a]
func m acc = do x <- m
xs <- a... | dongarerahul/edx-haskell | chapter-8-hw.hs | Haskell | apache-2.0 | 2,479 |
import Controller (withOR)
import System.IO (hPutStrLn, stderr)
import Network.Wai.Middleware.Debug (debug)
import Network.Wai.Handler.Warp (run)
main :: IO ()
main = do
let port = 3000
hPutStrLn stderr $ "Application launched, listening on port " ++ show port
withOR $ run port . debug
| snoyberg/orangeroster | test.hs | Haskell | bsd-2-clause | 300 |
-- |Interactions with the user.
module Ovid.Interactions
( tell
, options
) where
import Ovid.Prelude
import qualified System.Console.Editline.Readline as R
-- |Prompt the user.
tell s = liftIO (putStrLn s)
-- |Asks the user to pick an item from a list.
options :: (MonadIO m, Show a) => [a] -> m a
options xs ... | brownplt/ovid | src/Ovid/Interactions.hs | Haskell | bsd-2-clause | 972 |
-- | Helper functions for dealing with text values
module Language.Terraform.Util.Text(
template,
show
) where
import Prelude hiding(show)
import qualified Prelude(show)
import qualified Data.Text as T
show :: (Show a) => a -> T.Text
show = T.pack . Prelude.show
-- | `template src substs` will replace all occu... | timbod7/terraform-hs | src/Language/Terraform/Util/Text.hs | Haskell | bsd-3-clause | 547 |
module Validations.Types
( module Validations.Types.Checker
) where
import Validations.Types.Checker
| mavenraven/validations | src/Validations/Types.hs | Haskell | bsd-3-clause | 106 |
{-# LANGUAGE OverloadedStrings #-}
module Futhark.Compiler
(
runPipelineOnProgram
, runCompilerOnProgram
, runPipelineOnSource
, interpretAction'
, FutharkConfig (..)
, newFutharkConfig
, dumpError
)
where
import Data.Monoid
import Control.Monad
import C... | mrakgr/futhark | src/Futhark/Compiler.hs | Haskell | bsd-3-clause | 4,305 |
{-# LANGUAGE OverloadedStrings,GADTs,DeriveDataTypeable,DeriveFunctor,GeneralizedNewtypeDeriving,MultiParamTypeClasses,QuasiQuotes,TemplateHaskell,TypeFamilies,PackageImports,NamedFieldPuns,RecordWildCards,TypeSynonymInstances,FlexibleContexts #-}
module Main where
import Data.Crawler
import Data.C... | tkemps/bcbs-crawler | src/BcbsCrawler-old.hs | Haskell | bsd-3-clause | 13,475 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Main where
import System.Remote.Monitoring
import Web.Auth.OAuth2
import Web.Auth.Service
import Web.Orion
import Web.Scotty.Trans
import Web.Temp... | schell/orion | src/Main.hs | Haskell | bsd-3-clause | 4,457 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveFunctor #-}
module Data.Queue (
Queue
, empty, singleton, fromList
, toList, enqueue, dequeue, enqueueAll
) where
import Control.DeepSeq (NFData)
import GHC.Generics (Generic)
data Queue a = Q [a] [a]
deriving (Show, Eq, Functor,... | stefan-hoeck/labeled-graph | Data/Queue.hs | Haskell | bsd-3-clause | 898 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 800
{-# OPTIONS_GHC -fno-warn... | cdornan/idiot | Text/RE/PCRE/ByteString.hs | Haskell | bsd-3-clause | 2,516 |
module SlaeGauss where
import Data.Bifunctor
import qualified Data.Matrix as Mx
import qualified Data.Vector as Vec
import Library
compute :: Matrix -> Either ComputeError Vector
compute = fmap backtrackPermuted . triangulate
where
backtrackPermuted (mx, permutations) =
Ve... | hrsrashid/nummet | lib/SlaeGauss.hs | Haskell | bsd-3-clause | 2,689 |
module Paths_variants (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName, getSysconfDir
) where
import qualified Control.Exception as Exception
import Data.Version (Version(..))
import System.Environment (getEnv)
import Prelude
catchIO :: IO a -> (Exception.IOException -> IO a) ... | josephDunne/variants | dist/build/autogen/Paths_variants.hs | Haskell | bsd-3-clause | 1,313 |
{-# LANGUAGE PatternSignatures #-}
module Main where
import GHC.Conc
import Control.Exception
import Foreign.StablePtr
import System.IO
import GHC.Conc.Sync (atomicallyWithIO)
inittvar :: STM (TVar String)
inittvar = newTVar "Hello world"
deadlock0 :: STM String
deadlock0 = retry
deadlock1 :: TVar String -> STM Str... | mcschroeder/ghc | libraries/base/tests/Concurrent/stmio047.hs | Haskell | bsd-3-clause | 1,402 |
{-# LANGUAGE RecordWildCards #-}
module Main (main) where
import GeoLabel (toString, fromString')
import GeoLabel.Strings (format, parse)
import GeoLabel.Strings.Wordlist (wordlist)
import GeoLabel.Geometry.QuadTree (Subface(A,B,C,D))
import GeoLabel.Geometry.Point (lengthOf, (<->))
import GeoLabel.Geometry.Conversio... | wyager/GeoLabel | src/GeoLabel/Test.hs | Haskell | bsd-3-clause | 2,776 |
{-|
Module : Reactive.DOM.Children.MonotoneList
Description : Definition of the MonotoneList children container.
Copyright : (c) Alexander Vieth, 2016
Licence : BSD3
Maintainer : aovieth@gmail.com
Stability : experimental
Portability : non-portable (GHC only)
-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LA... | avieth/reactive-dom | Reactive/DOM/Children/MonotoneList.hs | Haskell | bsd-3-clause | 1,438 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
-----------------------------------------------------------------------------
-- | DBSocketT transformer which signs and issues network requests.
---------------------... | jnonce/azure-docdb | lib/Azure/DocDB/SocketMonad/DBSocketT.hs | Haskell | bsd-3-clause | 5,678 |
import Test.Hspec
import Control.Comonad.Cofree.Cofreer.Spec
import Control.Monad.Free.Freer.Spec
import GL.Shader.Spec
import UI.Layout.Spec
main :: IO ()
main = hspec . parallel $ do
describe "Control.Comonad.Cofree.Cofreer.Spec" Control.Comonad.Cofree.Cofreer.Spec.spec
describe "Control.Monad.Free.Freer.Spec" C... | robrix/ui-effects | test/Spec.hs | Haskell | bsd-3-clause | 450 |
-- | A name binding context, or environment.
module Hpp.Env where
import Hpp.Types (Macro)
-- | A macro binding environment.
type Env = [(String, Macro)]
-- | Delete an entry from an association list.
deleteKey :: Eq a => a -> [(a,b)] -> [(a,b)]
deleteKey k = go
where go [] = []
go (h@(x,_) : xs) = if x == ... | bitemyapp/hpp | src/Hpp/Env.hs | Haskell | bsd-3-clause | 731 |
module Dice where
import Control.Monad (liftM)
import Control.Monad.Random
import Data.List (intercalate)
data DiceBotCmd =
Start
| Quit
| Roll { cmdDice :: [Die] }
| None
| Bad { cmdBad :: String }
deriving (Show, Eq)
data Die =
Const { dieConst :: Int }
| Die { dieNum :: Int, dieType :: Int }
... | haskell-ro/hs-dicebot | Dice.hs | Haskell | bsd-3-clause | 873 |
import Data.Either
import Test.Hspec
import qualified Text.Parsec as P
import Lib
import Lexer as L
import Parser as P
program = unlines
[ "dong inflate."
, "[ 3 ] value."
, "[ :x | x name ] value: 9."
]
lexerSpec = do
describe "parseToken" $ do
let parseToken = P.parse L.parseToken "(spec)"
it... | rjeli/luatalk | test/Spec.hs | Haskell | bsd-3-clause | 5,511 |
{-# LANGUAGE LambdaCase #-}
module Main (main) where
import System.Environment (getArgs)
eyes = cycle ["⦿⦿", "⦾⦾", "⟐⟐", "⪽⪾", "⨷⨷", "⨸⨸", "☯☯", "⊙⊙", "⊚⊚", "⊛⊛", "⨕⨕", "⊗⊗", "⊘⊘", "⊖⊖", "⁌⁍", "✩✩", "❈❈"]
shells = cycle ["()", "{}", "[]", "⨭⨮", "⨴⨵", "⊆⊇", "∣∣"]
bodies = cycle ["███", "XXX", "⧱⧰⧱", "⧯⧮⧯", "⧲⧳⧲","🁢�... | getmillipede/millipede-haskell | app/Main.hs | Haskell | bsd-3-clause | 1,023 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
-- | This module builds Docker (OpenContainer) images.
... | rvion/stack | src/Stack/Image.hs | Haskell | bsd-3-clause | 8,426 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
-- | Auxilary definitions for 'Semigroup'
--
-- This module provides some @newtype@ wrappers and helpers which are
-- reexported from the "Data.S... | ezyang/ghc | libraries/base/Data/Semigroup/Internal.hs | Haskell | bsd-3-clause | 7,619 |
{-# LANGUAGE Haskell2010 #-}
{-# LINE 1 "System/Process/Common.hs" #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE RecordWildCards #-}
module System.Process.Common
( CreateProcess (..)
, CmdSpec (..)
, StdStream (..)
, ProcessHandle(..)
, ProcessHandle... | phischu/fragnix | tests/packages/scotty/System.Process.Common.hs | Haskell | bsd-3-clause | 9,966 |
<?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="ko-KR">
<title>Revisit | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapref loc... | 0xkasun/security-tools | src/org/zaproxy/zap/extension/revisit/resources/help_ko_KR/helpset_ko_KR.hs | Haskell | apache-2.0 | 969 |
{-# LANGUAGE TypeOperators, MultiParamTypeClasses, FlexibleInstances #-}
{-# OPTIONS_GHC -Wall #-}
module Mixin where
import Prelude hiding (log)
class a <: b where
up :: a -> b
instance (t1 <: t2) => (t -> t1) <: (t -> t2) where
up f = up . f
instance (t1 <: t2) => (t2 -> t) <: (t1 -> t) where
up f = f . up... | bixuanzju/fcore | lib/Mixin.hs | Haskell | bsd-2-clause | 1,062 |
module Head where
{-@ measure hd :: [a] -> a
hd (x:xs) = x
@-}
-- Strengthened constructors
-- data [a] where
-- [] :: [a] -- as before
-- (:) :: x:a -> xs:[a] -> {v:[a] | hd v = x}
{-@ cons :: x:a -> _ -> {v:[a] | hd v = x} @-}
cons x xs = x : xs
{-@ test :: {v:_ | hd v = 0} @-}
test :: [In... | abakst/liquidhaskell | tests/todo/partialmeasureOld.hs | Haskell | bsd-3-clause | 356 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
module Bug where
import Data.Kind
type HRank1 ty = forall k1. k1 -> ty
type HRank2 ty = forall k2. k2 -> ty
data HREFL11 :: HRank1 (HRank1 Type) -- FAILS
data HREFL12 :: HRank1 (HRank2 Type)
data HREFL21 :: HRank2 (HRank1 Type)
data HR... | sdiehl/ghc | testsuite/tests/polykinds/T14515.hs | Haskell | bsd-3-clause | 359 |
module Main where
import GHC
import MonadUtils
import System.Environment
main :: IO ()
main = do [libdir] <- getArgs
runGhc (Just libdir) doit
doit :: Ghc ()
doit = do
getSessionDynFlags >>= setSessionDynFlags
dyn <- dynCompileExpr "()"
liftIO $ print dyn
| siddhanathan/ghc | testsuite/tests/ghc-api/dynCompileExpr/dynCompileExpr.hs | Haskell | bsd-3-clause | 278 |
{-# LANGUAGE TypeFamilies #-}
module T1897b where
import Control.Monad
import Data.Maybe
class Bug s where
type Depend s
next :: s -> Depend s -> Maybe s
start :: s
-- isValid :: (Bug s) => [Depend s] -> Bool
-- Inferred type should be rejected as ambiguous
isValid ds = isJust $ foldM next start ds
| forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/indexed-types/should_fail/T1897b.hs | Haskell | bsd-3-clause | 316 |
{-# OPTIONS_GHC -fno-safe-infer #-}
-- | Basic test to see if no safe infer flag compiles
-- This module would usually infer safely, so it shouldn't be safe now.
-- We don't actually check that here though, see test '' for that.
module SafeFlags27 where
f :: Int
f = 1
| wxwxwwxxx/ghc | testsuite/tests/safeHaskell/flags/SafeFlags27.hs | Haskell | bsd-3-clause | 271 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.