code stringlengths 2 1.05M | repo_name stringlengths 5 101 | path stringlengths 4 991 | language stringclasses 3
values | license stringclasses 5
values | size int64 2 1.05M |
|---|---|---|---|---|---|
{-# LANGUAGE RecursiveDo #-} -- needed for Earley
module AST (Type (..), Expression (..), BindingType (..), Statement (..), Block (..), Argument (..), Function (..), AST, Error (..), parse, RenderName (..)) where
import MyPrelude
import qualified Text.Earley as E
import qualified Pretty as P
import qualified Token ... | glaebhoerl/stageless | src/AST.hs | Haskell | mit | 15,229 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-}
module DBTypes where
import D... | wz1000/haskell-webapps | ServantPersistent/src/DBTypes.hs | Haskell | mit | 4,951 |
{-|
Module : TTN.Model.Translation
Description : Model code for Translation.
Author : Sam van Herwaarden <samvherwaarden@protonmail.com>
-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings ... | samvher/translatethenews | app/TTN/Model/Translation.hs | Haskell | mit | 2,816 |
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-}
module Y2018.M04.D04.Solution where
{--
So you have the data from the last two day's exercises, let's start storing
those data into a PostgreSQL database. Today's exercise is to store just
the authors.
But there's a catch: you have to consider you're doing this as a da... | geophf/1HaskellADay | exercises/HAD/Y2018/M04/D04/Solution.hs | Haskell | mit | 3,329 |
module Tiling.A295229Spec (main, spec) where
import Test.Hspec
import Tiling.A295229 (a295229)
main :: IO ()
main = hspec spec
spec :: Spec
spec = describe "A295229" $
it "correctly computes the first 10 elements" $
take 10 (map a295229 [1..]) `shouldBe` expectedValue where
expectedValue = [1, 6, 84, 8548... | peterokagey/haskellOEIS | test/Tiling/A295229Spec.hs | Haskell | apache-2.0 | 438 |
module Permutations.A330858 (a330858, a330858T) where
import Permutations.A068424 (a068424T)
import Data.MemoCombinators (memo2, integral)
a330858T :: Integer -> Integer -> Integer
a330858T = memo2 integral integral a330858T' where
a330858T' n k
| n == 0 = 1
| n <= k = product [1..n]
| otherwise = ... | peterokagey/haskellOEIS | src/Permutations/A330858.hs | Haskell | apache-2.0 | 591 |
-- logging feature implemented with do syntax
import Control.Monad.Writer
-- be careful: the code does not compile correctly
logNumber :: Int -> Writer [String] Int
logNumber x = Writer (x, ["Got number: " ++ show x])
multWithLog :: Writer [String] Int
multWithLog = do
a <- logNumber 3
b <- logNumber 5
return (a*b... | Oscarzhao/haskell | learnyouahaskell/monads/log_with_do.hs | Haskell | apache-2.0 | 323 |
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-----------------------------------------------------------------
This files provides functions to convert parsed JSON
responses of type Jvalue to other Haskell Types that we use.
All functions in this module are pure. So, all error reporting
is done using (Eit... | dimitri-xyz/mercado-bitcoin | src/Mercado/Internals.hs | Haskell | bsd-3-clause | 20,014 |
module Experiments.MonadT.ErrorIO where
import Control.Monad.Except
import System.Random
getRandomNumber :: IO Int
getRandomNumber = randomRIO (0, 20)
data RandError =
RandError Int
String
deriving (Show)
type ErrorIO a = ExceptT RandError IO a
errIfOdd :: ErrorIO Int
errIfOdd =... | rumblesan/haskell-experiments | src/Experiments/MonadT/ErrorIO.hs | Haskell | bsd-3-clause | 1,440 |
module Exercises109 where
fibs :: Num a => [a]
fibs = 1 : scanl (+) 1 fibs
fibsN :: Num a => Int -> a
fibsN x = fibs !! x
-- 1.
fibs20 = take 20 fibs
-- 2.
fibsUnder100 = takeWhile (< 100) fibs
-- 3.
fact :: (Num a, Enum a) => [a]
fact = scanl (*) 1 [1..]
factN x = fact !! x | pdmurray/haskell-book-ex | src/ch10/Exercises10.9.hs | Haskell | bsd-3-clause | 282 |
{-# LANGUAGE OverloadedStrings #-}
module Security
( tokens
, credential
) where
import Web.Twitter.Conduit
import Web.Authenticate.OAuth
tokens :: OAuth
tokens = twitterOAuth
{ oauthConsumerKey = "YOUR CONSUMER KEY"
, oauthConsumerSecret = "YOUR CONSUMER SECRET"
}
credential :: Cre... | jmct/PubBot | Security.hs | Haskell | bsd-3-clause | 458 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE CPP #-}
-- {-# OPTIONS -ddump-splices #-}
import Language.Haskell.TH.ExpandSyns
import Language.Haskell.TH
import Language.Haskell.TH.Syntax
import Util
import Types
main = do
... | seereason/th-expand-syns | testing/Main.hs | Haskell | bsd-3-clause | 2,189 |
module Spec.Constant where
import Data.Word(Word32, Word64)
data Constant = Constant { cName :: String
, cValueString :: String
, cValue :: ConstantValue
, cComment :: Maybe String
}
deriving (Show)
data ConstantVal... | oldmanmike/vulkan | generate/src/Spec/Constant.hs | Haskell | bsd-3-clause | 693 |
--
-- Copyright (c) 2009-2011, ERICSSON AB
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list... | emwap/feldspar-compiler | lib/Feldspar/Compiler/Imperative/FromCore.hs | Haskell | bsd-3-clause | 50,193 |
module Main where
import System.Exit
import System.Environment
import System.Console.GetOpt
import Control.Monad (forM_, when, unless)
import Control.Monad.Trans
import Control.Applicative ((<$>))
import Tools.Quarry
import Data.Word
import Data.List
import Data.Maybe
import System.IO
import System.Process
data SubC... | vincenthz/quarry | src/Quarry.hs | Haskell | bsd-3-clause | 12,085 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Jana.Types (
Array, Stack,
Value(..), nil, performOperation, performModOperation,
showValueType, typesMatch, truthy,
Store, printVdecl, showStore, emptyStore, storeFromList,
getRef, getVar, getRefValue, bindVar, unbindVar, setVar,
EvalEnv(..),
... | tyoko-dev/jana | src/Jana/Types.hs | Haskell | bsd-3-clause | 6,785 |
{-
%
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
TcGenDeriv: Generating derived instance declarations
This module is nominally ``subordinate'' to @TcDeriv@, which is the
``official'' interface to deriving-related things.
This is where we do all the grimy bindings... | vTurbine/ghc | compiler/typecheck/TcGenDeriv.hs | Haskell | bsd-3-clause | 119,963 |
-- #hide
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.UI.GLUT.QueryUtils
-- Copyright : (c) Sven Panne 2003
-- License : BSD-style (see the file libraries/GLUT/LICENSE)
--
-- Maintainer : sven_panne@yahoo.com
-- Stability : provisional
--... | OS2World/DEV-UTIL-HUGS | libraries/Graphics/UI/GLUT/QueryUtils.hs | Haskell | bsd-3-clause | 1,360 |
-----------------------------------------------------------------------------
-- |
-- Module : Data.Metrology.Parser
-- Copyright : (C) 2014 Richard Eisenberg
-- License : BSD-style (see LICENSE)
-- Maintainer : Richard Eisenberg (rae@cs.brynmawr.edu)
-- Stability : experimental
-- Portability : non... | goldfirere/units | units/Data/Metrology/Parser.hs | Haskell | bsd-3-clause | 8,556 |
{-# LANGUAGE PackageImports #-}
import Control.Applicative
import "monads-tf" Control.Monad.Trans
import Control.Concurrent (threadDelay)
import Control.Concurrent.STM
import Control.Exception
import Data.Maybe
import Data.Pipe
import System.IO
import Network
import Data.Char
main :: IO ()
main = do
h <- connectTo ... | YoshikuniJujo/xmpipe | test/s2s_model_io/s2s_cl.hs | Haskell | bsd-3-clause | 1,281 |
{-# LANGUAGE DeriveDataTypeable #-}
-----------------------------------------------------------------------------
-- Some code in this file was originally from wai-1.3.0.3, made
-- available under the following terms (MIT):
--
-- Copyright (c) 2012 Michael Snoyman, http://www.yesodweb.com/
--
-- Permission is hereby g... | k0001/seldom | src/Seldom/Internal/Request.hs | Haskell | bsd-3-clause | 3,068 |
{-# LANGUAGE TupleSections #-}
module Matterhorn.FilePaths
( historyFilePath
, historyFileName
, lastRunStateFilePath
, lastRunStateFileName
, configFileName
, xdgName
, locateConfig
, xdgSyntaxDir
, syntaxDirName
, userEmojiJsonPath
, bundledEmojiJsonPath
, emojiJsonFilename
, Script(..)
... | matterhorn-chat/matterhorn | src/Matterhorn/FilePaths.hs | Haskell | bsd-3-clause | 5,779 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
module TrieMap(
... | vikraman/ghc | compiler/coreSyn/TrieMap.hs | Haskell | bsd-3-clause | 41,908 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ViewPatterns #-}
-- | Main stack tool entry point.
module Main (main) where
... | rubik/stack | src/main/Main.hs | Haskell | bsd-3-clause | 49,174 |
{-# LANGUAGE TemplateHaskell #-}
module Lopc.Enums where
import Database.Persist.TH
data LopcClassification = MajorLopc
| MinorLopc
| OtherLopc deriving (Show, Read, Eq, Ord)
derivePersistField "LopcClassification"
| hectorhon/autotrace2 | app/Lopc/Enums.hs | Haskell | bsd-3-clause | 266 |
--
-- GPIOF4.hs --- GPIO peripheral for F4 series & compatible
--
-- Copyright (C) 2014, Galois, Inc.
-- All Rights Reserved.
--
module Ivory.BSP.STM32.Peripheral.GPIOF4
( module Ivory.BSP.STM32.Peripheral.GPIOF4.Peripheral
, module Ivory.BSP.STM32.Peripheral.GPIOF4.Regs
, module Ivory.BSP.STM32.Peripheral.GPIOF... | GaloisInc/ivory-tower-stm32 | ivory-bsp-stm32/src/Ivory/BSP/STM32/Peripheral/GPIOF4.hs | Haskell | bsd-3-clause | 491 |
-- -*- mode: haskell; -*-
--
-- generate anagrams based on dictionary and repeated user input
--
import Data.Char (toLower)
import Data.List (sort)
import System.Environment (getArgs)
import System.IO (stdout, hFlush)
import qualified Data.Map as M (Map, empty, lookup, alter)
-- map of canonical representation to all... | wiggly/workshop | app/Anagram.hs | Haskell | bsd-3-clause | 1,810 |
-- | Internal module containing the store definitions.
{-# LANGUAGE AllowAmbiguousTypes, OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
module React.Flux.Store (
ReactStoreRef(..)
, StoreData(..)
-- * Old Stores
, SomeStoreAction(..)
, executeAction
-- * New Stores
, NewReac... | liqula/react-flux | src/React/Flux/Store.hs | Haskell | bsd-3-clause | 10,832 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
module HMenu.Command (
Command(..),
execute,
commandLine
) where
import ClassyPrelude
import Control.DeepSeq
import Data.Binary
import GHC.Generics (Generic)
import System.Direct... | Adirelle/hmenu | src/HMenu/Command.hs | Haskell | bsd-3-clause | 2,397 |
{-# LANGUAGE DeriveDataTypeable #-}
module Main
(
main
) where
import System.IO
import Data.List (sort)
import qualified Data.ByteString.Lazy.Char8 as C
import System.Console.CmdArgs
import System.Directory (doesFileExist)
data Options = Options
{
noSort :: Bool,
file :: FilePath
} d... | nanonaren/getlines | src/Main.hs | Haskell | bsd-3-clause | 1,416 |
module Text.HTML.Truncate(truncateHtml,truncateHtml',truncateStringLike) where
import qualified Text.HTML.TagSoup as TS
import qualified Text.StringLike as SL
import Data.Char(isSpace)
import Data.List(dropWhileEnd)
{-
Roughly, the algorithm works like this:
1. Parse the HTML to a list of tags
2. Walk through those ... | mruegenberg/html-truncate | Text/HTML/Truncate.hs | Haskell | bsd-3-clause | 3,618 |
{-# LANGUAGE OverloadedStrings #-}
module Hrpg.Game.Resources.Zones.UpperCape
( upperCape
) where
import Hrpg.Game.Resources.Mobs.SpawnTables (commonSpawns)
import Hrpg.Framework.Zones.Zone
upperCape = Zone (ZoneId 1000) "Upper Cape" "Woods on the bay" [] commonSpawns
| cwmunn/hrpg | src/Hrpg/Game/Resources/Zones/UpperCape.hs | Haskell | bsd-3-clause | 285 |
-- This file contains utility functions not provided by the Haskell
-- standard library. Most mirror functions in Harrison's lib.ml
-- * Signature
module Util.Lib
( time
, timeIO
, pow
, funpow
, decreasing
-- Strings
, substringIndex
-- Map
, (↦)
, (⟾)
)
where
-- * Imports
import Prelu... | etu-fkti5301-bgu/alt-exam_automated_theorem_proving | src/Util/Lib.hs | Haskell | bsd-3-clause | 1,698 |
module TypeDiff (
typeDiff
-- exported for testing
, sigMap
, typeEq
, alphaNormalize
, normalizeConstrainNames
) where
import Data.Char
import Data.Maybe
import Data.List
import Data.Map as Map (Map)
import qualified Data.Map as Map
import Language.Haskell.Exts.Syn... | beni55/base-compat | typediff/src/TypeDiff.hs | Haskell | mit | 3,765 |
{-|
Module : Util.DynamicLinker
Description : Platform-specific dynamic linking support. Add new platforms to this file through conditional compilation.
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE ExistentialQuantification, CPP, ScopedTypeVariables #-}
module Util.DynamicLin... | ozgurakgun/Idris-dev | src/Util/DynamicLinker.hs | Haskell | bsd-3-clause | 7,268 |
-- Copyright (c) 2015 Eric McCorkle. All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions
-- are met:
--
-- 1. Redistributions of source code must retain the above copyright
-- notice, this list of conditi... | emc2/saltlang | test/library/Tests/Language/Salt/Surface.hs | Haskell | bsd-3-clause | 1,684 |
module Turbinado.Environment.Files(
getFile,
getFile_u,
getFileContent,
getFileDecode
) where
import qualified Data.ByteString as BS
import qualified Data.Map as M
import Data.Maybe
import Network.HTTP
import Network.HTTP.Headers
import Network.URI
import Codec.MIME.Type
import Codec.MIME.Decode
import Turb... | alsonkemp/turbinado-website | Turbinado/Environment/Files.hs | Haskell | bsd-3-clause | 1,530 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TypeSynonymInstances #-}
-- | The internal FFI module.
module Fay.FFI
(Fay
,Nullable (..)
,Defined (..)
,Ptr
,Automatic
,ffi)
where
import Data.String (IsString)
import Fay.Types
import Prelude (error)
-- | Values tha... | beni55/fay | src/Fay/FFI.hs | Haskell | bsd-3-clause | 1,284 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Stack.Upgrade (upgrade) where
import Control.Monad.Catch
import Control.Monad.IO.Class
import Control.Monad.Logger
import ... | GaloisInc/stack | src/Stack/Upgrade.hs | Haskell | bsd-3-clause | 3,964 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, MagicHash #-}
{-# OPTIONS_HADDOCK hide #-}
module GHC.List (
mylen
) where
import GHC.Base hiding (assert)
{-# INLINE mfoldr #-}
mfoldr :: (a -> b -> b) -> b -> [a] -> b
mfoldr k z = go
where go [] = z
go (y:ys) = y `k` go ys
{-@ assert mylen :: x... | mightymoose/liquidhaskell | benchmarks/ghc-7.4.1/List-mini.hs | Haskell | bsd-3-clause | 567 |
<?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>SOAP Support Add-on</title>
<maps>
<homeID>soap</homeID>
<mapref locatio... | kingthorin/zap-extensions | addOns/soap/src/main/javahelp/org/zaproxy/zap/extension/soap/resources/help_ko_KR/helpset_ko_KR.hs | Haskell | apache-2.0 | 965 |
module Test1 where
f = e2 where e2 = 1 - 2
| kmate/HaRe | old/testing/refacSlicing/Test1AST.hs | Haskell | bsd-3-clause | 44 |
{-
(c) The AQUA Project, Glasgow University, 1993-1998
\section[Simplify]{The main module of the simplifier}
-}
{-# LANGUAGE CPP #-}
module Simplify ( simplTopBinds, simplExpr, simplRules ) where
#include "HsVersions.h"
import DynFlags
import SimplMonad
import Type hiding ( substTy, extendTvSubst, substTyVar ... | acowley/ghc | compiler/simplCore/Simplify.hs | Haskell | bsd-3-clause | 123,147 |
{-# LANGUAGE TemplateHaskell, TypeFamilies, PolyKinds #-}
module T8884 where
import Language.Haskell.TH
import System.IO
type family Foo a = r | r -> a where
Foo x = x
type family Baz (a :: k) = (r :: k) | r -> a
type instance Baz x = x
$( do FamilyI foo@(ClosedTypeFamilyD _ tvbs1 res1 m_kind1 eqns1)
... | ghc-android/ghc | testsuite/tests/th/T8884.hs | Haskell | bsd-3-clause | 784 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Controllers.Sessions where
import Lucid
import Lucid.Html5
import Control.Monad
import Data.HVect
import Web.Spock.Safe
impo... | folsen/haskell-startapp | src/Controllers/Sessions.hs | Haskell | mit | 1,070 |
module Demos
( mainDemo
) where
import Draw
import Centres
import Shape
import Constructions
--------------------------------------------------------------------------------
type Demo = Triangle -> IO ()
mainDemo :: Demo
mainDemo = demoNapoleonTriangle True
-----------------------------------------... | clauderichard/Euclaude | Demos.hs | Haskell | mit | 3,906 |
--------------------------------------------------------------------------------
-- |
-- Module : Control.Workflow
-- Copyright : (c) 2015-2019 Kai Zhang
-- License : MIT
-- Maintainer : kai@kzhang.org
-- Stability : experimental
-- Portability : portable
--
-- DSL for building computational workflo... | kaizhang/SciFlow | SciFlow/src/Control/Workflow.hs | Haskell | mit | 3,631 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ViewPatterns #-}
-- | This module provides abstractions for parallel job processing.
module Control.TimeWarp.Manager.Job
( -- * Job data types
InterruptType (..)
... | serokell/time-warp | src/Control/TimeWarp/Manager/Job.hs | Haskell | mit | 7,469 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.SVGPathSegArcAbs
(js_setX, setX, js_getX, getX, js_setY, setY, js_getY, getY,
js_setR1, setR1, js_getR1, getR1, js_setR2, setR2, js_getR2, getR2,
js_setAngle, setAngle, js_getAngle, getAngle... | manyoo/ghcjs-dom | ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/SVGPathSegArcAbs.hs | Haskell | mit | 6,051 |
{-# OPTIONS_HADDOCK show-extensions #-}
{-# LANGUAGE FlexibleContexts #-}
-- |
--
-- Module : EventProbability.NaiveBayes.Weka
-- Description : NaiveBayes for Weka data.
-- License : MIT
--
-- NaiveBayes learing and classification for Weka data.
--
module EventProbability.NaiveBayes.Weka (
-- * Prepare... | fehu/min-dat--naive-bayes | src/EventProbability/NaiveBayes/Weka.hs | Haskell | mit | 6,125 |
{-# LANGUAGE DeriveGeneric #-}
module U.Codebase.Kind where
import U.Util.Hashable (Hashable)
import qualified U.Util.Hashable as Hashable
import GHC.Generics (Generic)
data Kind = Star | Arrow Kind Kind deriving (Eq,Ord,Read,Show,Generic)
instance Hashable Kind where
tokens k = case k of
Star -> [Hashable.Ta... | unisonweb/platform | codebase2/codebase/U/Codebase/Kind.hs | Haskell | mit | 404 |
-- Disguised sequences (II)
-- https://www.codewars.com/kata/56fe17fcc25bf3e19a000292
module Codewars.G964.Disguised2 where
u1 :: Integer -> Integer -> Integer
u1 n p = p * succ n
v1 :: Integer -> Integer -> Integer
v1 n p = p * succ (2 * n)
uEff :: Integer -> Integer -> Integer
uEff = u1
vEff :: Integer -> Intege... | gafiatulin/codewars | src/6 kyu/Disguised2.hs | Haskell | mit | 343 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DeriveGeneric #-}
module Network.OnDemandSSHTunnel (
SSHTunnel(..),
Config(..),
prettyConfig,
setupConfiguration,
setupOnDemandTunnel
) where
import System.Process
import Control.Monad
import Control.Concurrent
import Control.Exception
import quali... | crackleware/on-demand-ssh-tunnel | src/Network/OnDemandSSHTunnel.hs | Haskell | mit | 3,125 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-redshift-cluster-loggingproperties.html
module Stratosphere.ResourceProperties.RedshiftClusterLoggingProperti... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/RedshiftClusterLoggingProperties.hs | Haskell | mit | 2,221 |
{-# LANGUAGE OverloadedStrings #-}
module Network.API.Mandrill.Messages where
import Network.API.Mandrill.Utils
import Network.API.Mandrill.Response
import Network.API.Mandrill.Types
-- | Send a new transactional message through Mandrill
send :: (MonadIO m) =>
Message ->
MessageConfig ->
... | krgn/hamdrill | src/Network/API/Mandrill/Messages.hs | Haskell | mit | 4,831 |
-- Making our own types and typeclasses
module Shapes
( Point(..)
, Shape(..)
, surface
, nudge
, baseCircle
, baseRect
) where
data Point = Point Float Float
deriving (Show)
data Shape = Circle Point Float
| Rectangle Point Point
deriving (Show)
surface :: Shape -> Float
surface (Circle _ r) = pi * r ^ 2... | autocorr/lyah | chap8.hs | Haskell | mit | 1,237 |
-- -------------------------------------------------------------------------------------
-- Author: Sourabh S Joshi (cbrghostrider); Copyright - All rights reserved.
-- For email, run on linux (perl v5.8.5):
-- perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0... | cbrghostrider/Hacking | HackerRank/Algorithms/Greedy/minimax.hs | Haskell | mit | 1,287 |
module Compiling where
import Control.Monad.Writer
import System.Process
import System.Exit
import Text.Printf
import Data.List.Split
data GC = JGC | Stub
data TDir = NoTDir | TDirAt FilePath
data CompilerFlags = CF
{ tdir :: TDir
, entryPoint :: Maybe Strin... | m-alvarez/scher-run | Compiling.hs | Haskell | mit | 4,836 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE NamedFieldPuns #-}
-- A simple structure for a pool of resources.
-- Each managed resource has an integer index that identifies the 'slot' for the given resource;
-- when the resource is idle, this slot holds a N... | lynnard/reflex-cocos2d | src/Data/Pool.hs | Haskell | mit | 3,086 |
module Filter.Hyperref (hyperref) where
import Text.Pandoc.Definition
import Text.Pandoc.Walk (walk)
tex :: String -> Inline
tex = RawInline (Format "tex")
f :: Inline -> Inline
f x@(Link attr is (('#':id), title)) = Span nullAttr $
[ tex $ "\\hyperref[" ++ id ++ "]{" ] ++ is ++ [ tex "}" ]
f x = x
hyperref :: Pa... | Thhethssmuz/ppp | src/Filter/Hyperref.hs | Haskell | mit | 353 |
#!/usr/bin/env runhaskell
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE UnicodeSyntax #-}
{-# LANGUAGE ViewPatterns #-}
import Data.Foldable (foldMap)
import Data.Maybe (fromMaybe)
import Data.Monoid
import Control.Lens
import qualified Data.Aeson.Len... | supki/libstackexchange | examples/badges-watcher.hs | Haskell | mit | 870 |
--
--
--
------------------
-- Exercise 12.41.
------------------
--
--
--
module E'12'41 where
| pascal-knodel/haskell-craft | _/links/E'12'41.hs | Haskell | mit | 106 |
module DDF.Meta.Dual where
newtype Dual l r = Dual {runDual :: (l, r)}
instance Eq l => Eq (Dual l r) where
(Dual (l, _)) == (Dual (r, _)) = l == r
instance Ord l => Ord (Dual l r) where
(Dual (l, _)) `compare` (Dual (r, _)) = l `compare` r
dualOrig (Dual (l, _)) = l
dualDiff (Dual (_, r)) = r
mkDual l r = Du... | ThoughtWorksInc/DeepDarkFantasy | DDF/Meta/Dual.hs | Haskell | apache-2.0 | 329 |
<?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="en-GB">
<title>Context Alert Filters | ZAP Extension</title>
<maps>
<homeID>top<... | 0xkasun/security-tools | src/org/zaproxy/zap/extension/alertFilters/resources/help/helpset.hs | Haskell | apache-2.0 | 995 |
{-# LANGUAGE CPP, OverloadedStrings, PackageImports, ScopedTypeVariables #-}
-- | In which Hawk's command-line arguments are structured into a `HawkSpec`.
module System.Console.Hawk.Args.Parse (parseArgs) where
import Prelude hiding (fail)
#if MIN_VERSION_base(4,12,0)
import Control.Monad.Fail (fail)
#else
import Pre... | gelisam/hawk | src/System/Console/Hawk/Args/Parse.hs | Haskell | apache-2.0 | 8,499 |
module Main where
primes = filter prime [2..]
where
prime x = null [d | d <- [2..x-1], rem x d == 0]
primes' = filterPrimes [2..]
where
filterPrimes (p:xs) = p : filterPrimes [x | x <- xs, rem x p /= 0] | frankiesardo/seven-languages-in-seven-weeks | src/main/haskell/day2/primes.hs | Haskell | apache-2.0 | 253 |
module Main where
import qualified Language.P4 as P4
import CodeGen
import Options.Applicative
parseAndFixup :: FilePath -> String -> Either String P4.Program
parseAndFixup fileName input = do
ast <- P4.parseProgram fileName input
P4.fixupSEMAs ast
astDump :: FilePath -> IO ()
astDump file = do
contents <- r... | brooksbp/P4 | src/compiler/Main.hs | Haskell | apache-2.0 | 1,243 |
module Notification where
import DBus.Notify
import DBus.Client (connectSession)
giveYourEeysABreak :: IO ()
giveYourEeysABreak = do
client <- connectSession
do
let startNote = appNote { summary="Mike Says"
, body=(Just $ Text "Give your eyes a break") }
notification <- notify ... | akalyaev/mike-on-linux | src/Notification.hs | Haskell | apache-2.0 | 408 |
{-# LANGUAGE TemplateHaskell, OverloadedStrings, TupleSections #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Data.QcIntegrated where
import Data.Integrated hiding (tests)
import Test.QuickCheck
import Test.QuickCheck.All
import Test.QuickCheck.Monadic
import Test.QuickCheck.Property.Comb
import qualified Data.Prop... | jfeltz/tasty-integrate | tests/Data/QcIntegrated.hs | Haskell | bsd-2-clause | 16,375 |
{-# LANGUAGE OverloadedStrings, GADTs #-}
module View.Class where
import Control.Applicative
import Data.Monoid
import Data.String
import Model.Class
import Model.Home
import Model.Page
import Web.Thermopolis.Clause
import Types
impor... | andygill/thermopolis | src/View/Class.hs | Haskell | bsd-2-clause | 572 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QGL.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:36
Warning : this file is machine generated - do not modif... | uduki/hsQt | Qtc/Enums/Opengl/QGL.hs | Haskell | bsd-2-clause | 7,292 |
{-#LANGUAGE DeriveGeneric #-}
{-|
Module : Name
Description : Yaml parsing
Copyright :
License : GPL-2
Maintainer : theNerd247
Stability : experimental
Portability : POSIX
-}
module Data.Serialization.Yaml
(
readYamlFile
,writeYamlFile
)
where
import YabCommon
import Data.Budget
import Data.Serial... | theNerd247/yab | src/Data/Serialization/Yaml.hs | Haskell | bsd-3-clause | 1,674 |
{-#LANGUAGE RankNTypes, CPP, Trustworthy #-}
module Streaming
(
-- * An iterable streaming monad transformer
-- $stream
Stream,
-- * Constructing a 'Stream' on a given functor
yields,
effect,
wrap,
replicates,
repeats,
repeatsM,
unfold,
never,
untilJust,
streamBuild,
dela... | michaelt/streaming | src/Streaming.hs | Haskell | bsd-3-clause | 4,789 |
import Control.Applicative
boop = (*2)
doop = (+10)
-- function composition
bip :: Integer -> Integer
bip = boop . doop
-- context is Functor
bloop :: Integer -> Integer
bloop = fmap boop doop
-- context is Applicative
bbop :: Integer -> Integer
bbop = (+) <$> boop <*> doop
duwop :: Integer -> Integer
duwop = lift... | chengzh2008/hpffp | src/ch22-Reader/start.hs | Haskell | bsd-3-clause | 444 |
{-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleContexts, MultiParamTypeClasses, FlexibleInstances #-}
module Language.Mojito.Syntax.Types where
import Prelude hiding ((<>))
import Data.List (intersperse)
import Text.PrettyPrint.HughesPJClass
-- Simple Types
-- t = C t1 .. tn | a t1 .. tn
data Simple =
TyCon St... | noteed/mojito | Language/Mojito/Syntax/Types.hs | Haskell | bsd-3-clause | 3,139 |
{-# LANGUAGE OverloadedStrings #-}
module RegexPattern where
import Data.Text
import Types
-- ideally use regular expressions to create an item
-- input: priority:description:MM/DD/YYYY
regexPattern :: String
regexPattern = "[0-9]+(:)[A-Za-z0-9 .!\"#$%()]+(:)[0-9]{1,2}/[0-9]{1,2}/[0-9]{2,4}"
-- Used to read Items ... | frankhucek/Todo | app/RegexPattern.hs | Haskell | bsd-3-clause | 790 |
module Data.Params.ModInt
where
import Data.Params
-------------------------------------------------------------------------------
-- general
data family ModIntegral (modulus :: Param Nat) i
type ModInt modulus = ModIntegral modulus Int
type ModInteger modulus = ModIntegral modulus Integer
----------------... | mikeizbicki/typeparams | src/Data/Params/ModInt.hs | Haskell | bsd-3-clause | 2,196 |
{-# LANGUAGE RecordWildCards #-}
module Network.RMV.Post
(sendRequest) where
import Network.RMV.Types
import Network.RMV.Output
import Data.Char
import Data.List
import Data.Maybe
import Network.Browser
import Network.HTTP
import Network.URI
import System.Time
rmvURI = URI { uriScheme = "http:"
, ur... | dschoepe/rmv-query | Network/RMV/Post.hs | Haskell | bsd-3-clause | 3,094 |
module Part1.Problem3 where
--
-- The prime factors of 13195 are 5, 7, 13 and 29.
--
-- What is the largest prime factor of the number 600851475143 ?
-- https://stackoverflow.com/a/27464965/248948
squareRoot :: Integral t => t -> t
squareRoot n
| n > 0 = babylon n
| n == 0 = 0
| n < 0 = error "Negati... | c0deaddict/project-euler | src/Part1/Problem3.hs | Haskell | bsd-3-clause | 2,277 |
{-#LANGUAGE ScopedTypeVariables, TypeOperators, FlexibleContexts #-}
module Main where
import Bindings.DC1394.Camera
import Bindings.DC1394.Types
import Canny
import System.Environment
import qualified Data.Array.Accelerate as A
import Data.Array.Accelerate hiding (fromIntegral,fst,(++))
import qualified Data.Array.A... | robstewart57/firewire-image-io | examples/accelerate.hs | Haskell | bsd-3-clause | 2,075 |
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
module TestCodecovHaskellUtil where
import Test.HUnit
import Trace.Hpc.Codecov.Util
testMapFirst = "mapFirst" ~: [
mapFirst (+ 1) [] @?= [],
mapFirst (+ 1) [2] @?= [3],
mapFirst (+ 1) [2, 3] @?= [3, 3],
mapFi... | guillaume-nargeot/codecov-haskell | test/TestCodecovHaskellUtil.hs | Haskell | bsd-3-clause | 3,108 |
module View.Talk where
import Data.Aeson.Text (encodeToLazyText)
import qualified Data.Text.Lazy as LT
import Database.Persist
import Lucid
import Lucid.Base (makeAttribute)
import Models.Talk (getTalkBySlug)
import RIO
import Types
im... | rnons/ted2srt | backend/src/View/Talk.hs | Haskell | bsd-3-clause | 1,496 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Test.Mismi.Amazonka (
sendMultipart
, withMultipart
, newMultipart
) where
import Control.Monad.Catch
import Control.Monad.Reader (ask)
import Control.Monad.Trans.Resource
import Data.Text as... | ambiata/mismi | mismi-s3/test/Test/Mismi/Amazonka.hs | Haskell | bsd-3-clause | 1,315 |
{-
TestVersion.hs (adapted from test_version.c in freealut)
Copyright (c) Sven Panne 2005 <sven.panne@aedion.de>
This file is part of the ALUT package & distributed under a BSD-style license
See the file libraries/ALUT/LICENSE
-}
import Control.Monad ( unless )
import Sound.ALUT
import System.Exit ( exitFa... | FranklinChen/hugs98-plus-Sep2006 | packages/ALUT/examples/TestSuite/TestVersion.hs | Haskell | bsd-3-clause | 870 |
-- 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. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
{-# LANGUAGE GADT... | rfranek/duckling | Duckling/Numeral/ZH/Rules.hs | Haskell | bsd-3-clause | 5,188 |
{-# LANGUAGE NamedFieldPuns #-}
module RFB.CommandLoop (commandLoop) where
import System.IO
import qualified Data.ByteString.Lazy as BS
import Data.Char
import Data.Binary.Get
import Data.Binary.Put
import Data.Word
import qualified RFB.ClientToServer as RFBClient
import qualified RFB.Encoding as Encoding
import qua... | ckkashyap/Chitra | RFB/CommandLoop.hs | Haskell | bsd-3-clause | 4,219 |
{-# LANGUAGE TypeFamilies, ViewPatterns #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE OverloadedStrings #-}
-----------------------------------------------------------------------------
-- |
-- Module : Program.View.WiredGeometryView
-- Copyright : (c) Artem Chirkin
-- License : MIT
--
-- Maintai... | achirkin/ghcjs-modeler | src/Program/View/WiredGeometryView.hs | Haskell | bsd-3-clause | 3,078 |
module PL0.SymbolTable (
SymEntry(..)
, SymbolTable
, emptySymbolTable
) where
import PL0.Internal
| LightAndLight/pl0-haskell | src/PL0/SymbolTable.hs | Haskell | bsd-3-clause | 116 |
{-# LANGUAGE TemplateHaskell #-}
module Game.ClientRespawnT where
import Control.Lens (makeLenses)
import Linear (V3(..))
import Game.ClientPersistantT
import Types
makeLenses ''ClientRespawnT
newClientRespawnT :: ClientRespawnT
newClientRespawnT = ClientRespawnT
{ ... | ksaveljev/hake-2 | src/Game/ClientRespawnT.hs | Haskell | bsd-3-clause | 475 |
-- For everything
{-# LANGUAGE GADTs #-}
-- For type level flags, lists, strings
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
-- For Vinyl and universe polymorphism
{-# LANGUAGE PolyKinds #-}
-- For type-level lists
{-# LANGUAGE TypeOperators #-}
-- For unpacking existentials
{-# LANGUAGE RankNTypes... | plow-technologies/template-service | master/src/Data/Master/Template.hs | Haskell | bsd-3-clause | 15,771 |
{-# LINE 1 "Data.Either.hs" #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE PolyKinds, DataKinds, TypeFamilies, TypeOperators, UndecidableInstances #-}
-----------------------------------------------------------------------------
-- |
-- Module ... | phischu/fragnix | builtins/base/Data.Either.hs | Haskell | bsd-3-clause | 8,051 |
{-# LANGUAGE QuasiQuotes #-}
import LiquidHaskell
{-@ LIQUID "--no-termination "@-}
import Language.Haskell.Liquid.Prelude
mmax x y
| x < y = y
| otherwise = x
for lo hi acc f
| lo < hi = for (lo + 1) hi (f lo acc) f
| otherwise = acc
sumRange i j = for i j 0 (+)
prop = liquidAssertB (m >= 0)
... | spinda/liquidhaskell | tests/gsoc15/unknown/pos/forloop.hs | Haskell | bsd-3-clause | 471 |
{-# LANGUAGE DataKinds #-}
module Ivory.Tower.Monitor
( handler
, state
, stateInit
, monitorModuleDef
, Handler()
, Monitor()
) where
import Ivory.Tower.Types.Unique
import Ivory.Tower.Monad.Handler
import Ivory.Tower.Monad.Monitor
import Ivory.Tower.Monad.Base
import Ivory.Language
state :: (IvoryAr... | GaloisInc/tower | tower/src/Ivory/Tower/Monitor.hs | Haskell | bsd-3-clause | 782 |
{-# language CPP #-}
-- | = Name
--
-- VK_EXT_sample_locations - device extension
--
-- == VK_EXT_sample_locations
--
-- [__Name String__]
-- @VK_EXT_sample_locations@
--
-- [__Extension Type__]
-- Device extension
--
-- [__Registered Extension Number__]
-- 144
--
-- [__Revision__]
-- 1
--
-- [__Extensi... | expipiplus1/vulkan | src/Vulkan/Extensions/VK_EXT_sample_locations.hs | Haskell | bsd-3-clause | 52,025 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
module Main where
import Lib
import Resources
import Authentication
import Control.Applicative (Applicative)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.Logger (runNoLoggingT, runStdoutLoggingT)
import Control.Monad.Reader (... | clample/lift-tracker | app/Main.hs | Haskell | bsd-3-clause | 4,681 |
{-# LANGUAGE TypeOperators, ScopedTypeVariables #-}
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, TypeSynonymInstances #-}
{-# LANGUAGE UndecidableInstances, OverlappingInstances #-}
{-# LANGUAGE FlexibleInstances, FlexibleContexts #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ViewPatterns #-}
{-# LAN... | pepeiborra/narradar | src/Narradar/Types/DPIdentifiers.hs | Haskell | bsd-3-clause | 3,373 |
module Lambda.Evaluator.Debug where
import DeepControl.Applicative
import DeepControl.Monad
import DeepControl.MonadTrans
import Lambda.Evaluator.Eval
import Lambda.Compiler
import Lambda.Parser (readSExpr)
import Lambda.Action
import Lambda.Convertor
import Lambda.Debug
import Lambda.DataType
import Lambda.DataTyp... | ocean0yohsuke/Simply-Typed-Lambda | src/Lambda/Evaluator/Debug.hs | Haskell | bsd-3-clause | 4,535 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE FunctionalDependencies #-}
-- data declarations that are empty
{-# LANGUAGE EmptyDataDecls #-}
module Symengine.Internal
(
cIntToEnum,
cIntFromEnum,
mkForeignPtr,
Wrapped(..),
with2,
with3,
with4,
CBasicSym,
... | bollu/symengine.hs-1 | src/Symengine/Internal.hs | Haskell | mit | 2,666 |
-- HACKERRANK: String-o-Permute
-- https://www.hackerrank.com/challenges/string-o-permute
module Main where
import qualified Control.Monad as M
solve :: String -> String
solve [] = []
solve (x1:x2:xs) = x2:x1:(solve xs)
main :: IO ()
main = getLine >>= \tStr -> M.replicateM_ ((read::String->Int) tStr) (getLine >>... | everyevery/programming_study | hackerrank/functional/string-o-permute/string-o-permute.hs | Haskell | mit | 348 |
-------------------------------------------------------------------------
--
-- Haskell: The Craft of Functional Programming, 3e
-- Simon Thompson
-- (c) Addison-Wesley, 1996-2011.
--
-- Chapter 1
--
-- The Pictures example code is given in the file Pitures.hs.
-- This file can be used by importing it; more de... | Numberartificial/workflow | snipets/src/craft/Chapter1.hs | Haskell | mit | 1,751 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.