code stringlengths 5 1.03M | repo_name stringlengths 5 90 | path stringlengths 4 158 | license stringclasses 15
values | size int64 5 1.03M | n_ast_errors int64 0 53.9k | ast_max_depth int64 2 4.17k | n_whitespaces int64 0 365k | n_ast_nodes int64 3 317k | n_ast_terminals int64 1 171k | n_ast_nonterminals int64 1 146k | loc int64 -1 37.3k | cycloplexity int64 -1 1.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
module Main where
import Gittins.Main (gittinsMain)
main :: IO ()
main = gittinsMain
| bmjames/gittins | gittins/Main.hs | bsd-3-clause | 87 | 0 | 6 | 15 | 29 | 17 | 12 | 4 | 1 |
module List (listModules) where
import Control.Applicative
import Data.List
import GHC
import Packages
import Types
import UniqFM
----------------------------------------------------------------
listModules :: Options -> IO String
listModules opt = convert opt . nub . sort <$> list opt
list :: Options -> IO [String... | conal/ghc-mod | List.hs | bsd-3-clause | 568 | 0 | 11 | 128 | 139 | 72 | 67 | 16 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE PatternGuards #-}
module Daemon
( startServer
, sendCommand
, withUnixS
, forkUnixS
, closeUnixSocket
, bindUnixSocket
, Server
, ControlMessage(..)
) where
import Control.... | bennofs/ghc-server | src/Daemon.hs | bsd-3-clause | 9,030 | 0 | 28 | 2,288 | 2,140 | 1,071 | 1,069 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Database.Tempodb.Methods.Read
( readOne
, readMulti
)
where
import Control.Monad.Reader
import Data.Aeson as A
import Data.ByteString.Char8 as C8
import Data.ByteString.Lazy (fromStrict)
import Data.Monoid
impor... | ixmatus/hs-tempodb | src/Database/Tempodb/Methods/Read.hs | bsd-3-clause | 1,436 | 0 | 13 | 436 | 453 | 234 | 219 | 39 | 3 |
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.Internals
-- Copyright : (c) The University of Glasgow, 1992-2002
-- License : see libraries/base/LICENSE
--
-- Maintainer : cvs-ghc@haskell.org
-- Stability : internal
-- Portability : non-... | OS2World/DEV-UTIL-HUGS | libraries/System/Posix/Internals.hs | bsd-3-clause | 12,598 | 36 | 18 | 3,281 | 2,616 | 1,382 | 1,234 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module PipeAlgorithms where
--import Math.Probable
--import qualified Data.Sequence as S
--import Data.Random
--import Data.Random.Distribution.Uniform
--
--import Control.Monad
--
--import Pipes.Safe
--import Pipes
--
--import PipeOperators
--import Selection
--import Channels
--im... | nsmryan/Misc | src/PipeAlgorithms.hs | bsd-3-clause | 3,574 | 0 | 2 | 811 | 85 | 84 | 1 | 2 | 0 |
{-# LANGUAGE OverloadedStrings #-}
module Web.Yelp
( -- * @YelpT@ monad transformer
YelpT
, runYelpT
-- * Authentication
, Credentials(..)
-- * Yelp's Search API
-- ** Request
, simpleSearch
, search
, LocationQuery(..)
, BoundingBox(..)
, SearchCoordinates(..... | mcschroeder/yelp | Web/Yelp.hs | bsd-3-clause | 1,046 | 0 | 5 | 319 | 232 | 166 | 66 | 38 | 0 |
{-# OPTIONS_HADDOCK hide #-}
{-# LANGUAGE ExistentialQuantification #-}
module Network.TLS.Crypto
( HashContext
, HashCtx
, hashInit
, hashUpdate
, hashUpdateSSL
, hashFinal
, module Network.TLS.Crypto.DH
, module Network.TLS.Crypto.IES
, module Network.TLS.Crypto.Types
-- * Ha... | erikd/hs-tls | core/Network/TLS/Crypto.hs | bsd-3-clause | 12,284 | 0 | 20 | 3,261 | 3,714 | 1,929 | 1,785 | 246 | 19 |
module CheckedLang.Data where
import qualified Data.List as L
import qualified Data.Map as M
import Data.Maybe (fromMaybe)
import qualified Text.Megaparsec as Mega
type Try = Either LangError
throwError :: LangError -> Try a
throwError = Left
type GeneralEnv = M.Map String
type Environm... | li-zhirui/EoplLangs | src/CheckedLang/Data.hs | bsd-3-clause | 5,028 | 0 | 14 | 1,177 | 1,610 | 866 | 744 | 133 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
--
-- Regs.hs --- ADC peripheral registers for the STM32F4.
--
-- Copyright (C) 2015, Galois, Inc.
-- All Rights Reserved.
--
module Ivory.BSP.STM32.Peripheral.ADC.Regs where
import Ivory.... | GaloisInc/ivory-tower-stm32 | ivory-bsp-stm32/src/Ivory/BSP/STM32/Peripheral/ADC/Regs.hs | bsd-3-clause | 2,181 | 0 | 4 | 539 | 41 | 33 | 8 | 8 | 0 |
module ScrabbleScoreKata.Day1Spec (spec) where
import Test.Hspec
import ScrabbleScoreKata.Day1 (score)
spec :: Spec
spec = do
it "is zero when empty input" $ do
score "" `shouldBe` 0
it "lowercase letter" $ do
score "a" `shouldBe` 1
it "uppercase lette... | Alex-Diez/haskell-tdd-kata | old-katas/test/ScrabbleScoreKata/Day1Spec.hs | bsd-3-clause | 986 | 0 | 11 | 370 | 278 | 132 | 146 | 27 | 1 |
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE OverloadedStrings #-}
-- |
--
-- Removing comments from a string. This is a very basic example that doesn't
-- handle nested comments, or quoted comments.
module Main (
main
) where
import Data.Bool
import qualified "text" Data.Text as T
import qualified "tex... | danidiaz/foldl-transduce | examples/Comments.hs | bsd-3-clause | 1,110 | 0 | 14 | 238 | 276 | 166 | 110 | 30 | 1 |
module Exercises.FindMissingNumbersSpec (main, spec) where
import Test.Hspec
import Data.List (delete)
import Test.QuickCheck
import Exercises.FindMissingNumbers
main :: IO ()
main = hspec spec
spec :: Spec
spec =
describe "findMissingPair" $ do
context "when input sequence contains only one or no missed numb... | WarKnife/exercises | test/Exercises/FindMissingNumbersSpec.hs | bsd-3-clause | 746 | 0 | 17 | 194 | 233 | 123 | 110 | 21 | 1 |
module Text.XML.Monad
(
module Text.XML.Monad.Core
, module Text.XML.Monad.Input
, module Text.XML.Monad.Proc
, module Text.XML.Monad.Output
, module Text.XML.Monad.Name
, module Text.XML.Monad.Error
)
where
import Text.XML.Monad.Core
import Text.XML.Monad.Input
import Text.XML.Monad.Proc
import Text.XML.Monad.Out... | aristidb/xml-monad | Text/XML/Monad.hs | bsd-3-clause | 379 | 0 | 5 | 39 | 99 | 72 | 27 | 14 | 0 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE OverloadedStrings, TupleSections, ScopedTypeVariables #-}
-- | Comment handling.
module HIndent.Comments where
import Control.Applicative ((<|>))
import Control.Arrow (first, second)
import Control.Monad.State.Strict
import Data.Data
import qualified Data.Map.Strict as M
impo... | lunaris/hindent | src/HIndent/Comments.hs | bsd-3-clause | 4,969 | 0 | 20 | 1,418 | 1,308 | 683 | 625 | 81 | 5 |
{-# LANGUAGE OverloadedStrings #-}
-- |
-- Copyright : (c) Andreas Reuleaux 2015
-- License : BSD2
-- Maintainer: Andreas Reuleaux <rx@a-rx.info>
-- Stability : experimental
-- Portability: non-portable
--
-- This module provides Pire's syntax,
-- ie. Pire's flavour of Pi-forall syntax: smart constructors,... | reuleaux/pire | src/Pire/Syntax/Smart.hs | bsd-3-clause | 2,858 | 0 | 9 | 697 | 489 | 276 | 213 | 25 | 1 |
-- Adapted from Agda sources.
{-# LANGUAGE UnicodeSyntax #-}
module Main ( main ) where
import Control.Monad ( liftM, when )
import Data.Char as Char ( isSpace )
import Data.Text ( Text )
import qualified Data.Text as Text ( dropWhileEnd, lines, null, unlines )
i... | jonaprieto/online-atps | src/fix-whitespace/FixWhitespace.hs | mit | 4,564 | 0 | 18 | 1,117 | 1,022 | 575 | 447 | 120 | 4 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- ... | fmapfmapfmap/amazonka | amazonka-route53-domains/gen/Network/AWS/Route53Domains/DisableDomainTransferLock.hs | mpl-2.0 | 5,612 | 0 | 14 | 1,098 | 600 | 369 | 231 | 79 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-| Helpers for creating various kinds of 'Field's.
They aren't directly needed for the Template Haskell code in Ganeti.THH,
so better keep them in a separate module.
-}
{-
Copyright (C) 2014 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with ... | onponomarev/ganeti | src/Ganeti/THH/Field.hs | bsd-2-clause | 5,269 | 0 | 11 | 1,067 | 746 | 446 | 300 | 69 | 1 |
------------------------------------------------------------------------------
-- |
-- Module: Database.PostgreSQL.Simple.Time
-- Copyright: (c) 2012 Leon P Smith
-- License: BSD3
-- Maintainer: Leon P Smith <leon@melding-monads.com>
-- Stability: experimental
--
-- Time types that supports positive and n... | timmytofu/postgresql-simple | src/Database/PostgreSQL/Simple/Time.hs | bsd-3-clause | 3,219 | 0 | 5 | 622 | 150 | 118 | 32 | 28 | 0 |
{-# OPTIONS_GHC -fno-implicit-prelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Word
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : libraries@haskell.org
-- S... | alekar/hugs | packages/base/Data/Word.hs | bsd-3-clause | 2,127 | 6 | 5 | 389 | 109 | 78 | 31 | 5 | 0 |
{-# LANGUAGE RecordWildCards, NamedFieldPuns #-}
-- | Management for the installed package store.
--
module Distribution.Client.Store (
-- * The store layout
StoreDirLayout(..),
defaultStoreDirLayout,
-- * Reading store entries
getStoreEntries,
doesStoreEntryExist,
-- * Creating store e... | themoritz/cabal | cabal-install/Distribution/Client/Store.hs | bsd-3-clause | 9,963 | 0 | 19 | 2,356 | 949 | 538 | 411 | 90 | 2 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeSynonymInstances #-}
module Text.ICalendar.Parser
( parseICalendar
, parseICalendarFile
, parseICal
, parseICalFile
, DecodingFunctions(..)
) where
import ... | chrra/iCalendar | Text/ICalendar/Parser.hs | bsd-3-clause | 2,580 | 0 | 16 | 659 | 644 | 372 | 272 | 57 | 2 |
{-# LANGUAGE
MultiParamTypeClasses,
TypeFamilies,
DeriveFunctor,
DeriveFoldable,
DeriveTraversable,
FlexibleInstances,
FlexibleContexts,
ConstraintKinds,
NoMonomorphismRestriction,
UndecidableInstances,
GeneralizedNewtypeDeriving #-}
module Update3 where
-- Copied from... | FranklinChen/music-score | sketch/old/update/update3.hs | bsd-3-clause | 2,980 | 0 | 10 | 692 | 1,081 | 584 | 497 | 70 | 1 |
module HList
( H
, repH
, absH
, myAppend
) where
type H a = [a] -> [a]
-- {-# INLINABLE repH #-}
repH :: [a] -> H a
repH xs = (xs ++)
-- {-# INLINABLE absH #-}
absH :: H a -> [a]
absH f = f []
-- Because we can't get unfolding for ++
myAppend :: [a] -> [a] -> [a]
myAppend [] ys = ys
myAppen... | conal/hermit | examples/new_reverse/HList.hs | bsd-2-clause | 782 | 0 | 7 | 215 | 160 | 94 | 66 | 13 | 1 |
-- |
-- Statistics for per-module compilations
--
-- (c) The GRASP/AQUA Project, Glasgow University, 1993-1998
--
{-# LANGUAGE FlexibleContexts #-}
module HscStats ( ppSourceStats ) where
import Bag
import HsSyn
import Outputable
import RdrName
import SrcLoc
import Util
import Data.Char
-- | Source Statistics
ppSo... | vTurbine/ghc | compiler/main/HscStats.hs | bsd-3-clause | 7,046 | 0 | 15 | 2,430 | 2,578 | 1,505 | 1,073 | 138 | 25 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
module Fun00005 where
prjF :: Project (sub :|| Type) sup => sup sig -> Maybe ((sub :|| Type) sig)
prjF = prj
class
( AlphaEq dom dom (dom :|| Typeable) [(VarId, VarId)]
, Alpha... | charleso/intellij-haskforce | tests/gold/parser/Fun00005.hs | apache-2.0 | 1,355 | 3 | 15 | 345 | 494 | 276 | 218 | -1 | -1 |
data DList a = DLNode (DList a) a (DList a)
rot :: Integer -> [a] -> [a]
rot n xs | n < 0 = rot (n+1) ((last xs):(init xs))
| n == 0 = xs
| n > 0 = rot (n-1) (tail xs ++ [head xs])
mkDList :: [a] -> DList a
mkDList [] = error "Must have at least one element."
mkDList xs = DLNode (... | bitemyapp/ghc-vis | docs/dll2.hs | bsd-3-clause | 374 | 0 | 10 | 119 | 229 | 115 | 114 | 8 | 1 |
module MediaWiki.API.Query.LangLinks.Import where
import MediaWiki.API.Types
import MediaWiki.API.Utils
import MediaWiki.API.Query.LangLinks
import Text.XML.Light.Types
import Text.XML.Light.Proc ( strContent )
import Control.Monad
import Data.Maybe
stringXml :: String -> Either (String,[{-Error msg-}String]) Lan... | neobrain/neobot | mediawiki/MediaWiki/API/Query/LangLinks/Import.hs | bsd-3-clause | 1,459 | 2 | 13 | 296 | 558 | 278 | 280 | 37 | 2 |
{-# LANGUAGE CPP, ForeignFunctionInterface, ScopedTypeVariables #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Utils
-- Copyright : Isaac Jones, Simon Marlow 2003-2004
-- License : BSD3
-- portions Copyright (c) 2007, G... | trskop/cabal | Cabal/Distribution/Simple/Utils.hs | bsd-3-clause | 53,840 | 0 | 21 | 14,657 | 11,503 | 6,072 | 5,431 | 887 | 7 |
module Main
( main
) where
import Test.Tasty
import qualified UnitTests.Distribution.Compat.CreatePipe
import qualified UnitTests.Distribution.Compat.ReadP
import qualified UnitTests.Distribution.Simple.Program.Internal
import qualified UnitTests.Distribution.Utils.NubList
tests :: TestTree
tests = testGroup... | corngood/cabal | Cabal/tests/UnitTests.hs | bsd-3-clause | 792 | 0 | 8 | 118 | 135 | 85 | 50 | 19 | 1 |
{-# LANGUAGE OverloadedStrings, CPP #-}
-- | High-ish level bindings to the HTML5 audio tag and JS API.
module Haste.Audio (
module Events,
Audio, AudioSettings (..), AudioType (..), AudioSource (..),
AudioPreload (..), AudioState (..), Seek (..),
defaultAudioSettings,
mkSource, newAudio, setSource,... | jtojnar/haste-compiler | libraries/haste-lib/src/Haste/Audio.hs | bsd-3-clause | 7,618 | 0 | 16 | 1,807 | 2,208 | 1,133 | 1,075 | 181 | 4 |
import Control.Exception as E
import Data.Int
main :: IO ()
main = do putStrLn "Int8"
mapM_ p =<< (f :: IO [Either Int8 String])
putStrLn "Int16"
mapM_ p =<< (f :: IO [Either Int16 String])
putStrLn "Int32"
mapM_ p =<< (f :: IO [Either Int32 String])
putStr... | urbanslug/ghc | libraries/base/tests/quotOverflow.hs | bsd-3-clause | 1,165 | 0 | 14 | 446 | 558 | 293 | 265 | 28 | 2 |
module T5252Take2 where
import qualified T5252Take2a as M
write_message :: M.WriteMessage -> IO Bool
write_message (M.WriteMessage _) = return True
| urbanslug/ghc | testsuite/tests/deSugar/should_compile/T5252Take2.hs | bsd-3-clause | 149 | 0 | 8 | 21 | 43 | 24 | 19 | 4 | 1 |
{-# LANGUAGE OverloadedLists, TypeFamilies, RebindableSyntax #-}
import Prelude
import Data.List
main = do print []
print [0,3..20]
print [3]
print [2..7]
print [20,2]
print [1,2,37]
fromListN _ = length
fromList = length
| urbanslug/ghc | testsuite/tests/overloadedlists/should_run/overloadedlistsrun05.hs | bsd-3-clause | 304 | 0 | 8 | 114 | 97 | 49 | 48 | 11 | 1 |
module A where
import C
-- THIS FIXES IT:
-- import B
| urbanslug/ghc | testsuite/tests/programs/hs-boot/A.hs | bsd-3-clause | 56 | 0 | 3 | 14 | 9 | 7 | 2 | 2 | 0 |
{-# OPTIONS_GHC -Wno-overlapping-patterns -Wno-incomplete-patterns -Wno-incomplete-uni-patterns -Wno-incomplete-record-updates #-}
-- | Index simplification mechanics.
module Futhark.Optimise.Simplify.Rules.Index
( IndexResult (..),
simplifyIndexing,
)
where
import Data.List.NonEmpty (NonEmpty (..))
import Da... | diku-dk/futhark | src/Futhark/Optimise/Simplify/Rules/Index.hs | isc | 10,189 | 0 | 27 | 3,155 | 3,422 | 1,647 | 1,775 | 207 | 31 |
module Main where
import MessageLoop
main :: IO ()
main = loop
| torus/haskell-eloima | app/Main.hs | isc | 65 | 0 | 6 | 14 | 22 | 13 | 9 | 4 | 1 |
reverseList :: [a] -> [a]
reverseList [] = []
reverseList (h:t) = reverseList t ++ [h]
{- Find out whether a list is a palindrome. -}
isPalindrome :: (Eq a) => [a] -> Bool
isPalindrome l = l == (reverseList l)
| andrewaguiar/s99-haskell | p06.hs | mit | 214 | 0 | 7 | 45 | 93 | 50 | 43 | 5 | 1 |
module GitHub.Search where
import GitHub.Internal
--| GET /legacy/issues/search/:owner/:repository/:state/:keyword
searchIssues ::
OwnerName ->
RepoName ->
IssueState ->
Text ->
GitHub IssuesSearchResultsData
--| GET /legacy/repos/search/:keyword
searchRepositories ::
Text ->
Language ->
Int ->
RepoSortBy ->... | SaneApp/github-api | src/GitHub/Search.hs | mit | 503 | 32 | 13 | 71 | 206 | 103 | 103 | -1 | -1 |
module Network.Skype.Parser.User where
import Control.Applicative
import Data.Attoparsec.ByteString.Char8 (anyChar, decimal)
import Data.Attoparsec.ByteString.Lazy
import Data.Word8
import Network.Skype.Parser.Types
import Network.Skype.Protocol.User
userProperty :: Parser UserProperty
userProperty = choice
[ UserH... | emonkak/skype4hs | src/Network/Skype/Parser/User.hs | mit | 3,934 | 0 | 10 | 923 | 914 | 483 | 431 | 72 | 1 |
-- | <http://strava.github.io/api/v3/comments/>
module Strive.Actions.Comments
( getActivityComments
) where
import Network.HTTP.Types (toQuery)
import Strive.Aliases (ActivityId, Result)
import Strive.Client (Client)
import Strive.Internal.HTTP (get)
import Strive.Options (GetActivityCommentsOptions)
import Striv... | tfausak/strive | source/library/Strive/Actions/Comments.hs | mit | 688 | 0 | 11 | 83 | 153 | 87 | 66 | 16 | 1 |
module Main (main) where
import XMonad
import XMonad.Actions.UpdatePointer
import qualified Data.Map as M
import Graphics.X11.ExtraTypes.XF86
import XMonad.Hooks.ManageHelpers (isFullscreen, doFullFloat)
-- needed by CopyWindows bindings
import qualified XMonad.StackSet as W
import XMonad.Actions.CopyWindow
-- XMob... | ajsalminen/ansible-role-dotfiles-xmonad | files/dotfiles/xmonad.hs | mit | 4,053 | 0 | 16 | 949 | 1,121 | 654 | 467 | 74 | 2 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeSynonymInstances #-}
--------------------------------------------------------------------------------
-- Module : TypeUtils
-- Maintainer : ... | SAdams601/ParRegexSearch | test/HaRe/src/Language/Haskell/Refact/Utils/TypeUtils.hs | mit | 105,025 | 16 | 27 | 29,076 | 21,743 | 11,075 | 10,668 | 1,311 | 28 |
fact :: Integer -> Integer
fact 0 = 1
fact x = x*fact (x-1)
twice :: Integer -> Integer
twice x = x^x
dist :: Double -> Double -> Double -> Double
dist v a t = 0.5 * a * t + v * t
main = do
putStrLn "Hello"
print (fact 3)
print (map twice [1,2,3])
print (sum (map twice [1,2,3]) )
print (sum (map (\x -> x^4) [... | ddeeff/sandbox | haskell/test.hs | mit | 362 | 0 | 14 | 92 | 244 | 122 | 122 | 15 | 1 |
-- Copyright © 2013 Julian Blake Kongslie <jblake@omgwallhack.org>
-- Licensed under the MIT license.
module Main
where
import Control.Applicative
import Control.Monad
import Data.List
import Data.List.Split
import qualified Data.Map as M
import Data.Maybe
import System.Directory
import System.Environment
import Syst... | jblake/solderapi | src/MkSolder.hs | mit | 3,524 | 0 | 19 | 816 | 1,189 | 606 | 583 | 85 | 4 |
module Sing where
fstString :: [Char] -> [Char]
fstString x = x ++ " in the rain"
sndString :: [Char] -> [Char]
sndString x = x ++ " over the rainbow"
sing1 = if ( x > y ) then fstString x else sndString y
where x = "Singin"
y = "Somewhere"
sing2 = if ( x < y ) then fstString x else sndString ... | Lyapunov/haskell-programming-from-first-principles | chapter_5/sing.hs | mit | 440 | 0 | 7 | 139 | 161 | 87 | 74 | 15 | 2 |
{-
foldl (\x y -> 2*x + y) 4 [1,2,3]
= { applying (\x y -> 2*x + y), (x,y)=(4, 1) }
2*(4) + 1 = 9
= { applying (\x y -> 2*x + y), (x,y)=(9, 2) }
2*(9) + 2 = 20
= { applying (\x y -> 2*x + y), (x,y)=(20,3) }
2*(20) + 3 = 43
-}
| calebgregory/fp101x | wk3/foldl.hs | mit | 240 | 0 | 2 | 75 | 3 | 2 | 1 | 1 | 0 |
{-# LANGUAGE BangPatterns #-}
module Main where
import Control.Applicative ((<$>))
import Control.Concurrent.Async
import Control.Concurrent.MVar
import Control.Concurrent.STM
import Control.DeepSeq
import Control.Exception (evaluate)
import Control.Monad
import Control.Monad.IO.Class (liftIO)
import Criterion.Main
i... | mcschroeder/ctrie | benchmarks/Concurrent.hs | mit | 5,062 | 0 | 18 | 1,385 | 1,482 | 767 | 715 | 100 | 1 |
main = print "NYI"
| TimoFreiberg/hanabi | test/Spec.hs | mit | 19 | 0 | 5 | 4 | 9 | 4 | 5 | 1 | 1 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Control.OperationalTransformation.Text.Gen
( genOperation'
, genOperation
) where
import Control.OperationalTransformation.Text
import Control.OperationalTransformation.Properties (ArbitraryFor (..))
import Test.QuickCheck hidin... | Operational-Transformation/ot.hs | test/Control/OperationalTransformation/Text/Gen.hs | mit | 1,879 | 0 | 15 | 459 | 739 | 385 | 354 | 44 | 11 |
module Main
where
import System.IO
import qualified Data.Tuple as T
import qualified Data.List as L
import qualified Data.Set as S
import qualified Data.Foldable as F
import qualified Data.Array as Array
import qualified Data.Monoid as Monoid
import qualified Data.Char ... | vialette/square-free-shuffle | Main.hs | mit | 5,951 | 0 | 23 | 1,969 | 1,990 | 1,042 | 948 | 109 | 4 |
module Text.Docvim.Visitor.Footer (extractFooter) where
import Control.Applicative
import Text.Docvim.AST
import Text.Docvim.Visitor
-- | Extracts a list of nodes (if any exist) from the `@footer` section(s) of
-- the source code.
--
-- It is not recommended to have multiple footers in a project. If multiple
-- foote... | wincent/docvim | lib/Text/Docvim/Visitor/Footer.hs | mit | 669 | 0 | 9 | 126 | 104 | 63 | 41 | 9 | 2 |
module Main where
import Akari
import Data.Attoparsec.ByteString
import Data.ByteString.Char8
import System.IO (isEOF)
import Text.Printf
parseLoop :: (a -> IO ()) -> Parser a -> IO ()
parseLoop callback parser =
go (parse parser)
where
go cont = do
eof <- isEOF
if eof then pure () else do... | tjhance/logic-puzzles | src/Solvers/Akari/Main.hs | mit | 782 | 0 | 19 | 303 | 255 | 123 | 132 | 24 | 4 |
module Red.Parse.Prim
( wordToFloat
, wordToInt32
, niceHex8
, niceHex16
, niceHex32
, hexPrint
)
where
import Data.Word
import Data.Int
import Numeric
import qualified Foreign as F
import qualified Data.ByteString as B
import System.IO.Unsafe (unsafePerformIO)
toTarget :: (F.Storable wo... | LeviSchuck/RedReader | Red/Parse/Prim.hs | mit | 1,775 | 0 | 12 | 551 | 747 | 373 | 374 | 54 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dlm-lifecyclepolicy-createrule.html
module Stratosphere.ResourceProperties.DLMLifecyclePolicyCreateRule where... | frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/DLMLifecyclePolicyCreateRule.hs | mit | 2,689 | 0 | 13 | 268 | 356 | 202 | 154 | 34 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE KindSignatures #-}
infixr 5 :::
data HList (ts :: [ * ]) where
Nil :: HList '[]
(:::) :: t -> HList ts -> HList (t ': ts)
-- Take the head of a non-empty list with the first value as Bool type.
headBool :: HList (Bool '... | riwsky/wiwinwlh | src/hlist.hs | mit | 644 | 0 | 10 | 140 | 254 | 145 | 109 | 18 | 1 |
-- Project Euler Problem 27 - quadratic primes
--
-- Product a*b, |a|<1000, |b|<1000, s.t. n^2 + an + b \in [Prime] for [1..k] s.t. k is maximized
--
import Data.List
import Data.Ord
max_value = 10000
-- Note coprimes assumes the input list is sorted
coprimes :: (Integral a) => [a] -> [a]
coprimes [] = []
coprimes ... | yunwilliamyu/programming-exercises | project_euler/p027_quadratic_primes.hs | cc0-1.0 | 749 | 2 | 11 | 157 | 300 | 165 | 135 | 12 | 1 |
{-# LANGUAGE DoAndIfThenElse #-}
module Parser.CSV(parseCSV) where
import qualified Data.Text as Dtext
import Text.ParserCombinators.Parsec
import qualified Control.Exception as Exception
import Text.ARFF as ARFF
import qualified Data.ByteString as BS
import Data.ByteString.Char8(pack,unpack)
import Data.List(sort)... | anirudhhkumarr/ml-lib | src/Parser/CSV.hs | gpl-2.0 | 7,184 | 0 | 18 | 2,643 | 1,851 | 972 | 879 | 108 | 5 |
{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances #-}
module RM.Machine where
-- $Id$
import Machine.Class
import RM.Type
import RM.Memory
import RM.State
import RM.Step
import Autolib.Set
import Autolib.FiniteMap
import Autolib.Reporter
import Autolib.ToDoc
import Control.Monad ( guard )
instance Compute... | Erdwolf/autotool-bonn | src/RM/Machine.hs | gpl-2.0 | 1,543 | 18 | 22 | 481 | 520 | 268 | 252 | 46 | 0 |
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
-- Interface to `makepkg`.
{-
Copyright 2012, 2013, 2014 Colin Woodbury <colingw@gmail.com>
This file is part of Aura.
Aura is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Fou... | vigoos/Farrago-OS | aura-master/aura-master/src/Aura/MakePkg.hs | gpl-2.0 | 2,519 | 0 | 13 | 459 | 540 | 297 | 243 | 38 | 2 |
{-# LANGUAGE QuasiQuotes, RecordWildCards, NoCPP #-}
{-|
The @balancesheet@ command prints a simple balance sheet.
-}
module Hledger.Cli.Balancesheet (
balancesheetmode
,balancesheet
,tests_Hledger_Cli_Balancesheet
) where
import Data.String.Here
import System.Console.CmdArgs.Explicit
import Test.HUnit
import ... | mstksg/hledger | hledger/Hledger/Cli/Balancesheet.hs | gpl-3.0 | 1,312 | 0 | 8 | 221 | 178 | 111 | 67 | 26 | 1 |
-- |
-- Copyright : (c) 2011 Simon Meier
-- License : GPL v3 (see LICENSE)
--
-- Maintainer : Simon Meier <iridcode@gmail.com>
--
-- Monoids for bounded types.
module Extension.Data.Bounded (
BoundedMax(..)
, BoundedMin(..)
) where
import Data.Monoid
-- | A newtype wrapper for a monoid of the maximum ... | ekr/tamarin-prover | lib/utils/src/Extension/Data/Bounded.hs | gpl-3.0 | 965 | 0 | 8 | 253 | 241 | 138 | 103 | 14 | 0 |
{-|
Copyright : (c) Nathan Bloomfield, 2017
License : GPL-3
Maintainer : nbloomf@gmail.com
Stability : experimental
-}
module Hakyll.Shortcode.Types.Letters_Numbers_Hyphens_Underscores (
Letters_Numbers_Hyphens_Underscores()
) where
import Text.Regex.Posix ((=~))
import Hakyll.Shortcode.Validate
-- | S... | nbloomf/hakyll-shortcode | src/Hakyll/Shortcode/Types/Letters_Numbers_Hyphens_Underscores.hs | gpl-3.0 | 765 | 0 | 10 | 123 | 112 | 66 | 46 | 14 | 0 |
module Model.Progression
(
module Data.Complex
, FComplex
, FractalProgression(..)
, mandelbrot
) where
import Data.Complex
type FComplex = Complex Double
data FractalProgression = FractalProgression {
progression :: FComplex -> FComplex -> FComplex
, start :: FComplex
}
-- TODO: make Frac... | phaazon/phraskell | src/Model/Progression.hs | gpl-3.0 | 482 | 0 | 10 | 93 | 111 | 66 | 45 | 13 | 1 |
module BabyRays.Scene where
import Core.Constants
import Core.Transform
import Core.Geometry
import BabyRays.Camera
import BabyRays.Types
import BabyRays.Color
import BabyRays.Light
import BabyRays.Shape
import BabyRays.Material
data Scene = Scene {backgroundColor :: Color,
ambientLight :: Col... | dsj36/dropray | src/BabyRays/Scene.hs | gpl-3.0 | 5,055 | 0 | 12 | 1,898 | 1,395 | 774 | 621 | 58 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Storage which contains data about explorers.
module RSCoin.Bank.Storage.Explorers
( ExplorersStorage
, mkExplorersStorage
, Query
, getExplorers
, getExplorersAndPeriods
... | input-output-hk/rscoin-haskell | src/RSCoin/Bank/Storage/Explorers.hs | gpl-3.0 | 3,645 | 0 | 15 | 924 | 748 | 416 | 332 | -1 | -1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-logging/gen/Network/Google/Resource/Logging/Organizations/Logs/Delete.hs | mpl-2.0 | 5,815 | 0 | 17 | 1,334 | 859 | 502 | 357 | 121 | 1 |
module Identity where
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
newtype Identity a = Identity a
deriving (Eq, Ord, Show)
instance Functor Identity where
fmap f (Identity a) = Identity $ f a
instance Foldable Identity where
foldMap f (Identity a) = f a
instance Trav... | thewoolleyman/haskellbook | 21/12/haskell-club/ChapterExercises.hs | unlicense | 1,149 | 0 | 12 | 260 | 475 | 240 | 235 | 40 | 1 |
module Git.Command.FormatPatch (run) where
run :: [String] -> IO ()
run args = return () | wereHamster/yag | Git/Command/FormatPatch.hs | unlicense | 89 | 0 | 7 | 15 | 42 | 23 | 19 | 3 | 1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
module Data.Tree.Monadic (
MTree(..),
-- * Running trees
-- These functions traverse MTrees and return pure rose trees.
-- Their drawback is that they keep the entire tree in memory.
-- If y... | jtapolczai/Hephaestos | Data/Tree/Monadic.hs | apache-2.0 | 4,099 | 1 | 14 | 1,072 | 921 | 499 | 422 | 57 | 1 |
{-
Copyright 2015 Arun Raghavan <mail@arunraghavan.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... | ford-prefect/xml2ucm | src/UCM.hs | apache-2.0 | 8,279 | 0 | 15 | 2,152 | 2,254 | 1,217 | 1,037 | 163 | 3 |
module Import
( module Prelude
, module Yesod
, module Foundation
, (<>)
, Text
, unpack
, module Data.Monoid
, module Control.Applicative
) where
import Prelude hiding (writeFile, readFile)
import Yesod hiding (Route(..))
import Foundation
import Data.Monoid (Monoid (mappend, mem... | qzchenwl/myweb | Import.hs | bsd-2-clause | 475 | 0 | 7 | 107 | 154 | 103 | 51 | 18 | 1 |
-- 932718654
import Euler(digitUsage, fromDigits, toDigitsBase)
nn = 9
genMult0 _ [] _ = error "genMult0: empty"
genMult0 xs (y:ys) n
| length xs2 == n = fromDigits xs2
| length xs2 > n = 0
| otherwise = genMult0 xs2 ys n
where xs2 = xs ++ toDigitsBase 10 y
genMult n x = genMult0 [] [x,x+x..] n
large... | higgsd/euler | hs/38.hs | bsd-2-clause | 577 | 0 | 11 | 136 | 255 | 128 | 127 | 13 | 1 |
{-# LANGUAGE PatternGuards, CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Haddock.Convert
-- Copyright : (c) Isaac Dupree 2009,
-- License : BSD-like
--
-- Maintainer : haddock@projects.haskell.org
-- Stability : experimental
-- Portability : ... | ghcjs/haddock-internal | src/Haddock/Convert.hs | bsd-2-clause | 16,931 | 53 | 22 | 5,052 | 3,553 | 1,867 | 1,686 | 273 | 10 |
-- {-# LANGUAGE FlexibleInstances #-}
-- {-# LANGUAGE TupleSections #-}
-- {-# LANGUAGE UndecidableInstances #-}
-- {-# LANGUAGE DeriveFunctor #-}
-- {-# LANGUAGE DeriveFoldable #-}
-- {-# LANGUAGE DeriveTraversable #-}
-- {-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE RecordWildCards #-}
{-# L... | kawu/ltag | src/NLP/LTAG/Earley5.hs | bsd-2-clause | 42,413 | 0 | 20 | 13,240 | 12,414 | 6,476 | 5,938 | -1 | -1 |
-- 20492570929
mm = [2,3,4]
nn = 50
-- first block is either black or colored
-- a(n) = a(n-1) + a(n-m)
-- ignore all-black result
-- f(n) = a(n) - 1
getCount0 m = (map (getSlowCount m) [0..] !!)
getSlowCount m n = if m > n then 1 else getCount0 m (n-1) + getCount0 m (n-m)
getCount m n = (getCount0 m n) - 1
sumAllCo... | higgsd/euler | hs/116.hs | bsd-2-clause | 430 | 4 | 9 | 96 | 182 | 92 | 90 | 7 | 2 |
module Drasil.GamePhysics.Changes (likelyChgs, unlikelyChgs) where
--A list of likely and unlikely changes for GamePhysics
import Language.Drasil
import Utils.Drasil
import Data.Drasil.Concepts.Documentation as Doc (library, likeChgDom, unlikeChgDom)
import qualified Data.Drasil.Concepts.Math as CM (ode, constraint)... | JacquesCarette/literate-scientific-software | code/drasil-example/Drasil/GamePhysics/Changes.hs | bsd-2-clause | 2,698 | 0 | 13 | 329 | 535 | 312 | 223 | 39 | 1 |
{-# LANGUAGE TemplateHaskell #-}{-|
Forth word definition.
-}
module Language.Forth.Word (ForthWord(..), WordId(..), WordKind(..),
WordFlags(..), LinkField, wordFlags, hasFlag,
name, wordSymbol, link, doer, wordId, wordKind,
maxNam... | hth313/hthforth | src/Language/Forth/Word.hs | bsd-2-clause | 1,680 | 0 | 12 | 457 | 431 | 253 | 178 | 40 | 1 |
{-# LANGUAGE TypeFamilies, TypeOperators, DataKinds #-}
module Control.Effect.CounterNat where
import Control.Effect
import GHC.TypeLits
import Prelude hiding (Monad(..))
{-| Provides a way to 'count' in the type-level with a monadic interface
to sum up the individual counts of subcomputations. Instead
of u... | dorchard/effect-monad | src/Control/Effect/CounterNat.hs | bsd-2-clause | 886 | 0 | 8 | 200 | 172 | 97 | 75 | 14 | 1 |
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-| Unittests for ganeti-htools.
-}
{-
Copyright (C) 2009, 2010, 2011, 2012 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions a... | apyrgio/snf-ganeti | test/hs/Test/Ganeti/JSON.hs | bsd-2-clause | 3,352 | 0 | 12 | 684 | 609 | 318 | 291 | 44 | 2 |
-- Header -------------------------------------------------------------- {{{
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE Tuple... | nwf/grade | lib/Grade/Parse.hs | bsd-2-clause | 7,714 | 0 | 26 | 2,060 | 2,154 | 1,103 | 1,051 | 120 | 4 |
module Main where
import Network.BitcoinRPC
rpcAuth :: RPCAuth
rpcAuth = RPCAuth "http://127.0.0.1:8332" "rpcuser" "localaccessonly"
main :: IO ()
main = getBlockCountR Nothing rpcAuth >>= print
| javgh/bitcoin-rpc | SampleApp3.hs | bsd-3-clause | 198 | 0 | 6 | 28 | 50 | 27 | 23 | 6 | 1 |
-- Subtyping relation
{-# LANGUAGE BangPatterns #-}
module LambdaQuest.Finter.Subtype where
import LambdaQuest.Finter.Type
import LambdaQuest.SystemFsub.Subtype (primSubType,primMeetType,primJoinType)
import Data.Foldable (foldl')
normalizeType :: [Binding] -> Type -> CCanonicalType
normalizeType ctx (TyPrim p) = [CTy... | minoki/LambdaQuest | src/LambdaQuest/Finter/Subtype.hs | bsd-3-clause | 4,133 | 0 | 12 | 1,058 | 1,718 | 860 | 858 | 70 | 3 |
module Conversion where
import Types
rawConvertTemp :: TemperatureUOM
-> TemperatureUOM
-> Double
-> Double
rawConvertTemp oldUOM newUOM = fromCelsius newUOM . toCelsius oldUOM
where
toCelsius :: TemperatureUOM -> Double -> Double
toCelsius Celsius ... | oswynb/weather | lib/Conversion.hs | bsd-3-clause | 2,796 | 0 | 10 | 901 | 725 | 360 | 365 | 71 | 5 |
{-# LANGUAGE TupleSections #-}
-- | Operations on the 'Actor' type that need the 'State' type,
-- but not the 'Action' type.
-- TODO: Document an export list after it's rewritten according to #17.
module Game.LambdaHack.Common.ActorState
( fidActorNotProjAssocs, fidActorNotProjList
, actorAssocsLvl, actorAssocs, ac... | Concomitant/LambdaHack | Game/LambdaHack/Common/ActorState.hs | bsd-3-clause | 19,079 | 0 | 19 | 4,704 | 6,061 | 3,186 | 2,875 | -1 | -1 |
module Maybe(
isJust, isNothing,
fromJust, fromMaybe, listToMaybe, maybeToList,
catMaybes, mapMaybe,
-- ...and what the Prelude exports
Maybe(Nothing, Just),
maybe
) where
instance Eq a => Eq (Maybe a) where
(==) = eqMaybe
eqMaybe x y = case x of
Nothing -> case y of
Nothin... | ndmitchell/qed | imports/Maybe.hs | bsd-3-clause | 1,357 | 0 | 11 | 537 | 475 | 249 | 226 | 43 | 4 |
{-# LANGUAGE OverloadedStrings #-}
module Validations.Parsers.Fixtures
( localPhoneNumber
, localPhoneNumberWithExtension
, phoneNumberWithAreaCode
, phoneNumberWithAreaCodeAndExtension
, phoneNumberWithAreaCodeAndCountryCode
, phoneNumberWithAreaCodeAndExtendedCountryCode
, phoneNumberWith... | mavenraven/validations-checkers | tests/Validations/Parsers/Fixtures.hs | bsd-3-clause | 3,325 | 0 | 6 | 440 | 654 | 419 | 235 | 55 | 1 |
module Lambdiff.Process where
import Data.List (foldl')
import Data.Maybe (fromMaybe)
import Lambdiff.DiffParse (ParseFileResult(..),
ParseChunk(..),
ParseLine(..))
import Lambdiff.Types
import Debug.Trace (trace)
isNotNull = (/= "/dev/null")
processParseFile ::... | jamwt/lambdiff | src/Lambdiff/Process.hs | bsd-3-clause | 2,583 | 0 | 11 | 606 | 868 | 478 | 390 | -1 | -1 |
{-# language CPP #-}
-- | = Name
--
-- VK_KHR_display_swapchain - device extension
--
-- == VK_KHR_display_swapchain
--
-- [__Name String__]
-- @VK_KHR_display_swapchain@
--
-- [__Extension Type__]
-- Device extension
--
-- [__Registered Extension Number__]
-- 4
--
-- [__Revision__]
-- 10
--
-- [__Exten... | expipiplus1/vulkan | src/Vulkan/Extensions/VK_KHR_display_swapchain.hs | bsd-3-clause | 23,340 | 0 | 22 | 4,472 | 2,806 | 1,761 | 1,045 | -1 | -1 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.Raw.ARB.TextureBorderClamp
-- Copyright : (c) Sven Panne 2013
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability : porta... | mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/ARB/TextureBorderClamp.hs | bsd-3-clause | 715 | 0 | 4 | 86 | 38 | 32 | 6 | 3 | 0 |
module Model where
import Prelude
import Yesod
import Data.Text (Text)
import Database.Persist.Quasi
import Data.Typeable (Typeable)
import Data.Time.Clock (UTCTime)
-- You can define all of your database entities in the entities file.
-- You can find more information on persistent and how to declare entities
-- at:
... | tanakh/icfp2013-clone | Model.hs | bsd-3-clause | 479 | 0 | 8 | 62 | 80 | 47 | 33 | -1 | -1 |
-- mod fclabels: http://hackage.haskell.org/package/fclabels
{-# LANGUAGE TypeOperators, TypeSynonymInstances, TemplateHaskell, PackageImports #-}
module Rika.Data.Record.Label
(
-- * Getter, setter and modifier types.
Getter
, Setter
, Modifier
-- * Label type.
, Point
, (:->) (Label)
, label
... | nfjinjing/human-rights-ios | src/Rika/Data/Record/Label.hs | bsd-3-clause | 3,924 | 0 | 11 | 997 | 1,537 | 830 | 707 | 84 | 1 |
--
-- Copyright © 2014-2015 Anchor Systems, Pty Ltd and Others
--
-- The code in this file, and the program it is a part of, is
-- made available to you by its authors as open source software:
-- you can redistribute it and/or modify it under the terms of
-- the 3-clause BSD licence.
--
{-# LANGUAGE DeriveDataTypeable... | anchor/synchronise | lib/Synchronise/DataSource.hs | bsd-3-clause | 8,864 | 1 | 14 | 2,272 | 1,919 | 999 | 920 | 163 | 3 |
{-# LANGUAGE RecordWildCards #-}
module Abstract.Impl.Libs.Queue.Chan.Internal (
QueueChan,
mkQueue'Chan
) where
import Control.Exception
import Control.Concurrent
import Control.Concurrent.Chan
import Abstract.Interfaces.Queue
data QueueChan t = QueueChan {
_conn :: Chan t
}
mkQueue'Chan :: IO (Queue IO t)
mkQu... | adarqui/Abstract-Impl-Libs | src/Abstract/Impl/Libs/Queue/Chan/Internal.hs | bsd-3-clause | 1,118 | 0 | 9 | 209 | 430 | 221 | 209 | 37 | 1 |
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE CPP #-}
module CLaSH.Util.CoreHW.TermSubst
( emptySubst
, extendTvSubst
, substTerm
)
where
-- External Modules
import Data.List (mapAccumL)
-- GHC API
import qualified CoreSubst
import Id (maybeModifyIdInfo, idInfo, idName)
import qualified Type
im... | christiaanb/clash-tryout | src/CLaSH/Util/CoreHW/TermSubst.hs | bsd-3-clause | 4,791 | 0 | 11 | 1,317 | 1,485 | 783 | 702 | -1 | -1 |
module Tools (
usage
, version
, success
, failed
, contactLookup
) where
import System.Console.ANSI
import Types
-- | Define some useful functions and wrappers for hpt
-- | Classic usage string when user lauched with wrong argu... | nschoe/hpt | src/Tools.hs | bsd-3-clause | 1,681 | 0 | 9 | 510 | 264 | 137 | 127 | 31 | 1 |
{-# LANGUAGE FlexibleInstances, ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Instances where -- copied (and adapted) from the core library
import XMonad.Hooks.ManageDocks
import XMonad.Layout.LimitWindows
import Test.QuickCheck
import Utils
import ... | xmonad/xmonad-contrib | tests/Instances.hs | bsd-3-clause | 5,720 | 0 | 16 | 1,574 | 1,300 | 700 | 600 | 103 | 1 |
-- | Secure generation of random numbers and bytestrings.
module Pos.Crypto.Random
( SecureRandom(..)
, secureRandomBS
, deterministic
, randomNumber
, randomNumberInRange
) where
import Crypto.Number.Basic (numBytes)
import Crypto.Number.Serialize (os2ip... | input-output-hk/pos-haskell-prototype | crypto/Pos/Crypto/Random.hs | mit | 2,682 | 0 | 12 | 593 | 487 | 270 | 217 | -1 | -1 |
-----------------------------------------------------------------------------
--
-- Module : Base
-- Copyright :
-- License : MIT
--
-- Maintainer : agocorona@gmail.com
-- Stability :
-- Portability :
--
-- | See http://github.com/agocorona/transient
-- Everything in this module is exported in order to... | agocorona/transient | src/Transient/Internals.cont.hs | mit | 48,083 | 0 | 27 | 14,168 | 11,239 | 5,746 | 5,493 | 751 | 9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.