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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
module Distribution.Solver.Types.Progress
( Progress(..)
, foldProgress
) where
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative
( Applicative(..) )
#endif
import Control.Applicative
( Alternative(..) )
#if !MIN_VERSION_base(4,8,... | headprogrammingczar/cabal | cabal-install/Distribution/Solver/Types/Progress.hs | bsd-3-clause | 1,646 | 0 | 9 | 419 | 410 | 225 | 185 | 31 | 3 |
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ConstraintKinds #-}
module T4175 where
import GHC.Exts
type family A a b
type instance A Int Int = ()
type instance A (Maybe a) a = a
type instance A (B a) b = ()
data family B a
data instance B () = MkB
class C a where
type D a b
instance C Int where
type D Int b... | tjakway/ghcjvm | testsuite/tests/ghci/scripts/T4175.hs | bsd-3-clause | 524 | 0 | 8 | 145 | 227 | 125 | 102 | -1 | -1 |
module FileIO where
import System.IO
import Foreign
import Foreign.C
foreign import ccall safe "fileio.h c_file_getresult"
c_file_getresult :: CInt -> IO CInt
| holzensp/ghc | testsuite/tests/concurrent/prog002/FileIO.hs | bsd-3-clause | 165 | 0 | 7 | 27 | 38 | 22 | 16 | 6 | 0 |
import qualified Data.List as List
import Data.Set (Set)
import qualified Data.Set as Set
main = do
presents <- read <$> getContents
let solution = head $ dropWhile ((< presents) . (* 11) . sum . factors) [1 ..]
print solution
factors :: Int -> Set Int
factors n =
Set.unions $
map (\r -> let r' = n `div` ... | SamirTalwar/advent-of-code | 2015/AOC_20_2.hs | mit | 485 | 0 | 16 | 132 | 234 | 128 | 106 | 14 | 2 |
-- Problem 4
-- (*) Find the number of elements of a list.
myLength :: [a] -> Int
myLength [] = 0
myLength (_:xs) = 1 + myLength xs
myLength2 :: [a] -> Int
myLength2 x = myLength2' x 0
where
myLength2' [] acc = acc
myLength2' (_:xs) acc = myLength2' xs (acc+1)
myLength3 :: [a] -> Int
myLength3 = sum . map (\_ -... | usami-k/H-99-Ninety-Nine-Haskell-Problems | 01-10/04.hs | mit | 326 | 0 | 9 | 75 | 147 | 78 | 69 | 9 | 2 |
chain :: (Integral a) => a -> [a]
chain 1 = [1]
chain n
| even n = n:chain(n `div` 2)
| odd n = n:chain(n*3 + 1)
numLongChains :: Int
numLongChains = length (filter isLong (map chain [1..100]))
where isLong xs = length xs > 15
| ariedov/AwesomeHaskellApp | collatz.hs | mit | 232 | 2 | 10 | 52 | 149 | 75 | 74 | 8 | 1 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.Attoparsec.Text
import Data.Bifunctor (bimap)
import Data.Char (ord)
import Data.Foldable (for_, traverse_)
import Data.Map.... | genos/online_problems | advent_of_code_2021/day14/Main.hs | mit | 2,201 | 0 | 16 | 648 | 800 | 431 | 369 | 54 | 2 |
module JSONSchema.Validator.Draft4.Array where
import Import
import qualified Data.List.NonEmpty as NE
import qualified Data.Vector as V
import qualified JSONPointer as JP
import JSONSchema.Validator.Utils (allUniqueValues)
--------------------------------------------------
-- * maxItems
-------... | seagreen/hjsonschema | src/JSONSchema/Validator/Draft4/Array.hs | mit | 7,556 | 0 | 16 | 1,875 | 1,953 | 1,036 | 917 | -1 | -1 |
{-# LANGUAGE OverloadedStrings, GeneralizedNewtypeDeriving, TypeFamilies, FlexibleContexts #-}
module Haste.JSArray.Typed where
import Control.DeepSeq (NFData, force)
import Control.Monad (liftM2)
import Haste.Foreign
import qualified Haste.JSArray as JA
import Haste.Prim
import System.IO.Unsafe (unsafePerformIO)
ne... | klarh/haste-jsarray | src/Haste/JSArray/Typed.hs | mit | 8,483 | 0 | 12 | 1,163 | 1,720 | 885 | 835 | 124 | 1 |
module GHCJS.DOM.HTMLOutputElement (
) where
| manyoo/ghcjs-dom | ghcjs-dom-webkit/src/GHCJS/DOM/HTMLOutputElement.hs | mit | 47 | 0 | 3 | 7 | 10 | 7 | 3 | 1 | 0 |
module PostgREST.ApiRequest where
import qualified Data.Aeson as JSON
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as BL
import qualified Data.Csv as CSV
import Data.List (find, sortBy)
import qualified Data.HashMa... | league/postgrest | src/PostgREST/ApiRequest.hs | mit | 10,234 | 110 | 17 | 3,107 | 2,015 | 1,132 | 883 | -1 | -1 |
{-# LANGUAGE
TupleSections,
Rank2Types
#-}
module TestInference where
import Data.AEq
import Control.Monad.Trans.Identity
import Control.Monad.Bayes.Class
import qualified Control.Monad.Bayes.Enumerator as Dist
import Control.Monad.Bayes.Sampler
import Control.Monad.Bayes.Weighted
import Control.Monad.Bayes.Pop... | ocramz/monad-bayes | test/TestInference.hs | mit | 2,347 | 0 | 12 | 472 | 458 | 248 | 210 | 38 | 1 |
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Estimate where
newtype Task = Task String deriving Show
newtype Time = Time Float deriving (Eq, Show, Num, Fractional, Ord)
data Estimate = Estimate {description :: Task,
best :: Time,
norm... | manuelp/estimate | Estimate.hs | mit | 832 | 0 | 13 | 273 | 271 | 150 | 121 | 19 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module WUnderground.Client
( -- * Weather conditions API
withWU
, coordinateConditions
) where
-------------------------------------------------------------------------------
import Control.Applicative
import C... | Soostone/wunderground | src/WUnderground/Client.hs | mit | 3,581 | 15 | 17 | 875 | 777 | 418 | 359 | -1 | -1 |
{-# LANGUAGE TemplateHaskell #-}
module Bank.Models.Account.Commands
( accountCommands
, OpenAccount (..)
, CreditAccount (..)
, DebitAccount (..)
, TransferToAccount (..)
, AcceptTransfer (..)
) where
import Language.Haskell.TH (Name)
import Eventful.UUID
import Bank.Json
accountCommands :: [Name]
a... | jdreaver/eventful | examples/bank/src/Bank/Models/Account/Commands.hs | mit | 1,396 | 0 | 8 | 227 | 320 | 189 | 131 | 50 | 1 |
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LA... | oisdk/SSystemOpt | src/Numeric/SSystem.hs | mit | 4,111 | 0 | 16 | 865 | 1,338 | 724 | 614 | 76 | 1 |
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE JavaScriptFFI #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
module Program.MapTiles
( downloadMapTiles
) where
import Commons
import Numeric.DataFrame
import Control.Lens
import J... | achirkin/qua-view | src/Program/MapTiles.hs | mit | 5,406 | 7 | 20 | 1,435 | 1,681 | 907 | 774 | -1 | -1 |
-----------------------------------------------------------------------------
--
-- Module : InfList
-- Copyright :
-- License : AllRightsReserved
--
-- Maintainer :
-- Stability :
-- Portability :
--
-- | Playing with infinite lists
--
-------------------------------------------------------------------... | equational/JL2012 | HaskellExamples/src/InfList.hs | mit | 735 | 0 | 9 | 156 | 244 | 147 | 97 | 11 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE LambdaCase,
OverloadedStrings,
FlexibleContexts,
GeneralizedNewtypeDeriving #-}
#include "ghc-compat.h"
module HsToCoq.ConvertHaskell.Type
(convertType,
convertLType,
convertLHsTyVarBndrs,
convertLHsSigType,
convertLHsSigTypeWithEx... | antalsz/hs-to-coq | src/lib/HsToCoq/ConvertHaskell/Type.hs | mit | 9,074 | 0 | 17 | 1,604 | 2,357 | 1,172 | 1,185 | 161 | 12 |
module RedditGrabber where
import Data.Aeson.Parser
import Network.HTTP
import RedditHeader
import Data.Text
grab :: IO [Post]
parse json bytestr -> Result Value
convert :: Value -> [Post]
create :: Value -> Post
create (Object o) = Post {
sub = lookupDefault (String pack "") key o,
score = Nothing,
username = ... | vektordev/mlreader | src/RedditGrabber.hs | gpl-2.0 | 745 | 45 | 7 | 146 | 241 | 136 | 105 | -1 | -1 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE RecordWildCards #-}
-- |
-- Module: $HEADER$
-- Description: Low level FFI.
-- Copyright:
-- License: GPL-2
--
-- Maintainer: Jan Sipr <jan.sipr@ixperta.com>
-- Stability: experimental
-- Portability: GHC specific language extensions.
module Phone.Run
... | IxpertaSolutions/hsua | src/Phone/Run.hs | gpl-2.0 | 5,950 | 0 | 16 | 1,584 | 1,311 | 732 | 579 | -1 | -1 |
----------------------------------------------------
-- --
-- Statistics.hs: --
-- Functions that collect and print out --
-- statistics --
-- --
--... | kowey/GenI | src/NLP/GenI/Statistics.hs | gpl-2.0 | 4,343 | 0 | 11 | 905 | 804 | 438 | 366 | 53 | 1 |
import Data.List
main :: IO ()
main = print solve
solve :: Int
solve = sum $ notPossible
-- Upper limit for the numbers that can be written as the sum of two abundant numbers
p = 28123
-- The proper divisors of a given integer.
divisors :: Integral a => a -> [a]
divisors x = (nub.init) $ firstHalf ++ seco... | NorfairKing/project-euler | 023/haskell/solution.hs | gpl-2.0 | 962 | 0 | 12 | 236 | 270 | 147 | 123 | 15 | 1 |
module Main where
import CardDB (cards, delete, first, get, insert, maxId, nextId, putDBInfo,
randomCards, setDBUp, update)
import Cards (ask, create, demote, edit, export, isDue, promote, put)
import Control.Monad (filterM, forM_, liftM, when)
import Data.Maybe (catMaybes, fromJust)
import System.Conso... | bbshortcut/Palace | src/cards.hs | gpl-3.0 | 3,357 | 2 | 23 | 1,531 | 922 | 485 | 437 | 77 | 14 |
module Config where
import Control.Arrow (left)
import Control.Exception (throw)
import Data.Map (fromList)
import System.Directory (getHomeDirectory)
import System.FilePath ((</>))
import Text.Parsec (ParseError)
import Text.Read (readEither)
import Error
import Project
data Policy = MergeAll | KeepFirst | KeepLast... | Tuplanolla/contents | Config.hs | gpl-3.0 | 2,991 | 0 | 10 | 754 | 556 | 330 | 226 | 61 | 2 |
module Main where
import System.Environment(getArgs)
import Numeric (readFloat)
import Data.List (maximumBy)
import Data.Function (on)
type Thing = (Int, Rational, Int)
type Package = ([Int], Rational, Int)
splitBy :: Char -> String -> [String]
splitBy c s =
case dropWhile (== c) s of
"" -> []
s'... | cryptica/CodeEval | Challenges/114_PackageProblem/main.hs | gpl-3.0 | 1,642 | 0 | 14 | 398 | 682 | 371 | 311 | 45 | 2 |
-- Simulation of non-flood syncing of content, across a network of nodes.
module Main where
import System.Random
import Control.Monad.Random
import Control.Monad
import Control.Applicative
import Data.Ratio
import Data.Ord
import Data.List
import Data.Maybe
import qualified Data.Set as S
import qualified Data.Map.Str... | RedeMocambos/baobaxia | doc/Relatorio/Apen/simroutes.hs | gpl-3.0 | 13,396 | 193 | 22 | 3,245 | 3,987 | 2,145 | 1,842 | -1 | -1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-gmail/gen/Network/Google/Resource/Gmail/Users/Labels/Patch.hs | mpl-2.0 | 3,509 | 0 | 15 | 856 | 462 | 277 | 185 | 72 | 1 |
module Support
where
import Data.Maybe
import Data.List
import Libaddutil.ListUtils
import Libaddutil.Entity
import Libaddutil.Vector
import Libaddutil.Primitives
import Freekick.Libsoccer.Lineup
import Freekick.Libsoccer.Formation
import Freekick.Libsoccer.Player
import Freekick.Libmatch.PlayerInfo
import Freekick... | anttisalonen/freekick | haskell/freekick_server/ai/src/Support.hs | agpl-3.0 | 3,189 | 0 | 16 | 683 | 956 | 506 | 450 | 48 | 3 |
module QuantLib.Currencies.Europe
( module QuantLib.Currencies.Europe
) where
import QuantLib.Currency
-- | Swiss france
chf :: Currency
chf = Currency {
cName = "Swiss franc",
cCode = "CHF",
cIsoCode = 756,
cFracsPerUnit = 100
}
--... | paulrzcz/hquantlib | src/QuantLib/Currencies/Europe.hs | lgpl-3.0 | 1,132 | 0 | 6 | 504 | 206 | 134 | 72 | 33 | 1 |
-- Short Exercise
-- 1.
data Sum a b = First a | Second b deriving (Eq, Show)
instance Functor (Sum a) where
fmap _ (First a) = First a
fmap f (Second a) = Second (f a)
{- 2. Why is a Functor instance that applies the function on to First, Either's Left, impossible?
Because the Functor instance has to be of ki... | dmp1ce/Haskell-Programming-Exercises | Chapter 16/Short Exercise.hs | unlicense | 430 | 0 | 8 | 95 | 89 | 47 | 42 | 4 | 0 |
module ChangeMood where
data Mood = Blah | Woot deriving Show
changeMood :: Mood -> Mood
changeMood Blah = Woot
changeMood _ = Blah
| thewoolleyman/haskellbook | 04/03/chad/ChangeMood.hs | unlicense | 134 | 0 | 5 | 26 | 42 | 24 | 18 | 5 | 1 |
#!/usr/bin/env stack
-- stack --resolver lts-8.12 script
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
{-# LANGUAGE OverloadedStrings #-}
module S5Logging where
import Control.Exception.Safe (onException)
import Control.Monad.IO.Class ... | haroldcarr/learn-haskell-coq-ml-etc | haskell/course/2017-05-snoyman-applied-haskell-at-lambdaconf/S5Logging.hs | unlicense | 953 | 0 | 12 | 253 | 198 | 110 | 88 | 20 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Citeproc.Element
( pLocale
, pDate
, Attributes(..)
, lookupAttribute
, ElementParser
, runElementParser
, parseFailure
, getChildren
, allChildren
, getAttributes
, getNameAttributes
, getFormatting
, getTex... | jgm/citeproc | src/Citeproc/Element.hs | bsd-2-clause | 9,597 | 0 | 16 | 3,198 | 2,472 | 1,202 | 1,270 | 212 | 24 |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE Rank2Types #-}
module Data.Conduit.Cereal.Internal
( ConduitErrorHandler
, SinkErrorHandler
, SinkTerminationHandler
, mkConduitGet
, mkSinkGet
) where
import Control.Monad (forever, when)
import qualified Data.ByteString as BS
import qualified Data.Cond... | litherum/cereal-conduit | Data/Conduit/Cereal/Internal.hs | bsd-2-clause | 2,746 | 0 | 18 | 866 | 825 | 411 | 414 | 50 | 4 |
-- | Provides functionality of rendering the application model.
module Renderer
( Descriptor
, initialize
, terminate
, render
) where
import Foreign.Marshal.Array
import Foreign.Ptr
import Foreign.Storable
import Graphics.Rendering.OpenGL
import Linear
import System.IO
import qualified Applicati... | fujiyan/toriaezuzakki | haskell/glfw/keyboard/Renderer.hs | bsd-2-clause | 5,260 | 0 | 15 | 1,277 | 1,300 | 661 | 639 | 120 | 1 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QStyleOptionMenuItem.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:36
Warning : this file is machine generat... | uduki/hsQt | Qtc/Enums/Gui/QStyleOptionMenuItem.hs | bsd-2-clause | 8,527 | 0 | 18 | 1,837 | 2,231 | 1,099 | 1,132 | 198 | 1 |
module Import
( module Prelude
, module Yesod
, module Foundation
, module Settings.StaticFiles
, module Data.Monoid
, module Control.Applicative
, Text
#if __GLASGOW_HASKELL__ < 740
, (<>)
#endif
) where
import Prelude hiding (writeFile, readFile, head, tail, init, last)
import Yes... | LambdaLuminaries/illum | Import.hs | bsd-2-clause | 614 | 0 | 7 | 123 | 175 | 118 | 57 | 19 | 1 |
{-# LANGUAGE Safe #-}
{-# LANGUAGE UnicodeSyntax #-}
module Shake.It.FileSystem.Dir
( removeDirIfExists
, copyDir
) where
import Control.Exception
import Control.Monad (forM_)
import Prelude hiding (catch)
import System.Directory
import ... | Heather/Shake.it.off | src/Shake/It/FileSystem/Dir.hs | bsd-3-clause | 1,145 | 0 | 14 | 366 | 283 | 151 | 132 | 29 | 2 |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
module Duckling.Volume.CA.R... | facebookincubator/duckling | Duckling/Volume/CA/Rules.hs | bsd-3-clause | 1,784 | 0 | 19 | 474 | 451 | 270 | 181 | 45 | 2 |
{-# LANGUAGE PatternSynonyms #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.ARB.TextureBorderClamp
-- Copyright : (c) Sven Panne 2019
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Porta... | haskell-opengl/OpenGLRaw | src/Graphics/GL/ARB/TextureBorderClamp.hs | bsd-3-clause | 674 | 0 | 5 | 91 | 47 | 36 | 11 | 7 | 0 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
import Data.Char (digitToInt)
import Data.List
import Prelude hiding (drop)
newtype K = K Integer deriving (Show, Enum, Num, Eq)
newtype ValueConsumed = ValueConsumed Integer deriving (Show, Enum, Num, Eq, Ord)
data InfStr = InfStr String K ValueConsumed deriving (Show)
_... | stulli/projectEuler | eu238_old.hs | bsd-3-clause | 4,624 | 0 | 19 | 1,296 | 1,484 | 794 | 690 | 88 | 1 |
module Main where
import Test.HUnit
import System.Exit
import System.Directory
import qualified System.FilePath as FilePath
import BrownPLT.JavaScript.Parser
import BrownPLT.JavaScript.PrettyPrint
import BrownPLT.JavaScript.Syntax
testDir = "tests/parse-pretty"
parsePrettyTest filename = TestLabel filename $ TestCas... | brownplt/webbits | src/UnitTest.hs | bsd-3-clause | 1,041 | 0 | 16 | 194 | 296 | 147 | 149 | 27 | 2 |
import Test.Tasty
import Test.Tasty.QuickCheck -- for property testing
import Test.Tasty.HUnit -- for case testing
import ANN.Simple
--------------------------------------------------------------------------------
main :: IO ()
main = defaultMain tests
tests :: TestTree
tests = testGroup "Tests" [propertyTests, uni... | prince-aly/MLcyberSquad | test/Tests.hs | bsd-3-clause | 997 | 0 | 6 | 115 | 139 | 80 | 59 | 18 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE Trustworthy #-}
#include "lens-common.h"
{-# OPTIONS_GHC -fno-warn-orphans #-}
-------------------------------------... | ddssff/lens | src/Control/Lens/Fold.hs | bsd-3-clause | 101,174 | 0 | 17 | 23,476 | 12,481 | 7,444 | 5,037 | -1 | -1 |
{-# language CPP #-}
-- | = Name
--
-- VK_EXT_fragment_shader_interlock - device extension
--
-- == VK_EXT_fragment_shader_interlock
--
-- [__Name String__]
-- @VK_EXT_fragment_shader_interlock@
--
-- [__Extension Type__]
-- Device extension
--
-- [__Registered Extension Number__]
-- 252
--
-- [__Revision__... | expipiplus1/vulkan | src/Vulkan/Extensions/VK_EXT_fragment_shader_interlock.hs | bsd-3-clause | 10,854 | 0 | 14 | 1,638 | 1,235 | 763 | 472 | -1 | -1 |
{-# LANGUAGE PatternSynonyms #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.NV.HalfFloat
-- Copyright : (c) Sven Panne 2019
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability : ... | haskell-opengl/OpenGLRaw | src/Graphics/GL/NV/HalfFloat.hs | bsd-3-clause | 1,606 | 0 | 5 | 236 | 192 | 133 | 59 | 54 | 0 |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
module Duckling.Numeral.UK.Rules
( rules
) where
... | facebookincubator/duckling | Duckling/Numeral/UK/Rules.hs | bsd-3-clause | 7,868 | 0 | 18 | 2,059 | 1,987 | 1,145 | 842 | 205 | 8 |
{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
\section[RnNames]{Extracting imported and top-level names in scope}
-}
{-# LANGUAGE CPP, NondecreasingIndentation #-}
module RnNames (
rnImports, getLocalNonValBinders, newRecordSelector,
rnExports, extendGlobalRdrEnvRn,
gresFromAva... | vikraman/ghc | compiler/rename/RnNames.hs | bsd-3-clause | 88,632 | 14 | 30 | 27,977 | 16,569 | 8,574 | 7,995 | -1 | -1 |
{-|
Copyright : (c) Dave Laing, 2017
License : BSD3
Maintainer : dave.laing.80@gmail.com
Stability : experimental
Portability : non-portable
-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
module Fragment.SystemF (
module... | dalaing/type-systems | src/Fragment/SystemF.hs | bsd-3-clause | 1,627 | 0 | 8 | 281 | 405 | 235 | 170 | -1 | -1 |
{-# LANGUAGE UnicodeSyntax #-}
module Util where
import Semantics (Term(..), Context, Binding)
printtm ∷ Context → Term → IO ()
printtm ctx (TmVar n) = if length ctx == n
then case (indexToName ctx n) of
Just s → putStrLn s
... | ayberkt/TAPL | src/Untyped/Util.hs | bsd-3-clause | 2,226 | 10 | 11 | 1,183 | 492 | 260 | 232 | 41 | 3 |
{-# LANGUAGE TypeFamilies, PackageImports #-}
module Main (main) where
import Control.Applicative ((<$>), (<*>))
import Control.Monad (forever)
import Control.Concurrent (forkIO)
import Data.Ratio (numerator)
import Data.Time (UTCTime(..), getCurrentTime, toModifiedJulianDay)
import Data.HandleLike (HandleLike(..))
i... | YoshikuniJujo/forest | subprojects/tls-analysis/server/makeTestFiles.hs | bsd-3-clause | 2,297 | 10 | 14 | 385 | 883 | 481 | 402 | 58 | 2 |
{-# LANGUAGE CPP #-}
module Main where
import Data.Typeable
import Tct.Core
import qualified Tct.Core.Common.Parser as P
import qualified Tct.Core.Common.Pretty as PP
import qualified Tct.Core.Data as T
import Tct.Core.Interactive
import Tct.Trs.Data... | ComputationWithBoundedResources/tct-config-mischel | tct-trs.hs | bsd-3-clause | 1,787 | 0 | 10 | 449 | 342 | 219 | 123 | 38 | 2 |
{-# LANGUAGE PatternSynonyms #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.NV.TransformFeedback2
-- Copyright : (c) Sven Panne 2019
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portab... | haskell-opengl/OpenGLRaw | src/Graphics/GL/NV/TransformFeedback2.hs | bsd-3-clause | 1,068 | 0 | 5 | 131 | 90 | 64 | 26 | 18 | 0 |
{-# LANGUAGE EmptyDataDecls, TypeSynonymInstances #-}
{-# OPTIONS_GHC -fcontext-stack43 #-}
module Games.Chaos2010.Database.Board_highlights where
import Games.Chaos2010.Database.Fields
import Database.HaskellDB.DBLayout
type Board_highlights =
Record
(HCons (LVPair X (Expr (Maybe Int)))
(HCons... | JakeWheat/Chaos-2010 | Games/Chaos2010/Database/Board_highlights.hs | bsd-3-clause | 509 | 0 | 17 | 86 | 132 | 72 | 60 | 12 | 1 |
class AAM aam where
type Time (aam :: *) :: *
type Addr (aam :: *) :: *
tzero :: aam -> Time aam
tick :: aam -> Call -> Time aam -> Time aam
alloc :: aam -> Name -> Time aam -> Addr aam
type Env aam = Map Name (Addr aam)
type Store aam = Map (Addr aam) (Val aam)
data Val aam = LitV Lit | Clo [Name] Call (Env... | davdar/quals | writeup-old/sections/03AAMByExample/02AbstractStateSpace/01AAM.hs | bsd-3-clause | 391 | 2 | 10 | 98 | 211 | 107 | 104 | -1 | -1 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
module Main(main) where
import Dirs(FunName, funHash, listAllFuns)
import Predicates(funLevelPreds, lpredCalls)
import StorageBackend(localStorage, Readable, noStorage, disableWrite)
import SiteState
import qualified Dat... | GaloisInc/verification-game | web-prover/exes/ComputeCallGraph.hs | bsd-3-clause | 3,235 | 0 | 20 | 998 | 1,039 | 543 | 496 | -1 | -1 |
module Anatomy.Parser.Base where
import Control.Monad.Identity
import Text.Parsec
import Atomo.Types (ParserState)
import Atomo.Lexer.Base (TaggedToken)
import Anatomy.Types
type Parser = ParsecT [TaggedAToken] ParserState Identity
withToken :: (AToken -> Maybe a) -> Parser a
withToken f =
-- TODO: showATok... | vito/atomo-anatomy | src/Anatomy/Parser/Base.hs | bsd-3-clause | 1,217 | 0 | 11 | 327 | 451 | 243 | 208 | 40 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
import Data.Aeson (decode, encode, parseJSON, toJSON)
import Data.Maybe (fromJust)
import Data.Yaml (decodeFile)
import Kubernetes.KubeConfig (AuthInfo (..), Cluster (..),... | denibertovic/haskell | kubeconfig/test/Spec.hs | bsd-3-clause | 1,221 | 0 | 21 | 372 | 311 | 157 | 154 | 25 | 1 |
{-# LANGUAGE PatternGuards #-}
module Idris.Delaborate (bugaddr, delab, delab', delabMV, delabTy, delabTy', pshow, pprintErr) where
-- Convert core TT back into high level syntax, primarily for display
-- purposes.
import Util.Pretty
import Idris.AbsSyntax
import Idris.Core.TT
import Idris.Core.Evaluate
import Idri... | ctford/Idris-Elba-dev | src/Idris/Delaborate.hs | bsd-3-clause | 10,915 | 0 | 18 | 3,231 | 4,705 | 2,308 | 2,397 | 208 | 31 |
module Sound.Synthesis.Constant
( τ
, ƒ0
, ƒNyquist
) where
τ :: Double -> Double
τ = 2 * pi
ƒ0 :: Double
ƒ0 = 44100
ƒNyquist :: Double
ƒNyquist = ƒ0 / 2
| pskrz/Synthesis | src/Sound/Synthesis/Constant.hs | bsd-3-clause | 179 | 0 | 5 | 49 | 60 | 36 | 24 | 10 | 1 |
module Cardano.Wallet.Kernel.DB.BlockContext (
-- * Block context
BlockContext(..)
, blockContextSucceeds
-- ** Lenses
, bcSlotId
, bcHash
, bcPrevMain
-- * Construction
, mainBlockContext
) where
import Universum
import Control.Lens (lazy, makeLenses, strict)
import ... | input-output-hk/pos-haskell-prototype | wallet/src/Cardano/Wallet/Kernel/DB/BlockContext.hs | mit | 3,365 | 0 | 14 | 726 | 529 | 306 | 223 | -1 | -1 |
module MyLines where
firstSen = "Tyger, Tyger, burning bright\n"
secondSen = "In the forests of the night\n"
thirdSen = "What immortal hand or eye\n"
fourthSen = "Could frame thy fearful\
\ symmetry?"
sentences = firstSen ++ secondSen
++ thirdSen ++ fourthSen
myLines :: String -> [String]
myLines... | brodyberg/Notes | ProjectRosalind.hsproj/LearnHaskell/lib/HaskellBook/MyLinesChapter9.hs | mit | 1,108 | 0 | 15 | 363 | 325 | 172 | 153 | 33 | 2 |
{-# LANGUAGE FlexibleContexts #-}
module Propellor.Property.Postfix where
import Propellor
import qualified Propellor.Property.Apt as Apt
import qualified Propellor.Property.File as File
import qualified Propellor.Property.Service as Service
import qualified Propellor.Property.User as User
import qualified Data.Map ... | avengerpenguin/propellor | src/Propellor/Property/Postfix.hs | bsd-2-clause | 5,063 | 74 | 16 | 927 | 1,371 | 755 | 616 | 97 | 4 |
module HCP.Topup
( nodif_brain_mask
, outprefix
, fieldcoef
, movpar_txt
, rules
) where
import Development.Shake
import Development.Shake.FilePath
import FSL (extractVol_, getDim4)
import qualified HCP.Preprocessing as Preprocessing
import ... | pnlbwh/test-tensormasking | pipeline-lib/Pipeline/HCP/old/Topup.hs | bsd-3-clause | 2,144 | 0 | 20 | 696 | 486 | 268 | 218 | 62 | 1 |
{-# LANGUAGE OverloadedStrings #-}
-- |
-- Module : Language.Ava.Base.Parser
-- Copyright : (c) 2016 Owain Lewis
--
-- License : BSD-style
-- Maintainer : owain@owainlewis.com
-- Stability : experimental
-- Portability : GHC
--
--
module Language.Ava.Base.Parser
( parseInteger
, parseDouble
, parse... | owainlewis/seven | src/Language/Ava/Base/Parser.hs | bsd-3-clause | 2,647 | 0 | 11 | 407 | 733 | 390 | 343 | 61 | 1 |
{-# LANGUAGE StaticPointers #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveDataTypeable #-}
module Main where
import GHC.StaticPtr
import GHC.Word
import GHC.Generics
import Data.Data
import Data.Binary
import Data.ByteString
fact :: Int -> Int
fact 0 = 1
fact n = n * fact (n - 1)
main = do
let sptr :: Sta... | mpickering/ghc-exactprint | tests/examples/ghc710/StaticPointers.hs | bsd-3-clause | 736 | 0 | 12 | 126 | 181 | 98 | 83 | 23 | 1 |
-- | Display game data on the screen using one of the available frontends
-- (determined at compile time with cabal flags).
module Game.LambdaHack.Client.UI.DrawClient
( ColorMode(..)
, draw
) where
import Control.Exception.Assert.Sugar
import qualified Data.EnumMap.Strict as EM
import qualified Data.EnumSet as ... | Concomitant/LambdaHack | Game/LambdaHack/Client/UI/DrawClient.hs | bsd-3-clause | 18,861 | 0 | 32 | 6,432 | 5,270 | 2,735 | 2,535 | -1 | -1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ViewPatterns #-}
module Optical.Patterns
( -- * Points
pattern P0
, pattern P1
, pattern P2
, pattern P3
, pattern P4
#if __GLASGOW_HASKELL__ >= 709
-- Numbers
, pattern NaN
, pattern Infinity
#endif
) where
import Linear.Affi... | cchalmers/optical | src/Optical/Patterns.hs | bsd-3-clause | 1,044 | 0 | 10 | 251 | 359 | 191 | 168 | 22 | 0 |
module Main where
import Types
import Instances
main :: IO ()
main = return ()
| mkloczko/derive-storable-plugin | test/ids/TypeSynonym/Main.hs | mit | 81 | 0 | 6 | 17 | 30 | 17 | 13 | 5 | 1 |
--
-- Copyright (c) 2011 Citrix Systems, Inc.
--
-- This program 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 Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This progra... | jean-edouard/manager | upgrade-db/Migrations/M_8.hs | gpl-2.0 | 1,799 | 0 | 11 | 485 | 270 | 146 | 124 | 25 | 4 |
{-# LANGUAGE ImportQualifiedPost #-}
-- If 'ImportQualifiedPost' is enabled 'qualified' can appear in
-- postpositive position.
import Prelude qualified
main = Prelude.undefined
| sdiehl/ghc | testsuite/tests/module/mod181.hs | bsd-3-clause | 181 | 1 | 5 | 25 | 20 | 10 | 10 | -1 | -1 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
import AppCache
import Routes
import Yesod.Core
instance Yesod App
mkYesodDispatch "App" resourcesApp
getHomeR :: Handler String
ge... | ygale/yesod | demo/appcache/Main.hs | mit | 518 | 3 | 7 | 122 | 120 | 54 | 66 | 17 | 1 |
module Main(main) where
import Memo1
testMemo = do
let keys = [ [1..n] | n <- [1..1000] ]
keys2 = [ [n,n-1..1] | n <- [1..1000] ]
mlength = memo length
putStr (show (map mlength (keys ++ keys ++ keys2 ++ keys2)))
putStr (show (mlength [1..100000]))
-- mlength will memoize itself over each elem... | beni55/ghcjs | test/pkg/base/memo001.hs | mit | 636 | 0 | 15 | 141 | 157 | 87 | 70 | 9 | 1 |
module H1.H1
(main) where
last' :: [a] -> a
last' [] = error "no last element for empty"
last' (x: []) = x
last' (x:xs) = last' xs
lastbutone :: [a] -> a
lastbutone [] = error "no next-to-last for empty"
lastbutone [x] = error "no next-to-last for singleton"
lastbutone (x:[y]) = x
lastbutone (x:xs) = lastbutone xs
n... | ublubu/euler | H1/H1.hs | mit | 810 | 0 | 8 | 196 | 470 | 240 | 230 | 33 | 1 |
module Codec.Binary.Base64 (encode) where
import Control.Applicative
import Control.Monad
import qualified Data.Binary.Get as BY
import qualified Data.Binary.Bits.Get as BI
import Data.Bits (shiftL)
import qualified Data.ByteString.Lazy as BL
import Data.Monoid ((<>))
import Data.Word
encode :: BL.ByteString -> BL.By... | begriffs/lancelot | src/Codec/Binary/Base64.hs | mit | 1,277 | 0 | 18 | 349 | 529 | 279 | 250 | 33 | 1 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE AutoDeriveTypeable #-}
{-# LANGUAGE DeriveDataTypeable #-}
-- There are lots of pattern synpnyms, and little would be gained by adding
-- the ... | gibiansky/IHaskell | ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Layout/Common.hs | mit | 2,934 | 0 | 6 | 355 | 598 | 338 | 260 | 57 | 1 |
module Rebase.Data.Sequence
(
module Data.Sequence
)
where
import Data.Sequence
| nikita-volkov/rebase | library/Rebase/Data/Sequence.hs | mit | 83 | 0 | 5 | 12 | 20 | 13 | 7 | 4 | 0 |
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, RankNTypes #-}
module Jatek.Interact where
import Control.Lens
import Control.Arrow (first, second)
import Control.Monad (ap, liftM)
import Control.Monad.State.Strict
import System.IO (hFlush, stdout)
import System.Random
import Jatek.Actor
-- InteractT is a mo... | michaelochurch/jatek | Jatek/Interact.hs | mit | 4,024 | 0 | 17 | 1,029 | 1,494 | 789 | 705 | 66 | 4 |
module GosperSpec where
import Test.Hspec
import Gosper
spec :: Spec
spec = do
describe "getList" $ do
it "normal" $ do
(take 10 $ getList 1) `shouldBe` [1,2,4,8,16,32,64,128,256,512]
it "error" $ do
getList 0 `shouldBe` []
main :: IO()
main = do
hspec spec
| czchen/haskell-gosper | test/GosperSpec.hs | mit | 311 | 0 | 16 | 97 | 139 | 74 | 65 | 13 | 1 |
module Data.Mole.Core where
import Control.Concurrent
import Control.Concurrent.STM
import Control.Monad
import Control.Monad.Trans.Maybe
import Data.Map (Map)
import qualified Data.Map as M
import Data.Set (Set)
import qualified Data.Set as S
import ... | wereHamster/mole | src/Data/Mole/Core.hs | mit | 10,804 | 0 | 28 | 3,418 | 2,993 | 1,476 | 1,517 | 178 | 6 |
{-# LANGUAGE DataKinds, ConstraintKinds, KindSignatures, GADTs #-}
{-# LANGUAGE FlexibleInstances, FlexibleContexts, MultiParamTypeClasses #-}
{-# LANGUAGE UndecidableInstances, ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
module Control.OperationalTransformation.Properties
( ArbitraryFor (..)
-- , ... | Operational-Transformation/ot.hs | src/Control/OperationalTransformation/Properties.hs | mit | 7,823 | 0 | 22 | 1,569 | 2,397 | 1,242 | 1,155 | 143 | 2 |
{-# htermination (\\) :: Eq a => [[a]] -> [[a]] -> [[a]] #-}
import List
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/List_BACKSLBACKSL_4.hs | mit | 73 | 0 | 3 | 15 | 5 | 3 | 2 | 1 | 0 |
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.Urho3D.Graphics.RenderSurface(
RenderSurface
, renderSurfaceContext
) where
import qualified Language.C.Inline as C
import qualified Language.C.Inline.Cpp as C
import Graphics.Urho3D.Graphics.Internal.RenderSurface
import Data.Monoid
C.context (C.cppCtx <... | Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/Graphics/RenderSurface.hs | mit | 491 | 0 | 8 | 53 | 94 | 57 | 37 | -1 | -1 |
{- | Automatic generators for ADTs.
-
- Cf. A PropEr Integration of Types and Function Specifications with PBT,
- by Manolis Papadakis and Konstantinos Sagonas.
-
- Naming conventions:
- - @v@, variables; @c@: constructors; (value level)
- - @tc@, type constructors; @tv@: type variables;
- - @funNameS@, action ... | QuickChick/Luck | luck/src/Core/Rigidify/Generator.hs | mit | 15,317 | 0 | 23 | 3,574 | 5,582 | 2,902 | 2,680 | -1 | -1 |
{-# LANGUAGE CPP, NoImplicitPrelude #-}
#if __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Safe #-}
#endif
module Data.Tuple.Compat
( fst
, snd
, curry
, uncurry
, swap
#if MIN_VERSION_ghc_prim(0,7,0)
, Solo(..)
#endif
) where
import Data.Tuple
#if !(MIN_VERSION_base(4,16,0)) && MIN_VERSION_ghc_prim(0,7,0)
imp... | haskell-compat/base-compat | base-compat/src/Data/Tuple/Compat.hs | mit | 352 | 0 | 6 | 59 | 58 | 41 | 17 | 8 | 0 |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances, FlexibleContexts #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
--{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE TypeOperators, DataKinds, KindSignatures, PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUA... | vladfi1/hs-misc | GrammarOld.hs | mit | 3,236 | 0 | 11 | 710 | 1,196 | 640 | 556 | 78 | 1 |
-----------------------------------------------------------------------------
--
-- Module : Language.PureScript.AST.Binders
-- Copyright : (c) 2013-14 Phil Freeman, (c) 2014 Gary Burgess, and other contributors
-- License : MIT
--
-- Maintainer : Phil Freeman <paf31@cantab.net>
-- Stability : experi... | michaelficarra/purescript | src/Language/PureScript/AST/Binders.hs | mit | 2,312 | 0 | 9 | 492 | 439 | 264 | 175 | 30 | 8 |
module EmailConfig where
data Configuration = Configuration {
host :: String,
port :: Maybe Int,
username :: String,
password :: String
} deriving (Show, Read)
-- conf :: Configuration
-- conf = Configuration "smtp.gmail.com" Nothing "user.name@gmail.com" "password"
-- saveConfig :: IO ()
... | Radivarig/EmailNotifications | src/EmailConfig.hs | mit | 505 | 0 | 10 | 107 | 99 | 55 | 44 | 12 | 1 |
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE EmptyDataDeriving #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE UndecidableSuperClasses #-}
{-# L... | zenhack/haskell-capnp | gen/lib/Capnp/Gen/Capnp/Persistent/New.hs | mit | 20,493 | 122 | 18 | 3,385 | 3,726 | 2,363 | 1,363 | -1 | -1 |
module Main where
import Types
cooperateF _ = return Cooperate
cooperate :: Strategy
cooperate = S ("cooperate", cooperateF)
main = dilemmaMain cooperate | barkmadley/etd-retreat-2014-hteam | src/Cooperate/Main.hs | mit | 157 | 0 | 6 | 25 | 45 | 25 | 20 | 6 | 1 |
-- |
-- Module : Crypto.Noise.Internal
-- Copyright : (c) Austin Seipp 2014
-- License : MIT
--
-- Maintainer : aseipp@pobox.com
-- Stability : unstable
-- Portability : portable
--
-- Noise internal module.
--
module Crypto.Noise.Internal where
import Data.Bits
import Data.Monoid
impo... | thoughtpolice/hs-noise | src/Crypto/Noise/Internal.hs | mit | 9,161 | 0 | 19 | 2,681 | 2,653 | 1,380 | 1,273 | 203 | 3 |
module Fib where
-- https://www.codewars.com/kata/fibonacci
fib :: Int -> Int
fib 0 = 0
fib 1 = 1
fib n = (fib $ n - 1) + (fib $ n - 2) | cojoj/Codewars | Haskell/Codewars.hsproj/Fib.hs | mit | 141 | 0 | 8 | 37 | 64 | 35 | 29 | 5 | 1 |
import Fasta (splitStr, formTuple, removeRosalind)
import Data.List
import Data.Function
lcstr xs ys = maximumBy (compare `on` length) . concat $ [f xs' ys | xs' <- tails xs] ++ [f xs ys' | ys' <- drop 1 $ tails ys]
where f xs ys = scanl g [] $ zip xs ys
g z (x, y) = if x == y then z ++ [x] else []
commonS... | forgit/Rosalind | lcsm.hs | gpl-2.0 | 941 | 0 | 11 | 273 | 503 | 257 | 246 | 25 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module IntegrationSpec (main, spec) where
import Test.Hspec
import Test.QuickCheck
import Prelude as P
import Data.Torrent
import Data.Maybe
import Data.Text as T
import Data.ByteString as BS
import Data.ByteString.Lazy as BSL
import System.FilePath.Posix
import Crypto.Random.AESCtr... | danoctavian/bit-smuggler | BitSmuggler/test/integration/IntegrationSpec.hs | gpl-2.0 | 9,256 | 0 | 15 | 1,958 | 2,419 | 1,283 | 1,136 | 195 | 2 |
{-|
Module: Utils
Description: Utility functions.
Copyright: (c) Taran Lynn, 2015
License: GPL-2
This module contains utility functions not tied to the other modules.
-}
module Utils where
-- | Tries to read a value from a string.
maybeRead :: Read a => String -> Maybe a
maybeRead str = case reads str of
... | lambda-11235/funcmap | src/Utils.hs | gpl-2.0 | 376 | 0 | 9 | 99 | 64 | 34 | 30 | 5 | 2 |
{-# LANGUAGE NoImplicitPrelude, TemplateHaskellQuotes, OverloadedStrings, PostfixOperators #-}
{-# LANGUAGE NoMonomorphismRestriction, FlexibleContexts #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-partial-type-signatures #-}
{-# OPTIONS_GHC -O0 -fno-cse -fno-full-laziness #-} -- preserve "lexical" sharin... | sboosali/commands-spiros | config/Commands/Plugins/Spiros/Language/Haskell.hs | gpl-2.0 | 1,026 | 0 | 5 | 119 | 82 | 56 | 26 | 13 | 1 |
module StringPrimitives (
charPrimitives,
strPrimitives
) where
import IError
import LispVal
import Primitives
import Control.Monad.Error
import Data.Char
charPrimitives :: [(String, [LispVal] -> ThrowsLispError LispVal)]
charPrimitives =
[("char?", isChar),
("char=?", charBoolBinop (==)),
("char<?", charBool... | mhrheaume/hskme | StringPrimitives.hs | gpl-2.0 | 3,286 | 38 | 11 | 526 | 1,278 | 671 | 607 | 77 | 2 |
module H9
(pack
) where
packWith :: (Eq a) => [a] -> [a] -> [[a]]
packWith [] acc = [acc]
packWith (x:xs) [] = packWith xs [x]
packWith (x:xs) acc = if x == head acc then packWith xs (x:acc)
else acc : packWith xs [x]
pack :: (Eq a) => [a] -> [[a]]
pack [] = []
pack xs = packWith xs []
| hsinhuang/codebase | h99/H9.hs | gpl-2.0 | 313 | 0 | 9 | 90 | 195 | 106 | 89 | 10 | 2 |
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, OverloadedStrings #-}
module Sound.Tidal.UI where
{-
UI.hs - Tidal's main 'user interface' functions, for transforming
patterns, building on the Core ones.
Copyright (C) 2020, Alex McLean and contributors
This library is free software: you can red... | bgold-cosmos/Tidal | src/Sound/Tidal/UI.hs | gpl-3.0 | 79,026 | 0 | 26 | 18,836 | 20,336 | 10,351 | 9,985 | -1 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.