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 qualified Sonos.Main as M
main :: IO ()
main = M.main
| merc1031/haskell-sonos-http-api | app/Main.hs | Haskell | bsd-3-clause | 81 |
module ErrorMessagesSpec where
import TestImport
import Data.List
import qualified Data.Map as M
import qualified Parser
import Codegen
import Err
import Text.RawString.QQ (r)
spec :: Spec
spec = describe "generateDedan" $ context "should show context in errors" $ do
it "in servers" $ do
testErrorMessa... | zyla/rybu | test/ErrorMessagesSpec.hs | Haskell | bsd-3-clause | 2,683 |
module Even where
{-@ type Even = {v:Int | v mod 2 = 0} @-}
{-@ notEven :: Int -> Even @-}
notEven :: Int -> Int
notEven x = x * 2
| ssaavedra/liquidhaskell | tests/pos/Even.hs | Haskell | bsd-3-clause | 134 |
--
-- Copyright (C) 2012 Parallel Scientific. All rights reserved.
--
-- See the accompanying LICENSE file for license information.
--
import Control.Exception ( finally )
import Control.Monad ( forever, void )
import qualified Data.ByteString.Char8 as B ( putStrLn, pack )
import Network.CCI ( wi... | tkonolige/haskell-cci | examples/Server.hs | Haskell | bsd-3-clause | 976 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeApplications #-}
module Main where
import qualified ... | k0001/haskell-money | safe-money-cereal/test/Main.hs | Haskell | bsd-3-clause | 8,375 |
-- | This module provides support for parsing values from ByteString
-- 'InputStream's using @attoparsec@. /Since: 1.4.0.0./
module System.IO.Streams.Attoparsec.ByteString
( -- * Parsing
parseFromStream
, parserToInputStream
, ParseException(..)
) where
----------------------------------------------------... | LukeHoersten/io-streams | src/System/IO/Streams/Attoparsec/ByteString.hs | Haskell | bsd-3-clause | 3,289 |
-- Utility for sending a command to xmonad and have
-- it immediately executed even when xmonad isn't built
-- with -threaded.
module Main () where
import Control.Concurrent
import Control.Monad
import Data.List
import Data.Monoid
import Data.Word
import Graphics.X11.Xlib
import Graphics.X11.Xlib.Event
import Graphics... | LeifW/xmonad-extras | XMonadCmd.hs | Haskell | bsd-3-clause | 2,902 |
{-# LANGUAGE NoImplicitPrelude, CPP #-}
{-| Export Prelude as in base 4.8.0
-}
{-
Copyright (C) 2015 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 mus... | leshchevds/ganeti | src/Ganeti/Prelude.hs | Haskell | bsd-2-clause | 6,145 |
module Github.Teams (
teamInfoFor
,teamInfoFor'
,teamsInfo'
,createTeamFor'
,editTeam'
,deleteTeam'
,listTeamsCurrent'
,module Github.Data
) where
import Github.Data
import Github.Private
-- | The information for a single team, by team id.
-- | With authentication
--
-- > teamInfoFor' (Just $ GithubOAuth "token") 10... | beni55/github | Github/Teams.hs | Haskell | bsd-3-clause | 1,999 |
{-# LANGUAGE FlexibleInstances #-}
module MockedProcess where
import MockedEnv
import Control.Monad.IO.Class
import Control.Monad.Trans.Reader
import Tinc.Process
type ReadProcess = FilePath -> [String] -> String -> IO String
type CallProcess = FilePath -> [String] -> IO ()
data Env = Env {
envReadProcess :: Rea... | sol/tinc | test/MockedProcess.hs | Haskell | mit | 664 |
module Util.DocLike(module Util.DocLike, module Data.Monoid) where
-- simplified from Doc.DocLike
import Control.Applicative
import Data.Monoid(Monoid(..),(<>))
import Data.Traversable as T
import qualified Text.PrettyPrint.HughesPJ as P
import qualified Text.PrettyPrint.Leijen as L
--infixr 5 <$> -- ,<//>,<$>,<$$>
... | hvr/jhc | src/Util/DocLike.hs | Haskell | mit | 4,453 |
{-# LANGUAGE BangPatterns, CPP, OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
module Aeson
(
aeson
, value'
) where
import Data.ByteString.Builder
(Builder, byteString, toLazyByteString, charUtf8, word8)
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((*>), (<$>), (<*)... | beni55/attoparsec | benchmarks/Aeson.hs | Haskell | bsd-3-clause | 11,671 |
<?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="sq-AL">
<title>Code Dx | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapref loca... | thc202/zap-extensions | addOns/codedx/src/main/javahelp/org/zaproxy/zap/extension/codedx/resources/help_sq_AL/helpset_sq_AL.hs | Haskell | apache-2.0 | 968 |
-- | UTF-8 encode a text
--
-- Tested in this benchmark:
--
-- * Replicating a string a number of times
--
-- * UTF-8 encoding it
--
module Benchmarks.EncodeUtf8
( benchmark
) where
import Criterion (Benchmark, bgroup, bench, whnf)
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as ... | beni55/text | benchmarks/haskell/Benchmarks/EncodeUtf8.hs | Haskell | bsd-2-clause | 901 |
{-# LANGUAGE DeriveDataTypeable, TypeFamilies, TemplateHaskell,
RankNTypes, NamedFieldPuns, RecordWildCards,
RecursiveDo, BangPatterns, CPP #-}
module Distribution.Server.Features.HoogleData (
initHoogleDataFeature,
HoogleDataFeature(..),
) where
import Distribution.Server.Framework... | ocharles/hackage-server | Distribution/Server/Features/HoogleData.hs | Haskell | bsd-3-clause | 14,928 |
-- Trac #958
module ShoulFail where
data Succ a = S a -- NB: deriving Show omitted
data Seq a = Cons a (Seq (Succ a)) | Nil deriving Show
| ezyang/ghc | testsuite/tests/typecheck/should_fail/tcfail169.hs | Haskell | bsd-3-clause | 148 |
{-# LANGUAGE Arrows #-}
module Main(main) where
import Control.Arrow
import Control.Category
import Prelude hiding (id, (.))
class ArrowLoop a => ArrowCircuit a where
delay :: b -> a b b
-- stream map instance
data Stream a = Cons a (Stream a)
instance Functor Stream where
fmap f ~(Cons a as) = Cons (f a) (fmap... | wxwxwwxxx/ghc | testsuite/tests/arrows/should_run/arrowrun003.hs | Haskell | bsd-3-clause | 3,614 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
module JPSubreddits.Types where
import Control.Applicative
import Control.Monad
import Control.Monad.IO.Class (MonadIO)
import Data.Aeson (FromJSON (..), ToJSON (..), object, (.:), (.=))
import Data.Text (T... | sifisifi/jpsubreddits | src/JPSubreddits/Types.hs | Haskell | mit | 2,136 |
-- prolog engine v1
-- TODO lists and strings
import Prelude hiding (pred)
import Test.Hspec
import Text.ParserCombinators.Parsec
import Text.Parsec.Error
import Control.Applicative hiding ((<|>), many)
import Control.Monad
import System.IO
import Data.List
import Data.Maybe
import qualified Data.Map as Map
--im... | jbalint/banshee-sympatico | meera/prolog_engine1.hs | Haskell | mit | 13,740 |
module Operation
( Operation(..)
, operate
, undo
) where
import Data.Ix
data Operation = SwapIndices Int Int
| SwapLetters Char Char
| RotateLeft Int
| RotateRight Int
| RotateAroundLetter Char
| Reverse Int Int
| Move Int Int
... | ajm188/advent_of_code | 2016/21/Operation.hs | Haskell | mit | 2,988 |
module Test where
import Nat
import System.Random (newStdGen, randomRs)
import Tree (FoldTree (..), Tree (..))
tOrder = (5,2,10)
tBits = [15..17]
tFirstNat = fromInteger (5) :: Nat
tSecondNat = fromInteger (7) :: Nat
tContains = [[1..5], [2,0], [3,4]]
tList3 = [1..3] :: [Int... | mortum5/programming | haskell/ITMO-Course/hw1/src/Test.hs | Haskell | mit | 1,068 |
{-# LANGUAGE OverloadedStrings #-}
module Text.Blaze.Bootstrap where
import qualified Text.Blaze.Html5 as BH
import qualified Text.Blaze.Internal as TBI
nav :: BH.Html -- ^ Inner HTML.
-> BH.Html -- ^ Resulting HTML.
nav = TBI.Parent "nav" "<nav" "</nav>"
-- Bootstrap attributes
dataToggle :: BH.AttributeValu... | lhoghu/happstack | src/Text/Blaze/Bootstrap.hs | Haskell | mit | 1,444 |
module TestHelpers where
import qualified Data.Aeson as AE
import qualified Data.Aeson.Encode.Pretty as AE
import qualified Data.ByteString.Lazy.Char8 as BS
import Data.Maybe (fromJust)
import Data.Text (Text, pack)
import GHC.Generics (Generic)
import Network.JSONApi
import Network.URL (URL, importURL)
prettyEncode ... | toddmohney/json-api | test/TestHelpers.hs | Haskell | mit | 2,915 |
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE RecordWildCards #-}
------------------------------------------------------------------------------
-- |
-- Module : Forecast
-- Copyright : (C) 2014 Samuli Thomasson
-- License : MIT (see the file LICENSE)
-- Ma... | Multi-Axis/habbix | src/Forecast.hs | Haskell | mit | 4,506 |
module Main where
factorial :: Integer -> Integer
factorial x
| x > 1 = x * factorial(x -1)
| otherwise = 1
| mtraina/seven-languages-seven-weeks | week-7-haskell/day1/factorial_with_guards.hs | Haskell | mit | 124 |
import System.IO
import System.Environment
import Paths_hackertyper
main = do
args <- getArgs
let n = if null args then 3 else read (args !! 0) :: Int
hSetBuffering stdout NoBuffering
hSetBuffering stdin NoBuffering
hSetEcho stdin False
kernelPath <- getDataFileName "kernel.txt"
kernel <- re... | fgaz/hackertyper | hackertyper.hs | Haskell | mit | 493 |
module Numbering where
import URM
piF m n = 2^m*(2*n+1)-1
xiF m n q = piF (piF (m-1) (n-1)) (q-1)
tauF as = (sum $ map (2^) as)-1
tauF' x = f (x+1) 0 where
f 0 _ = []
f b k | m==0 = r
| m==1 = k:r
where
r = f d (k+1)
(d,m) = b `divMod` 2
betaF (Z n) = 4*(n-1)
betaF (S n) = 4*(n-1)+1
betaF (T m... | ducis/URMsim | Numbering.hs | Haskell | mit | 567 |
module Ylang.Lexer where
import Text.Parsec.String (Parser)
import Text.Parsec.Language (emptyDef)
import qualified Text.Parsec.Token as Token
lexer :: Token.TokenParser ()
lexer = Token.makeTokenParser style
where
style = emptyDef {
Token.commentLine = commentLine
, Token.reservedOpNames = o... | VoQn/ylang | Ylang/Lexer.hs | Haskell | apache-2.0 | 1,011 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QGraphicsItem.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:25
Warning : this file is machine generated - do... | uduki/hsQt | Qtc/Gui/QGraphicsItem.hs | Haskell | bsd-2-clause | 106,074 |
module Main where
import Crypto.Classes
import Crypto.Hash.Ed2k
import Crypto.Types (BitLength)
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy.Char8 as L
import Data.Int (Int64)
import Data.Tagged
import Test.Framework (defaultMain, testGroup, Test)
import Test.Framework.Providers.HU... | nullref/haskell-hash-ed2k | Test/Ed2k.hs | Haskell | bsd-2-clause | 1,991 |
{-# LANGUAGE OverloadedStrings #-}
module Game.GameChase where
import Control.Lens (use, (^.), (.=), zoom, ix, preuse, (%=), (&), (+~), (%~))
import Control.Monad (unless, liftM)
import Data.Bits ((.&.), complement)
import Linear (_x, _z, normalize)
import {-# SOURCE #-} Game.GameImportT
import Game.CVarT
import Game... | ksaveljev/hake-2 | src/Game/GameChase.hs | Haskell | bsd-3-clause | 4,042 |
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Actions.DynamicWorkspaces
-- Copyright : (c) David Roundy <droundy@darcs.net>
-- License : BSD3-style (see LICENSE)
--
-- Maintainer : none
-- Stability : unstable
-- Portability : unportable
--
-- ... | markus1189/xmonad-contrib-710 | XMonad/Actions/DynamicWorkspaces.hs | Haskell | bsd-3-clause | 8,317 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
#if __GLASGOW_HASKELL__ >= 800
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
#endif
-- | Execute commands within the properly configured Stack
-- environment.
module Stack.Exec where
import ... | martin-kolinek/stack | src/Stack/Exec.hs | Haskell | bsd-3-clause | 2,839 |
{-# language CPP #-}
-- | = Name
--
-- VK_EXT_global_priority - device extension
--
-- == VK_EXT_global_priority
--
-- [__Name String__]
-- @VK_EXT_global_priority@
--
-- [__Extension Type__]
-- Device extension
--
-- [__Registered Extension Number__]
-- 175
--
-- [__Revision__]
-- 2
--
-- [__Extension ... | expipiplus1/vulkan | src/Vulkan/Extensions/VK_EXT_global_priority.hs | Haskell | bsd-3-clause | 6,417 |
{-# LANGUAGE DeriveGeneric #-}
module Crawl.Stats.Shield where
import qualified Data.Csv as CSV
import GHC.Generics (Generic)
import qualified Data.Default as Default
import qualified Crawl.Stats.Named as Named
data Shield = Shield {
name :: String,
block :: Integer,
evPenalty :: Integer,
dexContrib :: Inte... | jfrikker/crawlstats | src/Crawl/Stats/Shield.hs | Haskell | bsd-3-clause | 529 |
-- Config.hs
{-# OPTIONS_GHC -Wall #-}
module Lab2.Config( cL
, cN
, hilbertDim
, imageSize
) where
hilbertDim :: Int
hilbertDim = 16 -- for max value of 65535
cL, cN :: Int
cL = 3
cN = 4
imageSize :: Num a => a
imageSize = 500
| ghorn/cs240h-class | Lab2/Config.hs | Haskell | bsd-3-clause | 305 |
module Data.Wavelets.ReconstructionSpec (main, spec) where
import Test.Hspec
import Data.Wavelets.Reconstruction
import Data.Wavelets
import System.IO
import qualified Data.Vector.Storable as V
{-| The test waveletData below was transformed into several of the result dataFiles |-}
-- 3 sinusoids added together to m... | smurphy8/wavelets | test/Data/Wavelets/ReconstructionSpec.hs | Haskell | bsd-3-clause | 1,533 |
{-# LANGUAGE RankNTypes #-}
module Parser (parseTerm) where
import Syntax
import Text.Parsec hiding(State)
import Text.Parsec.String
import qualified Text.Parsec.Token as P
import Text.Parsec.Language
import Data.Char
import Control.Monad
import Control.Appl... | yu-i9/SystemF | parser/Parser.hs | Haskell | bsd-3-clause | 5,199 |
module Tests.Regress
( testTree -- :: TestTree
) where
import Test.Tasty
import qualified Tests.Regress.Issue13 as Issue13
import qualified Tests.Regress.FlatTerm as FlatTerm
--------------------------------------------------------------------------------
-- Tests and properties
testTree :: TestTree
... | arianvp/binary-serialise-cbor | tests/Tests/Regress.hs | Haskell | bsd-3-clause | 407 |
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell #-}
module Web.Zwaluw (
-- * Types
Router, (:-)(..), (<>), (.~)
-- * Running routers
, parse, unparse
, parse1, unparse1
-- * Router combinators
, pure, xmap, xma... | MedeaMelana/Zwaluw | Web/Zwaluw.hs | Haskell | bsd-3-clause | 5,875 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1998
\section[DataCon]{@DataCon@: Data Constructors}
-}
{-# LANGUAGE CPP, DeriveDataTypeable #-}
module DataCon (
-- * Main data types
DataCon, DataConRep(..),
SrcStrictness(..), SrcUnpackedness(..),
... | vikraman/ghc | compiler/basicTypes/DataCon.hs | Haskell | bsd-3-clause | 50,860 |
{-
(c) The University of Glasgow 2006
(c) The AQUA Project, Glasgow University, 1994-1998
Desugaring foreign calls
-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
module DsCCall
( dsCCall
, mkFCall
, unboxArg
, boxResult
, resultWrapper
) wher... | sdiehl/ghc | compiler/deSugar/DsCCall.hs | Haskell | bsd-3-clause | 14,632 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
#if __GLASGOW_HASKELL__ >= 707
{-# LANGUAGE RoleAnnotations #-}
#endif
------------------------------------------------------------... | ddssff/lens | src/Control/Lens/Internal/Context.hs | Haskell | bsd-3-clause | 12,647 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
module Analytics
( runAnalytics
, analyzeBoard
) where
import Data.Aeson (eitherDecode, FromJSON)
import Data.Either (rights, lefts)
... | k4smiley/Chan | src/Analytics.hs | Haskell | bsd-3-clause | 4,721 |
import Control.Monad (unless)
import qualified Data.ByteString as BS
import qualified Data.HashMap.Strict as HM
import qualified Data.Vector as V
import Data.Yaml
import System.Environment (getArgs)
import System.IO (stdout)
main :: IO ()
main = do
vs <- getArgs >>= decodeFiles
unless (null vs) $ do
let bs = e... | djoyner/yamlmerge | Main.hs | Haskell | bsd-3-clause | 1,224 |
{- |
Copyright : Galois, Inc. 2012-2014
License : BSD3
Maintainer : jhendrix@galois.com
Stability : experimental
Portability : non-portable (language extensions)
-}
module Main where
import System.Environment (getArgs)
import Verifier.SAW
processFile :: FilePath -> IO ()
processFile file = do
sc <- mkSha... | iblumenfeld/saw-core | tools/extcore-info.hs | Haskell | bsd-3-clause | 547 |
import Data.Pipe
import GHC.Event
| YoshikuniJujo/xmpipe | test/testMergeChan.hs | Haskell | bsd-3-clause | 36 |
import Disorder.Core.Main
import qualified Test.Zodiac.HttpClient.Request
import qualified Test.Zodiac.HttpClient.TSRP
main :: IO ()
main =
disorderMain [
Test.Zodiac.HttpClient.Request.tests
, Test.Zodiac.HttpClient.TSRP.tests
]
| ambiata/zodiac | zodiac-http-client/test/test.hs | Haskell | bsd-3-clause | 252 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
-- |
-- Module: $HEADER$
-- Description: TODO
-... | FPBrno/dht-dks | src/Data/DHT/DKS/Type/Message/JoinDone.hs | Haskell | bsd-3-clause | 988 |
{-# LANGUAGE CPP #-}
module TcInteract (
solveSimpleGivens, -- Solves [EvVar],GivenLoc
solveSimpleWanteds -- Solves Cts
) where
#include "HsVersions.h"
import BasicTypes ()
import TcCanonical
import TcFlatten
import VarSet
import Type
import Unify
import InstEnv( DFunInstType, lookupInstEnv, instan... | green-haskell/ghc | compiler/typecheck/TcInteract.hs | Haskell | bsd-3-clause | 73,245 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.GL.PixelRectangles.Rasterization
-- Copyright : (c) Sven Panne 2002-2005
-- License : BSD-style (see the file libraries/OpenGL/LICENSE)
--
-- Maintainer : sven.panne@aedion.de
-- ... | FranklinChen/hugs98-plus-Sep2006 | packages/OpenGL/Graphics/Rendering/OpenGL/GL/PixelRectangles/Rasterization.hs | Haskell | bsd-3-clause | 1,872 |
----------------------------------------------------------------
-- Модуль приложения
-- Скрипты графического интерфейса (HScript)
-- Язык JavaScript
----------------------------------------------------------------
module WebUI.Scripts.JavaScript.HJavaScript
( module HJavaScriptBuilder
, module HJavaScriptTyp... | iqsf/HFitUI | src/WebUI/Scripts/JavaScript/HJavaScript.hs | Haskell | bsd-3-clause | 2,483 |
<?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="pt-BR">
<title>Eventos Enviados pelo Servidor | Exstensão do ZAP</title>
<maps>
<homeID>top... | veggiespam/zap-extensions | addOns/sse/src/main/javahelp/org/zaproxy/zap/extension/sse/resources/help_pt_BR/helpset_pt_BR.hs | Haskell | apache-2.0 | 998 |
{-# LANGUAGE BangPatterns, DeriveDataTypeable #-}
module Eta.Profiling.CostCentre (
CostCentre(..), CcName, IsCafCC(..),
-- All abstract except to friend: ParseIface.y
CostCentreStack,
CollectedCCs,
noCCS, currentCCS, dontCareCCS,
noCCSAttached, isCurrentCCS,
... | rahulmutt/ghcvm | compiler/Eta/Profiling/CostCentre.hs | Haskell | bsd-3-clause | 11,032 |
{-# LANGUAGE OverloadedStrings #-}
module System.Mesos.Raw.FrameworkInfo where
import System.Mesos.Internal
import System.Mesos.Raw.FrameworkId
type FrameworkInfoPtr = Ptr FrameworkInfo
foreign import ccall "ext/types.h toFrameworkInfo" c_toFrameworkInfo
:: Ptr CChar
-> CInt
-> Ptr CChar
-... | Atidot/hs-mesos | src/System/Mesos/Raw/FrameworkInfo.hs | Haskell | mit | 3,065 |
-- Copyright (c) Microsoft. All rights reserved.
-- Licensed under the MIT license. See LICENSE file in the project root for full license information.
{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
{-|
Copyright : (c) Microsoft
License : MIT
Maintainer : adamsap@microsoft.com
Stability : provisional
Por... | jdubrule/bond | compiler/src/Language/Bond/Codegen/TypeMapping.hs | Haskell | mit | 23,861 |
{-# LANGUAGE TypeFamilies #-}
module Data.Mutable.Deque
( Deque
, UDeque
, asUDeque
, SDeque
, asSDeque
, BDeque
, asBDeque
, module Data.Mutable.Class
) where
import Control.Exception (assert)
import Control.Monad (liftM)
import ... | bitemyapp/mutable-containers | Data/Mutable/Deque.hs | Haskell | mit | 4,740 |
<?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="ru-RU">
<title>Revisit | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapref loc... | 0xkasun/security-tools | src/org/zaproxy/zap/extension/revisit/resources/help_ru_RU/helpset_ru_RU.hs | Haskell | apache-2.0 | 969 |
{-# LANGUAGE ViewPatterns #-}
module PrettyPrint (showExpr) where
import Data.List (intersperse)
import qualified Language.Java.Pretty (prettyPrint)
import Text.PrettyPrint.ANSI.Leijen (Doc, (<+>), (<>), text, dot, colon)
import qualified Text.PrettyPrint.ANSI.Leijen as PP
import Unbound... | bixuanzju/fcore | lib/newlib/PrettyPrint.hs | Haskell | bsd-2-clause | 5,268 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import Prelude.Compat
import Control.DeepSeq
import Control.Exception
import Control.Monad
import Data.Aeson
import Data.Aeson.Parser
import Data.Attoparsec
import Data.Time.Clock
import Syste... | dmjio/aeson | benchmarks/bench/ReadFile.hs | Haskell | bsd-3-clause | 904 |
{-# LANGUAGE LambdaCase, RankNTypes, BangPatterns #-}
module Stream.Combinators where
import Stream.Types
import Control.Applicative
import Control.Monad hiding (foldM)
import Control.Monad.Trans
import Control.Monad.Morph
import Data.Functor.Identity
import qualified Control.Monad.Trans.Free as Free
import Control... | haskell-streaming/streaming | benchmarks/old/Stream/Combinators.hs | Haskell | bsd-3-clause | 7,792 |
-----------------------------------------------------------------------------
-- |
-- Module : RefacFunDef
-- Copyright : (c) Christopher Brown 2005
--
-- Maintainer : cmb21@kent.ac.uk
-- Stability : provisional
-- Portability : portable
--
-- This module contains a transformation for HaRe.
-- Function D... | kmate/HaRe | old/refactorer/RefacFunDef.hs | Haskell | bsd-3-clause | 39,473 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, UnboxedTuples, AutoDeriveTypeable #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
{-# OPTIONS_HADDOCK not-home #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Conc.Windows
-- C... | frantisekfarka/ghc-dsi | libraries/base/GHC/Conc/Windows.hs | Haskell | bsd-3-clause | 11,013 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE ExistentialQuantification #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.StaticPtr
-- Copyright : (C) 2014 I/O Tw... | beni55/haste-compiler | libraries/ghc-7.10/base/GHC/StaticPtr.hs | Haskell | bsd-3-clause | 4,186 |
module Where4 where
-- source functions
f1 :: [a] -> [a]
f1 l = ls
where
ls = take (rs - 1) l
rs = length l
f2 :: [a] -> Int
f2 l = rs - 1
where
rs = length l | mpickering/HaRe | old/testing/merging/Where4_TokOut.hs | Haskell | bsd-3-clause | 210 |
import Distribution.Simple
import Ros.Internal.SetupUtil
main = defaultMainWithHooks $
simpleUserHooks { confHook = rosConf }
| bitemyapp/roshask | Examples/Turtle/Setup.hs | Haskell | bsd-3-clause | 134 |
-- | A collection of commonly-used combinators to build up larger
-- codecs.
module Data.Wheat.Combinators where
import Control.Applicative ((<$>))
import Control.Monad ((>=>))
import Data.Foldable (foldMap)
import Data.Functor.Contravariant.Divisible (divide)
import Data.Monoid (Monoid, (<>))
-- Local imports
import... | barrucadu/wheat | Data/Wheat/Combinators.hs | Haskell | mit | 3,946 |
{-# LANGUAGE OverloadedStrings #-}
module Haskbot.Internal.Request
( Params
, jsonContentType
, textContentType
, getPostParams
, headOnly
, getParamsMap
, optParam
, reqParam
) where
import Control.Monad.Error (liftIO, throwError)
import Data.ByteString.Lazy (fromStrict)
import Data.Text (Text)
import Data.Text.Enco... | Jonplussed/haskbot-core | src/Haskbot/Internal/Request.hs | Haskell | mit | 1,512 |
{-# LANGUAGE ScopedTypeVariables
, ExistentialQuantification
, LambdaCase
, KindSignatures
#-}
module Document.VarScope where
-- Modules
import Document.Phase.Types
import Document.Scope
import Latex.Parser (uncurry3)
import Logic.Expr
import UnitB.Syntax
-- Libraries
impor... | literate-unitb/literate-unitb | src/Document/VarScope.hs | Haskell | mit | 10,411 |
module Main where
import Engine
import GLUI
import SimpleBots
main :: IO ()
main = runBattle openGLUI [
("bot1", runInCircle),
("bot2", fireBot)
]
| andreyLevushkin/LambdaWars | src/Main.hs | Haskell | mit | 173 |
module Handler.CustomError where
import Assets (getAllExams)
import Import
import Widgets (titleWidget, iconWidget, publicExamWidget, privateExamWidget)
-- | Custom 404 page
getCustomErrorR :: Handler Html
getCustomErrorR = do
setUltDestCurrent
memail <- lookupSession "_ID"
(publicExams, privateExams) <- ... | cirquit/quizlearner | quizlearner/Handler/CustomError.hs | Haskell | mit | 454 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE... | parsonsmatt/QuickLift | src/Models.hs | Haskell | mit | 3,145 |
-- Tiny lambda-Micro-Haskell program TPJ 2015
z = 10 ;
neg b = if b then False else True ;
mnsdbl m n = m - n - n ;
once f x = f x ;
twice f x = f (f x) ;
| jaanos/TPJ-2015-16 | lmh/tiny_lmh.hs | Haskell | mit | 157 |
import qualified Codec.Archive.Tar as Tar
import qualified Codec.Compression.GZip as GZ
import Control.Monad (forM_, when)
import Data.ByteString (ByteString)
import qualified Data.ByteString.Lazy as BL
import Data.Char (toLower)
import qualified Data.Text.Lazy.IO as TL
import Di... | pepijnkokke/homebrew-hackage | Main.hs | Haskell | mit | 3,728 |
module Main where
import Popeye.CLI
main :: IO ()
main = run
| codeclimate/popeye | app/Main.hs | Haskell | mit | 63 |
#!/usr/bin/env stack
-- stack --install-ghc runghc --package turtle
-- #!/bin/bash
{-# LANGUAGE OverloadedStrings #-} --
--
import Turtle
say = echo
main = say "Hello, world!"
| capitanbatata/functional-systems-in-haskell | fsh-exercises/scripts/example1.hs | Haskell | mit | 260 |
-- The number, 197, is called a circular prime because
-- all rotations of the digits: 197, 971, and 719, are themselves prime.
-- There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97.
-- How many circular primes are there below one million?
module Euler35 where
import Data.Num... | kirhgoff/haskell-sandbox | euler35/euler35.hs | Haskell | mit | 1,333 |
main :: IO ()
main = putStrLn $ show $ solve
solve :: Int
solve = sum [sumMultiplesToN 3 1000, sumMultiplesToN 5 1000, -sumMultiplesToN 15 1000]
sumMultiplesToN :: (Integral a) => a -> a -> a
sumMultiplesToN m n = m * (sumToN $ (n-1) `div` m)
sumToN :: (Integral a) => a -> a
sumToN n = n * (n+1) `div` 2
| pshendry/project-euler-solutions | 0001/solution.hs | Haskell | mit | 308 |
{-# Language InstanceSigs, DoAndIfThenElse #-}
module Observables where
import Prelude hiding (map, takeWhile)
import System.IO
import Data.Char
import System.Console.ANSI
import Control.Monad
import Control.Monad.Trans
import qualified Data.List
import Data.IORef
import Coroutine
(|>) :: a -> (a -> b) -> b
x |> f ... | holoed/Rx.hs | Observables.hs | Haskell | apache-2.0 | 4,421 |
module Inference
(
inferRules
) where
import Types
infer :: Relation -> Expr -> [Relation]
infer (premices `Imply` (lhs `And` rhs)) goal =
infer (premices `Imply` rhs) goal ++
infer (premices `Imply` lhs) goal
infer (premices `Imply` (lhs `Or` rhs)) goal =
infer ((premices `And` Not lhs) `Imply` rhs) ... | tmielcza/demiurge | src/Inference.hs | Haskell | apache-2.0 | 1,568 |
-----------------------------------------------------------------------------
--
-- Module : Marshaller
-- Description :
-- Copyright : (c) Tobias Reinhardt, 2015 <tobioso92_@hotmail.com
-- License : Apache License, Version 2.0
--
-- Maintainer : Tobias Reinhardt <tobioso92_@hotmail.com>
-- Portability ... | tobiasreinhardt/show | CLIArguments/src/Marshaller.hs | Haskell | apache-2.0 | 3,915 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Seraph.Model
( Directive(..)
, Event(..)
, OracleM
, oracle
, oracleModel
, oracleDebug
) where
-------------------------------------------------------------------------------
import Control.Lens
... | MichaelXavier/Seraph | src/Seraph/Model.hs | Haskell | bsd-2-clause | 4,483 |
-- 709
import Data.Function(on)
import Data.List(sortBy)
import Euler(splitOn)
parseBaseExp ws = [(a,b,n+1) | n <- [0..length ws-1],
let [a,b] = parseOne $ ws !! n]
where parseOne w = map read $ splitOn ',' w
findLargest ws = snd $ last $ sortBy (compare `on` fst) $
... | higgsd/euler | hs/99.hs | Haskell | bsd-2-clause | 505 |
{-# LANGUAGE RankNTypes #-}
module Insomnia.Interp.PMonad (ProbabilityMonad(..)
, SupportMonad(..)
, ExpMonad(..)
, SamplingMonad(..)
, ContinuousProbabilityMonad(..)
, s... | lambdageek/insomnia | src/Insomnia/Interp/PMonad.hs | Haskell | bsd-3-clause | 5,536 |
module Settings.Flavours.Quickest (quickestFlavour) where
import Expression
import Flavour
import {-# SOURCE #-} Settings.Default
-- Please update doc/flavours.md when changing this file.
quickestFlavour :: Flavour
quickestFlavour = defaultFlavour
{ name = "quickest"
, args = defaultBuilderArgs ... | ezyang/ghc | hadrian/src/Settings/Flavours/Quickest.hs | Haskell | bsd-3-clause | 701 |
{-# LANGUAGE ScopedTypeVariables #-}
module Utils where
import Kerchief.Prelude
import Prelude hiding (foldl, getLine, putStr, putStrLn)
import Control.Exception (SomeException, catch)
import Control.Monad.Trans (MonadIO)
import Data.ByteString (ByteString)
import qualified Data.B... | mitchellwrosen/kerchief | src/Utils.hs | Haskell | bsd-3-clause | 2,909 |
module HQuestions where
import Control.Arrow ((&&&))
import System.Random
import Data.List
import Data.Maybe
import Data.Function (on)
import Control.Monad (replicateM)
h1 :: [a] -> a
h1 = last
h2 :: [a] -> a
h2 = last . init
h3 :: [a] -> Int -> a
h3 xs n = xs !! (n-1)
h4 :: [a] -> Int
h4 = foldr (const (+1)) 0
... | niexshao/Exercises | src/HQuestions.hs | Haskell | bsd-3-clause | 12,574 |
module Example.Lens () where
| smurphy8/refactor-patternmatch-with-lens | src/Example/Lens.hs | Haskell | bsd-3-clause | 30 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PostfixOperators #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
module Ion.Private.Types where
import Data.Char
import Data.List
import... | ku-fpg/thrust-gen | src/Ion/Private/Types.hs | Haskell | bsd-3-clause | 18,582 |
{-# LANGUAGE FlexibleContexts #-}
{-|
Module : $Header$
CopyRight : (c) 8c6794b6, 2011-2013
License : BSD3
Maintainer : 8c6794b6@gmail.com
Stability : experimental
Portability : portable
Synthesis methods
-}
module Spectrofy.Synth
( sinsyn
, fftsyn
) where
import Data.Complex (Complex(..), realPa... | 8c6794b6/spectrofy | Spectrofy/Synth.hs | Haskell | bsd-3-clause | 4,204 |
module Paths_Demotivation (
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... | Michaelt293/Demotivation | .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen/Paths_Demotivation.hs | Haskell | bsd-3-clause | 1,730 |
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE LambdaCase #-}
module Main where
import Hans
import Hans.Device
import Hans.IP4.Dhcp.Client (DhcpLease(..),defaultDhcpConfig,dhcpClient)
import ... | GaloisInc/HaNS | examples/echo-server/Main.hs | Haskell | bsd-3-clause | 2,193 |
module Sound.Player.Widgets (
songWidget,
playbackProgressBar
) where
import Brick.Types (Widget)
import Brick.Widgets.Core ((<+>), str, fill, vLimit, vBox)
import qualified Brick.Widgets.List as L
import qualified Brick.Widgets.ProgressBar as P
import qualified Data.Vector as Vec
import GHC.Float (double2Float)
i... | potomak/haskell-player | src/Sound/Player/Widgets.hs | Haskell | bsd-3-clause | 2,622 |
{-# LANGUAGE NoImplicitPrelude #-}
module Stack.Options.ScriptParser where
import Options.Applicative
import Options.Applicative.Builder.Extra
import Stack.Options.Completion
import Stack.Prelude
data ScriptOpts = ScriptOpts
{ soPackages :: ![String]
, soFile :: !FilePath
... | juhp/stack | src/Stack/Options/ScriptParser.hs | Haskell | bsd-3-clause | 1,773 |
module Statistics.Quantile.Bench.Accuracy where
import qualified Data.Vector as V
import Statistics.Quantile.Types
import Statistics.Quantile.Util
import Statistics.Sample
import System.IO
err :: Double
-> Double
-> Double
err true estimate =
let e = abs (true - estimate)
in e * e
selectorAccuracy ::... | olorin/slides | 2015-08-26-fp-syd-approx-quantiles/approx-quantile/src/Statistics/Quantile/Bench/Accuracy.hs | Haskell | mit | 940 |
module Main where
import Test.Tasty
-- import Test.Tasty.QuickCheck as QC
-- import Test.Tasty.HUnit as HU
-- import Test.Tasty.Golden as TG
import Test.Tasty.Hspec
specs :: Spec
specs = undefined
tests :: TestTree
tests = testGroup "main"
[ testCase "something" specs
]
main = defaultMain tests
| erochest/life-cast | specs/Specs.hs | Haskell | apache-2.0 | 313 |
{-# LANGUAGE CPP, DeriveDataTypeable, TupleSections #-}
{-# OPTIONS -Wall #-}
module Language.Paraiso.Optimization.DeadCodeElimination (
deadCodeElimination
) where
import Control.Applicative
import qualified Data.Graph.Inductive as FGL
import Data.Maybe
import qualified Data.... | nushio3/Paraiso | Language/Paraiso/Optimization/DeadCodeElimination.hs | Haskell | bsd-3-clause | 2,354 |
{-
(c) The University of Glasgow 2006
(c) The AQUA Project, Glasgow University, 1998
\section[TcForeign]{Typechecking \tr{foreign} declarations}
A foreign declaration is used to either give an externally
implemented function a Haskell type (and calling interface) or
give a Haskell function an external calling interfa... | nushio3/ghc | compiler/typecheck/TcForeign.hs | Haskell | bsd-3-clause | 23,241 |
{-# OPTIONS_GHC -Wall #-}
module Reporting.Error.Type where
import qualified Data.Map as Map
import qualified Data.Maybe as Maybe
import Text.PrettyPrint.ANSI.Leijen
( Doc, (<>), (<+>), colon, dullyellow
, fillSep, hang, indent, text, underline, vcat
)
import qualified AST.Type as Type
import qualified AST.Vari... | laszlopandy/elm-compiler | src/Reporting/Error/Type.hs | Haskell | bsd-3-clause | 18,809 |
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- | Filter operators for JSON values added to PostgreSQL 9.4
module Database.Persist.Postgresql.JSON
( (@>.)
, (<@.)
, (?.)
, (?|.)
, (?&.)
, Value()
) where
import Data.Aeson (FromJSON, ToJSON, Value, encode, eitherDecodeStrict)
... | naushadh/persistent | persistent-postgresql/Database/Persist/Postgresql/JSON.hs | Haskell | mit | 12,559 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.