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 DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Kubernetes.V1.PersistentVolume where
import GHC.Generics
import Data.Text
import Kubernetes.V1.ObjectMeta
import Kubernetes.V1.PersistentVolume... | minhdoboi/deprecated-openshift-haskell-api | kubernetes/lib/Kubernetes/V1/PersistentVolume.hs | apache-2.0 | 2,004 | 0 | 9 | 243 | 141 | 86 | 55 | 21 | 0 |
module EdictDB where
import System.IO
import qualified Data.Text as DT
import Data.Text.Encoding
import qualified Data.ByteString.Char8 as C
type Word = (String, Char)
dbLookup :: String -> Maybe Word
dbLookup = undefined
returnLine :: IO String -> String
returnLine = undefined
getDict :: IO String
getDict = do
... | MarkMcCaskey/Refcon | EdictDB.hs | apache-2.0 | 468 | 0 | 12 | 92 | 157 | 83 | 74 | 18 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Store (Id, Url, FileType, genId, genPut, put, get) where
import Control.Monad.Trans.AWS
(sinkBody, runResourceT, runAWST, send, presignURL, newEnv
,Env, Seconds, toBody, RqBody, Region(..), Credentials(..))
import Network.AWS.S3
(getObje... | svanderbleek/media-server | src/Store.hs | bsd-3-clause | 2,245 | 0 | 14 | 437 | 797 | 441 | 356 | 75 | 1 |
-- |Type aliases used throughout the crypto-api modules.
module Crypto.Types where
import Data.ByteString as B
import Data.ByteString.Lazy as L
-- |The length of a field (usually a ByteString) in bits
type BitLength = Int
-- |The length fo a field in bytes.
type ByteLength = Int
| ekmett/crypto-api | Crypto/Types.hs | bsd-3-clause | 283 | 0 | 4 | 49 | 36 | 26 | 10 | 5 | 0 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Web.RTBBidder.Types.Request.Video (Video(..)) where
import qualified Data.Aeson as AESON
import Data.Aeson ((.=), (.:), (.:?), (.!=))
import qualified Data.Text as TX
import Web.RTBBidder.Types.Request.Banner (Banner(..))
data Video = Video
... | hiratara/hs-rtb-bidder | src/Web/RTBBidder/Types/Request/Video.hs | bsd-3-clause | 3,366 | 0 | 12 | 743 | 948 | 517 | 431 | 95 | 0 |
{-
(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, substTyVar, extendTvSubst,... | sgillespie/ghc | compiler/simplCore/Simplify.hs | bsd-3-clause | 124,418 | 20 | 25 | 38,197 | 15,479 | 8,190 | 7,289 | -1 | -1 |
module Bot where
import Args
import Control.Applicative.Trans.Either
import Control.Concurrent.WriteSem
import Control.Concurrent
import Control.Concurrent.Async
import Control.Exception (catchJust)
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import Control.Monad.Trans.Reader
i... | intolerable/intolerable-bot | src/Bot.hs | bsd-3-clause | 10,673 | 0 | 33 | 2,908 | 3,751 | 1,873 | 1,878 | -1 | -1 |
{-# LANGUAGE RecordWildCards #-}
module Task where
import Text.Printf
import Simulation.Aivika
import Data.Functor
data System = System {
processingDistribution :: (String, Parameter Double)
, bufferCapacity :: Int
}
data Input = Input {
generationDistribution :: (String, Parameter Double)
, inputSystem... | NCrashed/bmstu-aivika-tutorial-01 | src/Task.hs | bsd-3-clause | 3,365 | 0 | 11 | 596 | 695 | 391 | 304 | 55 | 1 |
import System.Environment (getArgs)
import Data.List.Split (splitOn)
import Data.Bits (testBit)
compareBits :: [Int] -> String
compareBits [i, a, b] | testBit i (a - 1) == testBit i (b - 1) = "true"
| otherwise = "false"
main :: IO ()
main = do
[inpFile]... | nikai3d/ce-challenges | easy/position.hs | bsd-3-clause | 442 | 0 | 13 | 139 | 177 | 90 | 87 | 11 | 1 |
{-# LANGUAGE CPP, DeriveDataTypeable, DeriveFunctor #-}
{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
{-# LANGUAGE PatternGuards, ScopedTypeVariables #-}
{-# LANGUAGE RecordWildCards, TemplateHaskell #-}
{- |
Module: Database.PostgreSQL.Simple.FromField
Copyright: (c) 2011 MailRank, Inc.... | avieth/postgresql-simple | src/Database/PostgreSQL/Simple/FromField.hs | bsd-3-clause | 24,587 | 0 | 18 | 6,421 | 4,850 | 2,561 | 2,289 | 351 | 4 |
{-
Copyright (c) 2004, Philippa Jane Cowderoy
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 of conditions ... | nh2/flippi | src/RecentChanges.hs | bsd-3-clause | 4,025 | 0 | 22 | 2,068 | 390 | 200 | 190 | 43 | 6 |
module Main (main) where
import System.Environment (getArgs)
import Language.Java.Paragon.Error
import Language.Java.Paragon.Interaction.Flags
import Language.Java.Paragon.Parac
-- | Main method, invokes the compiler
main :: IO ()
main = do
(flags, files) <- compilerOpts =<< getArgs
mapM_ (compileFile flags) fil... | bvdelft/paragon | src/Language/Java/Paragon.hs | bsd-3-clause | 812 | 0 | 11 | 202 | 279 | 146 | 133 | 24 | 2 |
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-|
Module : Numeric.AERN.RefinementOrder.ApproxOrder
Description : Comparisons with semidecidable order
Copyright : (c) Michal Konecny
License : BSD3
Maintainer : mikkonecny@gmail.com
Stability : experimental... | michalkonecny/aern | aern-order/src/Numeric/AERN/RefinementOrder/PartialComparison.hs | bsd-3-clause | 8,565 | 0 | 10 | 1,839 | 2,100 | 1,138 | 962 | 169 | 3 |
{-# LANGUAGE OverloadedStrings #-}
module Api
( app
) where
import Control.Applicative ((<$>))
import Control.Monad (when)
import Data.Maybe (isNothing)
import Data.Text ()
import qualified Database.Persist.Sqlite as P
import ... | fujimura/spot | src/Api.hs | bsd-3-clause | 1,675 | 0 | 16 | 600 | 544 | 264 | 280 | 44 | 3 |
{-|
Module : Idris.Erasure
Description : Utilities to erase irrelevant stuff.
Copyright :
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE PatternGuards #-}
module Idris.Erasure (performUsageAnalysis, mkFieldName) where
import Idris.AbsSyntax
import Idris.ASTUtils
import Idris.Core.CaseTre... | enolan/Idris-dev | src/Idris/Erasure.hs | bsd-3-clause | 22,527 | 0 | 21 | 6,840 | 6,621 | 3,443 | 3,178 | 304 | 50 |
{-# LANGUAGE CPP #-}
-- |Routines for integrating Tor with the standard network library.
module Tor.NetworkStack.System(systemNetworkStack) where
import Data.Binary.Put
import Data.ByteString(ByteString)
import Data.ByteString.Lazy(toStrict)
import qualified Data.ByteString as BS
import Data.Word
import Network(listen... | GaloisInc/haskell-tor | src/Tor/NetworkStack/System.hs | bsd-3-clause | 2,757 | 0 | 16 | 531 | 842 | 455 | 387 | 62 | 2 |
-----------------------------------------------------------------------------
-- |
-- Module : Data.SBV.Examples.Misc.Floating
-- Copyright : (c) Levent Erkok
-- License : BSD3
-- Maintainer : erkokl@gmail.com
-- Stability : experimental
--
-- Several examples involving IEEE-754 floating point number... | Copilot-Language/sbv-for-copilot | Data/SBV/Examples/Misc/Floating.hs | bsd-3-clause | 6,829 | 0 | 13 | 1,570 | 603 | 364 | 239 | 33 | 1 |
{-# LANGUAGE FlexibleContexts #-}
-- | @futhark c@
module Futhark.CLI.C (main) where
import Futhark.Actions (compileCAction)
import Futhark.Compiler.CLI
import Futhark.Passes (sequentialCpuPipeline)
-- | Run @futhark c@
main :: String -> [String] -> IO ()
main = compilerMain
()
[]
"Compile sequential C"
"Gen... | diku-dk/futhark | src/Futhark/CLI/C.hs | isc | 495 | 0 | 9 | 82 | 116 | 65 | 51 | 14 | 1 |
-- | ModKey type: Grouping the modifier keys with the key
{-# OPTIONS -fno-warn-orphans #-}
{-# LANGUAGE NoImplicitPrelude, DeriveGeneric #-}
module Graphics.UI.Bottle.ModKey
( ModKey(..), ctrlMods, altMods, shiftMods, superMods
, ctrl, alt, shift, super
, prettyKey
, pretty
) where
import ... | da-x/lamdu | bottlelib/Graphics/UI/Bottle/ModKey.hs | gpl-3.0 | 1,909 | 0 | 11 | 392 | 588 | 324 | 264 | 50 | 1 |
{-# LANGUAGE OverloadedStrings, FlexibleContexts #-}
module WebParsing.PostParser
(getPost) where
import Network.HTTP
import Database.PostInsertion(insertPost, insertPostCategory)
import Database.Persist.Sqlite(runSqlite, runMigration)
import Config (databasePath)
import WebParsing.ParsingHelp
import qualified Dat... | miameng/courseography | app/WebParsing/PostParser.hs | gpl-3.0 | 3,046 | 0 | 19 | 728 | 875 | 448 | 427 | 63 | 3 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Program : prim4.hs
Copyright : (c) David Harley 2010
Project : qtHaskell
Version : 1.1.4
Modified : 2010-09-02 17:02:47
Warning : this file is machine generated - do not mod... | uduki/hsQt | examples/prim4.hs | bsd-2-clause | 1,841 | 0 | 15 | 429 | 576 | 291 | 285 | 54 | 2 |
{-# LANGUAGE CPP #-}
-- | Handy functions for creating much Core syntax
module MkCore (
-- * Constructing normal syntax
mkCoreLet, mkCoreLets,
mkCoreApp, mkCoreApps, mkCoreConApps,
mkCoreLams, mkWildCase, mkIfThenElse,
mkWildValBinder, mkWildEvBinder,
sortQuantVars, cast... | TomMD/ghc | compiler/coreSyn/MkCore.hs | bsd-3-clause | 31,850 | 0 | 16 | 8,721 | 4,846 | 2,639 | 2,207 | 371 | 4 |
{-# LANGUAGE CPP, GADTs #-}
-----------------------------------------------------------------------------
--
-- Pretty-printing of Cmm as C, suitable for feeding gcc
--
-- (c) The University of Glasgow 2004-2006
--
-- Print Cmm as real C, for -fvia-C
--
-- See wiki:Commentary/Compiler/Backends/PprC
--
-- This is simpl... | AlexanderPankiv/ghc | compiler/cmm/PprC.hs | bsd-3-clause | 48,336 | 0 | 20 | 14,633 | 12,643 | 6,266 | 6,377 | 826 | 63 |
-- | Generating C symbol names emitted by the compiler.
module CPrim
( atomicReadLabel
, atomicWriteLabel
, atomicRMWLabel
, cmpxchgLabel
, popCntLabel
, bSwapLabel
, word2FloatLabel
) where
import CmmType
import CmmMachOp
import Outputable
popCntLabel :: Width -> String
popCntLabel w ... | frantisekfarka/ghc-dsi | compiler/nativeGen/CPrim.hs | bsd-3-clause | 2,263 | 0 | 9 | 564 | 613 | 309 | 304 | 63 | 10 |
--
-- Copyright (c) 2012 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... | crogers1/manager | updatemgr/UpdateMgr/Background.hs | gpl-2.0 | 2,128 | 0 | 15 | 369 | 447 | 232 | 215 | 35 | 2 |
{-
Copyright (C) 2012-2014 John MacFarlane <jgm@berkeley.edu>
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 program is ... | infotroph/pandoc | benchmark/benchmark-pandoc.hs | gpl-2.0 | 2,154 | 1 | 16 | 484 | 525 | 272 | 253 | 34 | 2 |
<?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="es-ES">
<title>Getting started Guide</title>
<maps>
<homeID>top</homeID>
<mapref locati... | thc202/zap-extensions | addOns/gettingStarted/src/main/javahelp/org/zaproxy/zap/extension/gettingStarted/resources/help_es_ES/helpset_es_ES.hs | apache-2.0 | 968 | 89 | 29 | 157 | 391 | 210 | 181 | -1 | -1 |
<?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="fil-PH">
<title>Mabilis na Pagsisimula | Ekstensyon ng ZAP</title>
<maps>
<homeID>top</homeI... | thc202/zap-extensions | addOns/quickstart/src/main/javahelp/org/zaproxy/zap/extension/quickstart/resources/help_fil_PH/helpset_fil_PH.hs | apache-2.0 | 1,001 | 87 | 29 | 163 | 406 | 216 | 190 | -1 | -1 |
{-# LANGUAGE Unsafe #-}
{-# LANGUAGE NoImplicitPrelude
, BangPatterns
, MagicHash
, UnboxedTuples
#-}
{-# OPTIONS_HADDOCK hide #-}
{-# LANGUAGE StandaloneDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.ForeignPtr
-... | ml9951/ghc | libraries/base/GHC/ForeignPtr.hs | bsd-3-clause | 19,296 | 0 | 22 | 4,236 | 3,175 | 1,678 | 1,497 | 216 | 6 |
{-# LANGUAGE Unsafe #-}
{-# LANGUAGE NoImplicitPrelude
, BangPatterns
, MagicHash
, UnboxedTuples
#-}
{-# OPTIONS_HADDOCK hide #-}
{-# LANGUAGE StandaloneDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.ForeignPtr
-... | ezyang/ghc | libraries/base/GHC/ForeignPtr.hs | bsd-3-clause | 20,344 | 0 | 22 | 4,399 | 3,244 | 1,721 | 1,523 | 219 | 6 |
{-# OPTIONS_GHC -Wall #-}
nomain :: IO ()
nomain = putStrLn used
used :: String
used = "T13839"
nonUsed :: ()
nonUsed = ()
| sdiehl/ghc | testsuite/tests/rename/should_fail/T13839b.hs | bsd-3-clause | 126 | 1 | 7 | 27 | 59 | 26 | 33 | 7 | 1 |
module Demo where
--
import Lesson01
import Lesson02
import Lesson03
import Lesson04
import Lesson05
import Lesson07
import Lesson08
import Lesson09
import Lesson10
import Lesson11
import Lesson12
import Lesson13
import Lesson14
import Lesson15
import Lesson17
import Lesson18
--
import qualified SDL
import System.Envir... | rueshyna/sdl2-examples | src/Demo.hs | mit | 1,045 | 0 | 15 | 301 | 334 | 181 | 153 | 48 | 17 |
{-# LANGUAGE DuplicateRecordFields #-}
module IR.Pure where
import Data.Word
import qualified IR.Common as C
import qualified IR.Name as Name
type Brand = C.ListBrand Name.CapnpQ
data File = File
{ fileId :: !Word64
, fileName :: FilePath
, decls :: [Decl]
, reExportEnums :: [N... | zenhack/haskell-capnp | cmd/capnpc-haskell/IR/Pure.hs | mit | 2,499 | 0 | 12 | 695 | 427 | 263 | 164 | 53 | 0 |
import Data.List
import Data.Char
include :: String -> String -> Bool
include xs ys = or . map (isPrefixOf ys) . tails $ xs
joinWith :: [String] -> String -> String
joinWith xs sep = concat . init . concat $ [[x, sep] | x <- xs]
split :: String -> Char -> [String]
split "" _ = []
split xs c = let (ys, zs) = break (=... | rkalis/monokalis-syntax | sample-files/Haskell.hs | mit | 1,200 | 1 | 14 | 316 | 537 | 263 | 274 | 25 | 2 |
{-# LANGUAGE OverloadedStrings #-}
import Network.SOAP
import Network.SOAP.Transport.HTTP
import Text.XML.Stream.Parse
import qualified Data.Text as T
import qualified Text.XML as XML
import qualified Text.XML.Writer as W
main :: IO ()
main = do
transport <- initTransport "http://www.webservicex.net/ConvertTemper... | twopoint718/hsoap-testing | Temp.hs | mit | 1,134 | 2 | 11 | 240 | 335 | 165 | 170 | 28 | 1 |
-- |
-- Module : Data.Edison.Assoc.AssocList
-- Copyright : Copyright (c) 2006, 2008 Robert Dockins
-- License : MIT; see COPYRIGHT file for terms and conditions
--
-- Maintainer : robdockins AT fastmail DOT fm
-- Stability : stable
-- Portability : GHC, Hugs (MPTC and FD)
--
-- The st... | robdockins/edison | edison-core/src/Data/Edison/Assoc/StandardMap.hs | mit | 17,103 | 0 | 11 | 5,046 | 6,928 | 3,666 | 3,262 | -1 | -1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Network.Wai.WebSockets where
import Network.Wai
import Control.Exception (Exception, throwIO, assert)
import Control.Applicative ((<$>))
import Control.Monad (when, unless)
import Data.Typeable (Typeable)
imp... | snoyberg/wai-websockets-native | Network/Wai/WebSockets.hs | mit | 7,697 | 0 | 24 | 2,265 | 2,348 | 1,181 | 1,167 | 183 | 6 |
module Sound.Source where
import Data.Monoid
-- A source takes a time 't' and returns the amplitude of the source
-- at that time. 't' is a time in seconds, representing the current
-- time where 0.0 is the start of the audio data
newtype Source = Source { sample :: Double -> Double }
instance Monoid (Source) where
... | unknownloner/HaskellSynth | src/Sound/Source.hs | mit | 1,204 | 0 | 14 | 262 | 442 | 233 | 209 | 28 | 1 |
{-# OPTIONS_GHC -Wall #-}
module HW04 where
import Data.List
newtype Poly a = P [a]
-- Exercise 1 -----------------------------------------
x :: Num a => Poly a
x = P [0, 1]
-- Exercise 2 ----------------------------------------
trimTail :: (Eq a, Num a) => [a] -> [a]
trimTail = reverse . trimHead . reverse
trim... | hanjoes/cis194 | hw4/HW04.hs | mit | 2,807 | 0 | 14 | 704 | 1,314 | 681 | 633 | 59 | 2 |
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.IDBRequest
(js_getResult, getResult, js_getError, getError, js_getSource,
getSource, js_getTransaction, getTransaction, js_getReadyState,
getReadyState, success, error, IDBRequest, castToIDB... | manyoo/ghcjs-dom | ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/IDBRequest.hs | mit | 3,705 | 30 | 11 | 536 | 858 | 491 | 367 | 58 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE RecordWildCards #-}
module Main (main) where
#if !MIN_VERSION_base(4, 8, 0)
import Data.Monoid (mempty)
#endif
import Data.Word (Word8)
import Text.Printf (printf)
import System.Random (Random(random), RandomGen, getStdGen)
import Options.Applicative
#if MIN_VERSION_optparse_applic... | NicolasT/reedsolomon | bench/profiling.hs | mit | 2,602 | 0 | 15 | 836 | 755 | 393 | 362 | 66 | 1 |
module ParserSpec (spec) where
import Test.Hspec
import Test.Hspec.Expectations.Contrib
import Language.CFrp.Parser
import Language.CFrp.Syntax
spec :: Spec
spec = do
describe "parseExprString" $ do
it "parses arithmetic" $ do
"(1 + x * 3) - _a0 / 5"
`shouldBeParsedE`
SubE
(AddE
... | psg-titech/cfrp | spec/ParserSpec.hs | mit | 3,924 | 0 | 29 | 1,506 | 1,380 | 686 | 694 | 118 | 1 |
-- TODO this parser is wonky
module Parse where
data Parser a = P {runParser :: String -> [(a, String)]}
first f (a, b) = (f a , b)
instance Functor Parser where
fmap f p = P $ map (first f) . runParser p
instance Applicative Parser where
pure = return
f <*> x = do
f <- f
x <- x
return $ f x
instanc... | kovach/cards | src/Parse.hs | mit | 4,510 | 83 | 15 | 1,082 | 2,049 | 1,075 | 974 | 141 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as BC
import Data.Time
import Data.Word
import Test.Tasty
import Test.Tasty.HUnit
-- IUT
import Data.OTP
hotpSecret :: By... | matshch/OTP | test/Test.hs | mit | 2,655 | 0 | 12 | 588 | 754 | 432 | 322 | 56 | 1 |
module Data.FacetedSpec where
import Control.Applicative
import Data.Faceted
import Test.Hspec
-- Simple Faceted Value
simple = (\x -> x > 0) ? 1 .: 0
nested = (\x -> x <= 2) ?? ((\x -> x < 2) ? 1 .: 2) .: ((\x -> x < 4 ) ? 3 .: 4)
-- do syntax test cases
ap_do = do a <- ((\x -> 0 < x && x < 3) ? 1 .: 2)
b... | everpeace/faceted-values | test/Data/FacetedSpec.hs | mit | 5,471 | 0 | 23 | 1,819 | 1,695 | 891 | 804 | 88 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
-- | This is a Haskell port of the Hashids library by Ivan Akimov.
-- This is /not/ a cryptographic hashing algorithm. Hashids is typically
-- used to encode numbers to a format suitable for appearance in places
-- like urls.
--
-- See the off... | tmcgilchrist/hashids-haskell | Web/Hashids.hs | mit | 16,507 | 0 | 19 | 4,720 | 2,984 | 1,671 | 1,313 | 237 | 4 |
module Graphics.UI.FLTK.LowLevel.FLTKHS
(
-- * Motivation
--
-- $Motivation
-- * Goals
--
-- $Goals
-- * Look And Feel
--
-- $LookAndFeel
-- * Obstacles
--
-- $Obstacles
-- * Installation #Ins... | deech/fltkhs | src/Graphics/UI/FLTK/LowLevel/FLTKHS.hs | mit | 61,697 | 0 | 5 | 10,031 | 3,849 | 3,217 | 632 | 288 | 0 |
{-# LANGUAGE DeriveGeneric, TypeSynonymInstances, TypeOperators,
FlexibleInstances, FlexibleContexts, OverlappingInstances #-}
module Network.Google.ApiIO.GenericParams where
import Control.Applicative ((<*>), (<$>), (<|>), pure)
import GHC.Generics
import Data.DList (DList, toList, empty)
import Data... | georgeee/haskell-google-apiIO | Network/Google/ApiIO/GenericParams.hs | mit | 2,402 | 0 | 11 | 584 | 766 | 408 | 358 | 51 | 1 |
-- Web API part of the code
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
module Star... | j3camero/galaxyatlas | OldCrap/haskell/server/src/StarServer.hs | mit | 3,731 | 0 | 25 | 760 | 983 | 518 | 465 | -1 | -1 |
module Doppler.Tag.Syntax (
parseTag
) where
import Doppler.Tag.Types
import Text.Parsec
import Text.Parsec.String (Parser)
import Control.Monad (void)
-- Generic tag structure parser.
parseTag :: Monoid v =>
Parser TagName ->
-- ^ Parser for tag names.
Parser k ->
... | oinuar/doppler-html | src/Doppler/Tag/Syntax.hs | mit | 2,690 | 0 | 19 | 885 | 697 | 346 | 351 | 47 | 3 |
import Data.Digest.SHA2
import qualified Data.ByteString as B
import System.IO
doManyHashes :: Int -> IO Bool
doManyHashes 0 = do
return True
doManyHashes counter = do
contents <- B.readFile "/tmp/data.0512"
-- let contentsWord8 = B.unpack contents
let hash = sha256 $ B.unpack contents
-- let oct... | adizere/nifty-tree | playground/sha2-dd.hs | mit | 486 | 0 | 12 | 117 | 112 | 58 | 54 | 12 | 1 |
{-# LANGUAGE TemplateHaskell #-}
module Language.Sampler where
import Language.Syntax
import Language.Type
import Language.Inter
import Autolib.Util.Zufall
import Autolib.Util.Wort ( alle )
import Autolib.Reader
import Autolib.ToDoc
import Autolib.Set
import Data.Typeable
import Data.List
data Sampler =
Sam... | florianpilz/autotool | src/Language/Sampler.hs | gpl-2.0 | 1,786 | 0 | 17 | 556 | 463 | 248 | 215 | 46 | 2 |
module Chap05.Exercise01 (module Chap05.Data.BatchedDeque) where
import Chap05.Data.BatchedDeque (BatchedDeque(..))
| stappit/okasaki-pfds | src/Chap05/Exercise01.hs | gpl-3.0 | 117 | 0 | 6 | 9 | 30 | 20 | 10 | 2 | 0 |
{-# LANGUAGE FlexibleInstances #-}
module Lib where
newtype Identity a = Identity a deriving (Eq, Show)
instance Functor Identity where
fmap f (Identity a) = Identity (f a)
data Pair a = Pair a a deriving (Eq, Show)
instance Functor Pair where
fmap f (Pair a b) = Pair (f a) (f b)
data Two a b = Two a b d... | nirvinm/Solving-Exercises-in-Haskell-Programming-From-First-Principles | Functor/src/Lib.hs | gpl-3.0 | 4,860 | 0 | 10 | 1,325 | 1,739 | 922 | 817 | 114 | 0 |
table cells =
do
H.h1 "Html Elements"
let elements = [H.button,(H.! A.style "background-color:blue") . H.div,H.textarea,H.h1,H.li,H.select.H.option]
let contents = map (fromString . show) [1..]
let cells = [zipWith ($) elements contents]
hTable cells H.! A.border "1"
| xpika/interpreter-haskell | Plugins/examples/Html.hs | gpl-3.0 | 284 | 1 | 14 | 51 | 139 | 70 | 69 | 7 | 1 |
factorial :: Integer -> Integer
factorial n
| n <= 1 = 1
| otherwise = n * factorial (pred n)
pascal n k
| n == k = 1
| n > k = factorial n `div` (( factorial k) * (factorial (n - k)))
| otherwise = 0
triangle k = [ line n | n <- [0..k] ]
where line n = [ pascal n k | k <- [0..n] ]
prettyOut... | icot/hackerrank | funprog/recursion/pascals-triangle.hs | gpl-3.0 | 545 | 0 | 12 | 172 | 294 | 144 | 150 | 18 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Database.Hedsql.Tests.TableManipulations
( tests
) where
--------------------------------------------------------------------------------
-- IMPORTS
--------------------------------------------------------------------------------
import Data.Monoid
import Data.Text.L... | momomimachli/Hedsql-tests | src/Database/Hedsql/Tests/TableManipulations.hs | gpl-3.0 | 11,538 | 0 | 17 | 3,123 | 1,245 | 691 | 554 | 223 | 1 |
{-# LANGUAGE FlexibleContexts #-}
module OhBool.Evaluation where
import OhBool.Common
import qualified Data.Map as M
import qualified Data.Set as S
import Control.Monad.Reader (runReader)
import Control.Monad.Reader.Class (MonadReader, ask)
import Control.Monad (liftM)
import Data.Bits ((.|.), (.&.), xor)
{-| Expres... | RomainGehrig/OhBool | src/OhBool/Evaluation.hs | gpl-3.0 | 1,903 | 0 | 14 | 328 | 689 | 362 | 327 | 43 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-games-configuration/gen/Network/Google/Resource/GamesConfiguration/AchievementConfigurations/Insert.hs | mpl-2.0 | 3,900 | 0 | 14 | 814 | 386 | 232 | 154 | 67 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-appengine/gen/Network/Google/Resource/AppEngine/Apps/AuthorizedCertificates/Get.hs | mpl-2.0 | 6,351 | 0 | 19 | 1,444 | 865 | 503 | 362 | 132 | 1 |
-- This file is part of purebred
-- Copyright (C) 2017-2019 Róman Joost and Fraser Tweedale
--
-- purebred is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at yo... | purebred-mua/purebred | src/Purebred/UI/GatherHeaders/Keybindings.hs | agpl-3.0 | 2,222 | 0 | 13 | 385 | 558 | 309 | 249 | 26 | 1 |
module Syntax_Test where
-- see: https://leiffrenzel.de/papers/getting-started-with-hunit.html
import Test.HUnit
import Syntax
-- The structure of a test case is always this:
-- 1. create some input,
-- 2. run the tested code on that input,
-- 3. make some assertions over the results.
-- 4. group them by test lists,... | dnvriend/study-category-theory | haskell/learn_a_haskell/ch4/Syntax_Test.hs | apache-2.0 | 1,040 | 0 | 8 | 192 | 172 | 95 | 77 | 15 | 1 |
module Poset.A334231Spec (main, spec) where
import Test.Hspec
import Poset.A334231 (a334231)
main :: IO ()
main = hspec spec
spec :: Spec
spec = describe "A334231" $
it "correctly computes the first 20 elements" $
map a334231 [1..20] `shouldBe` expectedValue where
expectedValue = [1,2,2,3,3,3,4,4,6,4,5,5,... | peterokagey/haskellOEIS | test/Poset/A334231Spec.hs | apache-2.0 | 339 | 0 | 8 | 57 | 154 | 92 | 62 | 10 | 1 |
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------
{-| Module : QStyleOptionTab.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 - ... | uduki/hsQt | Qtc/Enums/Gui/QStyleOptionTab.hs | bsd-2-clause | 12,522 | 0 | 18 | 2,659 | 3,235 | 1,575 | 1,660 | 279 | 1 |
-- | Settings are centralized, as much as possible, into this file. This
-- includes database connection settings, static file locations, etc.
-- In addition, you can configure a number of different aspects of Yesod
-- by overriding methods in the Yesod typeclass. That instance is
-- declared in the Foundation.hs file.... | konn/Yablog | Settings.hs | bsd-2-clause | 3,325 | 0 | 23 | 707 | 465 | 281 | 184 | -1 | -1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANG... | haskell-distributed/distributed-process-platform | src/Control/Distributed/Process/Platform/Execution/Exchange/Router.hs | bsd-3-clause | 9,019 | 0 | 17 | 2,158 | 1,720 | 940 | 780 | -1 | -1 |
{-------------------------------------------------------------------------------
DSem.VectorSpace
Vector space model interface
(c) 2013 Jan Snajder <jan.snajder@fer.hr>
-------------------------------------------------------------------------------}
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, Fle... | jsnajder/dsem | src/DSem/VectorSpace.hs | bsd-3-clause | 2,231 | 0 | 10 | 499 | 425 | 237 | 188 | 40 | 1 |
module Main where
import Multiarg.Examples.Grover
import System.Environment
main :: IO ()
main = do
as <- getArgs
putStrLn . show $ parseGrover as
| massysett/multiarg | tests/grover-main.hs | bsd-3-clause | 153 | 0 | 8 | 29 | 51 | 27 | 24 | 7 | 1 |
{-
(c) The University of Glasgow, 2004-2006
Module
~~~~~~~~~~
Simply the name of a module, represented as a FastString.
These are Uniquable, hence we can build Maps with Modules as
the keys.
-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE RecordWildCards #-}
module Module
(
-- * The ModuleName type
... | GaloisInc/halvm-ghc | compiler/basicTypes/Module.hs | bsd-3-clause | 23,424 | 0 | 19 | 5,392 | 4,025 | 2,198 | 1,827 | 321 | 2 |
module Graphics.Renderer where
import Graphics.Types
import Graphics.QuadRenderer
import Graphics.TextRenderer
import Graphics.Rendering.OpenGL
import Data.List (intercalate)
printGraphicStats :: IO ()
printGraphicStats = do
-- Display some info about opengl
... | schell/blocks | src/Graphics/Renderer.hs | bsd-3-clause | 1,351 | 0 | 12 | 503 | 277 | 141 | 136 | 32 | 1 |
-- Copyright (c) 2012, Christoph Pohl
-- BSD License (see http://www.opensource.org/licenses/BSD-3-Clause)
-------------------------------------------------------------------------------
--
-- Project Euler Problem 6
--
-- The sum of the squares of the first ten natural numbers is,
-- 1² + 2² + ... + 10² = 385
--
-- Th... | Psirus/euler | src/euler006.hs | bsd-3-clause | 856 | 0 | 8 | 157 | 93 | 59 | 34 | 6 | 1 |
{-# LANGUAGE DeriveGeneric #-}
module Package (Package(..)) where
import GHC.Generics
import qualified Data.Yaml as Yaml
import Description
data Package = Package
{ version :: String
-- , description :: Description
}
deriving (Show, Generic)
instance Yaml.FromJSON Package
| angerman/stackage2nix | src/Package.hs | bsd-3-clause | 284 | 0 | 8 | 48 | 66 | 41 | 25 | 9 | 0 |
module Data.Shapefile.Types where
| tolysz/shapefile2json | src/Data/Shapefile/Types.hs | bsd-3-clause | 35 | 0 | 3 | 4 | 7 | 5 | 2 | 1 | 0 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module Test.Golden where
import Prelude ()
import Prelude.Compat
import Control.Exception (try)
import Control.Lens ((&), (.~))
import Control.Monad.IO.Class (MonadIO)
import Data.ByteString (ByteString)
import Data.ByteString.Lazy (fromStrict)
import qu... | cdepillabout/highlight | test/Test/Golden.hs | bsd-3-clause | 10,201 | 0 | 16 | 2,157 | 2,094 | 1,092 | 1,002 | 257 | 2 |
{-# LANGUAGE OverloadedStrings #-}
import TPG.WebAPI
import TPG.Structured
import System.Directory
import System.Environment
import System.IO
import qualified Data.ByteString.Lazy as BS
import Cfg
import Control.Monad
import Control.Monad.Loops
import Data.Either
getDepartureList :: String -> [([String],[Thermometer])... | sebug/tpg_sandbox | from_to.hs | bsd-3-clause | 4,601 | 0 | 26 | 926 | 1,506 | 788 | 718 | 91 | 3 |
module Market.Board
( module Market.Board.Types
) where
import Market.Board.Types
| s9gf4ult/market | Market/Board.hs | bsd-3-clause | 97 | 0 | 5 | 24 | 21 | 14 | 7 | 3 | 0 |
{-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Language.Angler.ScopedTable
( ScopedTable, Scope
, tab_stack
-- basic
, emptyScope, emptyWithIndefinable, empty
, lookup , elem, elemInCurrentScope
, insertWith... | angler-lang/angler-lang | src/Language/Angler/ScopedTable.hs | bsd-3-clause | 4,239 | 0 | 13 | 1,053 | 1,325 | 694 | 631 | -1 | -1 |
-----------------------------------------------------------------------------
-- |
-- Module : HJScript.DOM
-- Copyright : (c) Joel Bjornson 2008
-- License : BSD-style
-- Maintainer : Joel Bjornson joel.bjornson@gmail.com
-- Niklas Broberg nibro@cs.chalmers.se
-- Stability : experimen... | seereason/HJScript | src/HJScript/DOM.hs | bsd-3-clause | 968 | 0 | 6 | 143 | 133 | 94 | 39 | 18 | 0 |
module Main where
import Control.Exception (bracket)
import Data.Time.Clock.POSIX (POSIXTime, getPOSIXTime)
import qualified Data.Map as Map
import qualified Data.Vector as Vector
import Minecraft.Anvil (ChunkX, ChunkZ, ChunkData, ChunkMap, compressChunkData, writeChunkMap)
import Minecraft.Core (BlockId(..), toNBT)
i... | stepcut/minecraft-data | utils/GenWorld.hs | bsd-3-clause | 915 | 0 | 11 | 147 | 295 | 176 | 119 | 24 | 1 |
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
--
-- Copyright © 2013-2015 Anchor Systems, Pty Ltd and Othe... | anchor/ceilometer-common | lib/Ceilometer/Client.hs | bsd-3-clause | 4,830 | 0 | 22 | 1,543 | 1,201 | 615 | 586 | 99 | 17 |
{-# LANGUAGE PatternSynonyms #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.ARB.DrawBuffers
-- Copyright : (c) Sven Panne 2019
-- License : BSD3
--
-- Maintainer : Sven Panne <svenpanne@gmail.com>
-- Stability : stable
-- Portability ... | haskell-opengl/OpenGLRaw | src/Graphics/GL/ARB/DrawBuffers.hs | bsd-3-clause | 1,214 | 0 | 5 | 165 | 137 | 91 | 46 | 25 | 0 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
-- |
-- Module : Pact.Types.Runtime
-- Copyright : (C) 2019 Stuart Popejoy
-- License : BSD-style (see the file LICENSE)
-- Mai... | kadena-io/pact | src/Pact/Types/ChainMeta.hs | bsd-3-clause | 5,386 | 0 | 19 | 962 | 1,185 | 668 | 517 | 138 | 1 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE... | input-output-hk/pos-haskell-prototype | faucet/src/Cardano/Faucet/Types/Recaptcha.hs | mit | 3,617 | 0 | 14 | 813 | 602 | 351 | 251 | -1 | -1 |
f x = y 0
where y z | z > 10 = 10
| otherwise = (10 + 20)
q = 20
p = 10
| itchyny/vim-haskell-indent | test/where/where_paren.in.hs | mit | 73 | 1 | 8 | 27 | 57 | 28 | 29 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Tests.Writers.LaTeX (tests) where
import Test.Framework
import Text.Pandoc.Builder
import Text.Pandoc
import Tests.Helpers
import Tests.Arbitrary()
latex :: (ToString a, ToPandoc a) => a -> String
latex = writeLaTeX def{ writerHighlight = True } . toPandoc
latexListing :: (T... | alexvong1995/pandoc | tests/Tests/Writers/LaTeX.hs | gpl-2.0 | 3,087 | 0 | 16 | 862 | 652 | 349 | 303 | 56 | 1 |
{-| Definition of the data collectors used by MonD.
-}
{-
Copyright (C) 2014 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyri... | dimara/ganeti | src/Ganeti/DataCollectors.hs | bsd-2-clause | 3,774 | 0 | 12 | 633 | 543 | 300 | 243 | 52 | 1 |
{-# LANGUAGE BangPatterns #-}
-- | In-place quicksort.
module QuickSort (quickSort) where
import Control.Monad
import Control.Monad.Primitive
import Control.Monad.ST
import Data.List (sort)
import Data.Vector (Vector)
import qualified Data.Vector as V (toList)
import... | QuinnSurkamer/sorting | src/Quicksort.hs | bsd-3-clause | 3,850 | 0 | 18 | 1,392 | 1,008 | 524 | 484 | 70 | 3 |
module Distribution.Solver.Modular.Explore
( backjump
, backjumpAndExplore
) where
import Data.Foldable as F
import Data.List as L (foldl')
import Data.Map as M
import Distribution.Solver.Modular.Assignment
import Distribution.Solver.Modular.Dependency
import Distribution.Solver.Modular.Log
import Distrib... | kolmodin/cabal | cabal-install/Distribution/Solver/Modular/Explore.hs | bsd-3-clause | 7,516 | 0 | 20 | 2,068 | 1,797 | 954 | 843 | 102 | 7 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# L... | kim/amazonka | amazonka-cloudfront/gen/Network/AWS/CloudFront/DeleteCloudFrontOriginAccessIdentity.hs | mpl-2.0 | 4,234 | 0 | 9 | 778 | 448 | 267 | 181 | 56 | 1 |
{- | Client inner-loop
This function is generally only needed if you are adding a new communication channel.
-}
processRemoteState :: IsAcidic st =>
IO CommChannel -- ^ (re-)connect function
-> IO (AcidState st)
processRemoteState reconnect
= do cmdQueue <- atomicall... | bitemyapp/apply-refact | tests/examples/Remote.hs | bsd-3-clause | 5,693 | 0 | 24 | 2,719 | 1,055 | 476 | 579 | 97 | 6 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE BangPatterns #-}
module Network.Wai.Handler.Warp.ResponseHeader (composeHeader) where
import Control.Monad
import Data.ByteString (ByteString)
import qualified Data.ByteString as S
import Data.ByteString.Internal (create)
import qualified Data.CaseInsensitive as CI
impo... | frontrowed/wai | warp/Network/Wai/Handler/Warp/ResponseHeader.hs | mit | 2,513 | 0 | 13 | 491 | 872 | 444 | 428 | 72 | 1 |
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, UnboxedTuples #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.IORef
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LI... | jtojnar/haste-compiler | libraries/ghc-7.10/base/Data/IORef.hs | bsd-3-clause | 5,368 | 0 | 14 | 1,126 | 584 | 340 | 244 | 41 | 1 |
module Q2 where
import Q
instance Show (IO a) where
show = undefined
| olsner/ghc | testsuite/tests/cabal/T12733/q/Q2.hs | bsd-3-clause | 73 | 0 | 7 | 17 | 26 | 15 | 11 | 4 | 0 |
-----------------------------------------------------------------------------
-- |
-- Module : Data.AFSM.Auto
-- Copyright : (c) Hanzhong Xu, Meng Meng 2016,
-- License : MIT License
--
-- Maintainer : hanzh.xu@gmail.com
-- Stability : experimental
-- Portability : portable
-------------------------... | PseudoPower/AFSM | src/Data/AFSM/Auto.hs | mit | 1,629 | 0 | 10 | 399 | 183 | 110 | 73 | 11 | 0 |
module ReplacementExperiment where
replaceWithP :: b -> Char
replaceWithP = const 'p'
lms :: [Maybe [Char]]
lms = [Just "Ave", Nothing, Just "woohoo"]
-- Just making the argument more specific
replaceWithP' :: [Maybe [Char]] -> Char
replaceWithP' = replaceWithP
liftedReplace :: Functor f => f a -> f Char
liftedRe... | NickAger/LearningHaskell | HaskellProgrammingFromFirstPrinciples/Chapter16.hsproj/ReplacementExperiment.hs | mit | 1,333 | 0 | 11 | 256 | 491 | 241 | 250 | 37 | 1 |
{-# LANGUAGE ConstraintKinds, DataKinds, DefaultSignatures, FlexibleContexts,
FlexibleInstances, MultiParamTypeClasses, OverlappingInstances,
RankNTypes, ScopedTypeVariables, TupleSections, TypeFamilies,
TypeOperators, UndecidableInstances #-}
{- |
Module : Control.Monad.... | ivan-m/monad-levels | Control/Monad/Levels/Definitions.hs | mit | 18,679 | 0 | 14 | 4,534 | 5,617 | 3,037 | 2,580 | -1 | -1 |
{-|
Description : Parse string into parse tree
Parsec applicative style.
-}
module Uroboro.Parser
(
-- * Parsing Uroboro
parseFile
, parseExpression
, parse
-- * Individual parsers
, parseDef
, parseExp
, Parser
, pq
) where
import Control.Applicative ((<*>), (*>))
im... | lordxist/uroboro | src/Uroboro/Parser.hs | mit | 3,798 | 0 | 13 | 952 | 1,238 | 653 | 585 | 89 | 1 |
-- N-Point Crossover
-- http://www.codewars.com/kata/57339a5226196a7f90001bcf
module Kata.NPointCrossover where
import Data.List (nub, sort)
import Data.Tuple (swap)
import Control.Arrow ((***))
crossover :: [Int] -> [a] -> [a] -> ([a],[a])
crossover ns xs = unzip . f (nub . sort $ ns) 0 . zip xs
where f [] i ps... | gafiatulin/codewars | src/6 kyu/NPointCrossover.hs | mit | 494 | 0 | 17 | 115 | 259 | 146 | 113 | 9 | 2 |
module Thirty where
import Control.Exception
data NotDivThree =
NotDivThree Int
deriving (Eq, Show)
instance Exception NotDivThree
data NotEven =
NotEven Int
deriving (Eq, Show)
instance Exception NotEven
evenAndThreeDiv :: Int -> IO Int
evenAndThreeDiv i
| rem i 3 /= 0 = throwIO (NotDivThree i)
| odd... | mudphone/HaskellBook | src/Thirty.hs | mit | 598 | 0 | 9 | 169 | 208 | 102 | 106 | 23 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Moz.Linkscape.URLMetrics
( URLMetrics(..)
, URLMetricCol(..)
, sumUrlMetricCols
) where
import Data.Aeson (FromJSON(..), Value(..), (.:?))
import Control.Monad (mzero)
data URLMetricCol = Title
| CanoncialURL
| Subdomain
... | ags/hs-moz | src/Moz/Linkscape/URLMetrics.hs | mit | 10,120 | 0 | 115 | 4,554 | 1,573 | 878 | 695 | 199 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.