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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
-- HTTP/1.1 requests consist of the following components:
--
-- request:
--
-- Request-Line
-- *(( general-header
-- | request-header
-- | entity-header ) CRLF)
-- CRLF
-- [ message-body ]
--
-- request-line:
--
-- method SP request-uri SP http-version CRLF
--
-- method: "OPTIONS"
-- | ... | ndreynolds/hsURL | Main.hs | mit | 1,787 | 0 | 4 | 791 | 83 | 78 | 5 | 2 | 0 |
module Countdown2 where
import Data.List
import Data.Function
import Types
legal :: Op -> Value -> Value -> Bool
legal Add v1 v2 = v1 <= v2
legal Sub v1 v2 = v2 < v1
legal Mul v1 v2 = 1 < v1 && v1 <= v2
legal Div v1 v2 = 1 < v2 && v1 `mod` v2 == 0
countdown2 :: Int -> [Int] -> (Expr, Value)
countdown2 n = nearest n... | y-kamiya/functional-algorithm-design | src/Countdown/Countdown2.hs | mit | 2,816 | 0 | 10 | 942 | 1,405 | 781 | 624 | 64 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Print (fromValue, fromTagged, encode) where
import Data.Monoid (mappend)
import qualified Data.Text as T
import Data.Text.Lazy.Builder
import Data.Text.Lazy.Builder.Int (decimal)
import Data.Text.Lazy.Builder.RealFloat (realFloat)
import Data.Text.Lazy.Encoding (encodeUtf8, d... | sordina/Edn | Print.hs | mit | 3,176 | 0 | 11 | 713 | 1,296 | 676 | 620 | 71 | 7 |
{-# LANGUAGE ConstrainedClassMethods #-}
-----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.ToGraph
-- Copyright : (c) Andrey Mokhov 2016-2022
-- License : MIT (see the file LICENSE)
-- Maintainer : andrey.mokhov@gmail.com
-- Stability : experimental
--... | snowleopard/alga | src/Algebra/Graph/ToGraph.hs | mit | 23,734 | 0 | 13 | 6,979 | 3,792 | 2,128 | 1,664 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Products.ProductRepo
( ProductRepo (..)
, Git.FileModification (..)
, Git.ParseResult
, Git.parseStatusDiff
, getStatusDiff
, codeRepositoryDir
, fetchRepo
, findProductRepos
, findProductRepo
, updateRepo
) where
import CommonCreatures (WithErr)
import Co... | gust/feature-creature | legacy/lib/Products/ProductRepo.hs | mit | 5,227 | 0 | 18 | 1,128 | 1,310 | 710 | 600 | 106 | 2 |
import System.INotify
import Control.Concurrent (threadDelay)
import Control.Monad (forever)
import System.IO
digestsFilePath :: String
digestsFilePath = "/mnt/lpd-distlib/streamer/v1/digests.list"
doAddWatch :: INotify -> IO ()
doAddWatch ino = do
let modif = CloseWrite
-- Note: the callback to the provide... | adizere/nifty-tree | playground/inotify.hs | mit | 873 | 0 | 10 | 240 | 189 | 92 | 97 | 21 | 1 |
import Data.List
main :: IO ()
main = do
contents <- getContents
let threes = groupsOf 3 (map read $ lines contents)
roadSystem = map (\[a,b,c] -> Section a b c) threes
path = optimalPath roadSystem
pathString = concat $ map (show . fst) path
pathPrice = sum $ map snd path
p... | friedbrice/Haskell | ch10/heathrow2.hs | gpl-2.0 | 1,637 | 0 | 13 | 494 | 642 | 346 | 296 | 40 | 3 |
{-#LANGUAGE GADTs #-}
{-#LANGUAGE TypeFamilies #-}
{-#LANGUAGE DataKinds #-}
{-#LANGUAGE KindSignatures #-}
{-#LANGUAGE StandaloneDeriving #-}
module PromotedDataTypes() where
-- FC-pro version - Value and type constructors
data Nat = Zero | Suc Nat
-- Indexed type family (type functions)
type family Plus (a :: Nat)... | krakrjak/haskell-playground | TypeFunctions/PromotedDataTypes.hs | gpl-2.0 | 871 | 0 | 10 | 194 | 312 | 170 | 142 | 20 | 1 |
{-|
Module : Bench
Description : Memory benchmark of Multilinear library
Copyright : (c) Artur M. Brodzki, 2018
License : BSD3
Maintainer : artur@brodzki.org
Stability : experimental
Portability : Windows/POSIX
-}
module Main (
main
) where
import Weigh
import Multilinear.Generi... | ArturB/Multilinear | benchmark/gpu/memory/Bench.hs | gpl-3.0 | 2,501 | 0 | 15 | 599 | 651 | 332 | 319 | 44 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Model.EventMissile
( EventMissile (..)
) where
import Data.Aeson
import GHC.Generics
import Test.QuickCheck
import Model.Event
import M... | massimo-zaniboni/netrobots | robot_examples/haskell-servant/rest_api/lib/Model/EventMissile.hs | gpl-3.0 | 788 | 0 | 11 | 142 | 161 | 95 | 66 | 25 | 0 |
{---------------------------------------------------------------------}
{- Copyright 2015, 2016 Nathan Bloomfield -}
{- -}
{- This file is part of Feivel. -}
{- ... | nbloomf/feivel | src/Feivel/Grammar/Doc.hs | gpl-3.0 | 1,994 | 0 | 8 | 745 | 255 | 165 | 90 | 25 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/DynamicTargetingKeys/List.hs | mpl-2.0 | 6,970 | 0 | 22 | 1,696 | 1,099 | 628 | 471 | 157 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
-- |
-- Module : Network.Google.ContainerBuilder
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : Moz... | rueshyna/gogol | gogol-containerbuilder/gen/Network/Google/ContainerBuilder.hs | mpl-2.0 | 6,936 | 0 | 15 | 1,641 | 782 | 571 | 211 | 173 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.IdentityToolkit.Types
-- Copyright : (c) 2015-2016 Bre... | rueshyna/gogol | gogol-identity-toolkit/gen/Network/Google/IdentityToolkit/Types.hs | mpl-2.0 | 12,500 | 0 | 7 | 2,647 | 1,195 | 811 | 384 | 368 | 1 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE DataKinds #-}
module Gpg where
import Control.Applicative
import qualified Control.Exception as Ex
import Co... | Philonous/pontarius-service | source/Gpg.hs | agpl-3.0 | 7,982 | 0 | 19 | 2,603 | 1,961 | 968 | 993 | 183 | 5 |
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
module Jaek.Project.Parse (
Parse (..)
)
where
import Jaek.Base
import Jaek.Gen
import Jaek.StreamExpr as SE
import Jaek.StreamT as ST
import Jaek.Tree
import Data.Attoparsec as A
import ... | JohnLato/jaek | src/Jaek/Project/Parse.hs | lgpl-3.0 | 2,426 | 0 | 17 | 674 | 788 | 421 | 367 | 58 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module AllDice.Scheme
( runExpr
) where
import Control.Monad.ST
import qualified Data.Text as T
-- Not ideal but should in theory work for now
import System.Random
-- Scheme interpreter
import Scheme.Types
import Scheme.Env
import Scheme.Parser
import Scheme.Evaluator
eva... | pharaun/alldice | src/AllDice/Scheme.hs | apache-2.0 | 1,583 | 0 | 18 | 403 | 549 | 272 | 277 | 38 | 2 |
module Quasar.Utils where
import Data.Aeson
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy as LBS
import Control.Concurrent
import Control.Monad.IO.Class
import qualified Network.Wai as W
import qualified Network.Wai.Handler.Warp as W (run)
import System.Exit
import System.IO
-- TO... | xdcrafts/Quasar | src/Quasar/Utils.hs | apache-2.0 | 855 | 0 | 8 | 129 | 258 | 144 | 114 | 24 | 1 |
module Data.SpecHelper where
import qualified Data.Geospatial as Geospatial
import qualified Data.LinearRing as LinearRing
import qualified Data.LineString as LineString
import qualified Data.Sequence as Sequence
import qualified Data.Geometry.VectorTile.Vector... | sitewisely/zellige | test/Data/SpecHelper.hs | apache-2.0 | 1,717 | 0 | 12 | 244 | 523 | 294 | 229 | 19 | 1 |
module Step_1_4 where
-- Great! You've run your first Haskell code.
import Data.List
-- This line just makes some utility functions from the Data.List module accessible.
-- Let's write those unix command lines as Haskell code:
input = "`Twas brillig, and the slithy toves\n"
++ "Did gyre and gimble in the wabe;\... | mzero/barley | seed/Chapter1/Step_1_4.hs | apache-2.0 | 1,364 | 0 | 14 | 293 | 297 | 155 | 142 | 19 | 1 |
-- http://www.codewars.com/kata/552fd698ac49561baf00006e
module WordBreak where
import Control.Arrow
import Data.List
wordBreak :: [String] -> String -> Maybe [String]
wordBreak xss = fmap reverse . fst . foldl f (Just [], []) where
f (onBound, insides) y = (onBound', insides') where
as = insides ++ case onBoun... | Bodigrim/katas | src/haskell/B-Breaking-into-words.hs | bsd-2-clause | 588 | 0 | 16 | 150 | 249 | 136 | 113 | 14 | 3 |
{-# LANGUAGE DeriveDataTypeable #-}
module Application.Scaffold.Type where
import System.Console.CmdArgs
data Scaffold = MakeApp { config :: FilePath }
| MakeYesodCrud { config :: FilePath }
deriving (Show,Data,Typeable)
makeapp :: Scaffold
makeapp = MakeApp { config = "test.conf" }
... | wavewave/scaffold | lib/Application/Scaffold/Type.hs | bsd-2-clause | 460 | 0 | 8 | 97 | 110 | 67 | 43 | 12 | 1 |
module Command.Edit.Perform
( EditOptions(..)
, perform
) where
import Data.Maybe
import qualified System.Posix.Env as P
import qualified System.Posix.Temp as P
-- | Get the preferred editor. If no editor is set, "vi" is used as the
-- default.
getEditor :: EditOptions -- ^ command-line options
-> IO Strin... | lovasko/swim | src/Command/Edit/Perform.hs | bsd-2-clause | 607 | 1 | 11 | 127 | 138 | 79 | 59 | -1 | -1 |
module Handler.About where
import Import
getAboutR :: Handler RepHtml
getAboutR = defaultLayout $ do
setTitle "What is DH? | About"
$(widgetFile "about")
| erochest/whatisdh | Handler/About.hs | bsd-2-clause | 166 | 0 | 10 | 34 | 42 | 21 | 21 | 6 | 1 |
{- |
- Module : Types.Internal.Channel
- Description : Representation of an IRC channel name.
- Copyright : (c) Magnus Stavngaard, 2017
- License : BSD-3
- Maintainer : magnus@stavngaard.dk
- Stability : experimental
- Portability : POSIX
-
- An IRC channel starts with one of the characters #, + ... | bus000/Dikunt | src/Types/Internal/Channel.hs | bsd-3-clause | 1,865 | 0 | 10 | 385 | 364 | 206 | 158 | 27 | 2 |
module Data.Graph.Libgraph.UnionFind
( UF
, fromList
, find
, union
) where
import Data.UnionFind.IntMap( Point,PointSupply,newPointSupply
, fresh,repr,descriptor)
import qualified Data.UnionFind.IntMap as UF
import Data.IntMap.Lazy(IntMap,(!))
import qualified Data.IntMap.Lazy as IM
data ... | MaartenFaddegon/libgraph | Data/Graph/Libgraph/UnionFind.hs | bsd-3-clause | 875 | 0 | 11 | 195 | 382 | 211 | 171 | 22 | 1 |
{-# LANGUAGE TemplateHaskell #-}
------------------------------------------------------------------------------
-- | This module includes the machinery necessary to use hint to load
-- action code dynamically. It includes a Template Haskell function
-- to gather the necessary compile-time information about code
-- lo... | snapframework/snap-loader-dynamic | src/Snap/Loader/Dynamic.hs | bsd-3-clause | 10,134 | 4 | 24 | 2,313 | 1,274 | 703 | 571 | 92 | 3 |
{-# LANGUAGE CPP, GADTs, UnboxedTuples #-}
-----------------------------------------------------------------------------
--
-- Monad for Stg to C-- code generation
--
-- (c) The University of Glasgow 2004-2006
--
-----------------------------------------------------------------------------
module StgCmmMonad (
... | GaloisInc/halvm-ghc | compiler/codeGen/StgCmmMonad.hs | bsd-3-clause | 31,044 | 0 | 15 | 8,248 | 5,913 | 3,227 | 2,686 | 469 | 2 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
module Tinfoil.Data.Hash(
Hash(..)
, HashFunction(..)
, parseHashFunction
, renderHash
, renderHashFunction
) where
import Control.DeepSeq.Generics (gener... | ambiata/tinfoil | src/Tinfoil/Data/Hash.hs | bsd-3-clause | 1,075 | 0 | 6 | 215 | 227 | 133 | 94 | 31 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module GUI (gui) where
import Control.Monad
import Graphics.UI.WX (Prop(..))
import ListUtils (sortOn)
import Parser (CostCentre(..), CostCentreData(..), TimeAlloc(..))
import TextUtils (showText)
import qualified Data.Text as Text
import qualified Graphics.UI.WX as WX
import qualifi... | Peaker/HaskProfileGui | GUI.hs | bsd-3-clause | 1,396 | 0 | 20 | 262 | 499 | 263 | 236 | 31 | 1 |
#!/usr/bin/env runstaskell
import System.IO.Temp
import System.FilePath
main :: IO ()
main = withSystemTempDirectory "runstaskell-test" $ \ dir -> do
writeFile (dir </> "foo") "03-success"
putStrLn =<< readFile (dir </> "foo")
| soenkehahn/runstaskell | test/03.hs | bsd-3-clause | 233 | 0 | 12 | 36 | 72 | 37 | 35 | 6 | 1 |
module Matterhorn.Events.PostListOverlay where
import Prelude ()
import Matterhorn.Prelude
import qualified Graphics.Vty as Vty
import Matterhorn.Types
import Matterhorn.Events.Keybindings
import Matterhorn.State.PostListOverlay
onEventPostListOverlay :: Vty.Event ... | matterhorn-chat/matterhorn | src/Matterhorn/Events/PostListOverlay.hs | bsd-3-clause | 1,083 | 0 | 10 | 177 | 166 | 93 | 73 | 19 | 1 |
module Data.Origami.Internal.TestFiles.Param where
data ParamTy a b c d = ParamTy
type ParamTySyn a b c d = ParamTy a a a a
data PT = PT (ParamTy String String String String)
data PTS = PTS (ParamTySyn String Char Bool ())
| nedervold/origami | tests/Data/Origami/Internal/TestFiles/Param.hs | bsd-3-clause | 227 | 0 | 9 | 45 | 83 | 50 | 33 | 5 | 0 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-missing-methods #-}
-- | 'JSChan' provides the same functionality and
-- concurrency abstraction i... | ku-fpg/sunroof-compiler | Language/Sunroof/JS/Chan.hs | bsd-3-clause | 3,405 | 0 | 19 | 744 | 943 | 507 | 436 | 64 | 1 |
{-# LANGUAGE NoImplicitPrelude #-}
module Sys.ExitCode(
ExitCode
, _ExitFailure
, _ExitSuccess
, exitFailure
, exitSuccess
, exitFailureP
, exitSuccessP
, exitCode
, unExitCode
) where
import Control.Lens(Prism', prism', (#))
import Data.Int(Int)
import Data.Maybe(Maybe(Nothing, Just))
import Data.NotZero(NotZero, ... | NICTA/sys-process | src/Sys/ExitCode.hs | bsd-3-clause | 1,586 | 0 | 12 | 347 | 468 | 262 | 206 | 72 | 2 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANG... | ku-fpg/remote-json | Control/Remote/Monad/JSON/Trace.hs | bsd-3-clause | 2,702 | 0 | 17 | 798 | 747 | 383 | 364 | 49 | 2 |
-- |
-- The modified Shunting-Yard algorithm. The modifications allow function
-- application by juxtaposition (without any paren around the arguments)
-- and distfix operators. For a normal usage, it should be enough
-- to import only 'Text.Syntactical', not directly this module.
-- Note: The parser allows applying a... | noteed/syntactical | Text/Syntactical/Yard.hs | bsd-3-clause | 13,347 | 0 | 16 | 3,228 | 4,147 | 2,107 | 2,040 | 231 | 17 |
module Main where
import Test.Tasty ( TestTree
, defaultIngredients
, defaultMainWithIngredients
, testGroup
)
import ... | creswick/minServant | tests/Main.hs | bsd-3-clause | 629 | 0 | 7 | 281 | 103 | 60 | 43 | 15 | 1 |
module Main (main) where
import D6Lib
import System.Environment (getArgs)
main :: IO ()
main = do
file <- head <$> getArgs
fileLines <- lines <$> readFile file
let msg = fixMessage fileLines
putStrLn $ "message: " ++ msg
let msg' = fixModMessage fileLines
putStrLn $ "message using modified rep code: " ... | wfleming/advent-of-code-2016 | 2016/app/D6.hs | bsd-3-clause | 329 | 0 | 10 | 71 | 108 | 53 | 55 | 11 | 1 |
{-# LANGUAGE NoMonomorphismRestriction #-}
import Diagrams.Prelude
import Diagrams.Backend.Canvas.CmdLine
main = mainWith ((square 200 # fc blue <> circle 300)
# lw thick
# fc red
# frame 10 :: Diagram Canvas R2)
| ku-fpg/diagrams-canvas | examples/Circle.hs | bsd-3-clause | 258 | 0 | 13 | 77 | 74 | 37 | 37 | 7 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Web.Slack
import Web.Slack.Message
import System.Environment (lookupEnv)
import Data.Maybe (fromMaybe)
import Control.Applicative
import Data.Text (Text)
import qualified Data.Text as T
import System.Environment
import Data.Foldable
import Network.Wreq
impor... | madjar/jmt | Main.hs | bsd-3-clause | 1,737 | 0 | 19 | 439 | 575 | 290 | 285 | -1 | -1 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE... | alexbiehl/bandits | src/Bandits/Backend/HRR.hs | bsd-3-clause | 6,215 | 0 | 14 | 1,497 | 1,525 | 797 | 728 | 137 | 8 |
module HandleHelperMUnitTests (handleHelperMUnitTests) where
import Prelude ()
import Game.LambdaHack.Core.Prelude
import Test.Tasty
import Test.Tasty.HUnit
import Game.LambdaHack.Client.UI.HandleHelperM
import UnitTestHelpers
handleHelperMUnitTests :: TestTree
handleHelperMUnitTests = testGroup "handleHelperMUni... | LambdaHack/LambdaHack | test/HandleHelperMUnitTests.hs | bsd-3-clause | 591 | 0 | 13 | 98 | 115 | 63 | 52 | 14 | 1 |
{-# LANGUAGE ViewPatterns, QuasiQuotes, FlexibleContexts, CPP #-}
-- | Macros allow users to access more advanced functionality from within Markdown syntax. There are two types
-- of macros, block and inline, which allow substitution of 'Block' and 'Inline' data, respectively. Macros
-- are called in a very similar fas... | ajdunlap/yesod-markdown | Yesod/Markdown/Macros.hs | bsd-3-clause | 3,668 | 0 | 21 | 732 | 617 | 333 | 284 | 37 | 2 |
{-# LANGUAGE BangPatterns, GeneralizedNewtypeDeriving, PatternGuards,
DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
module Data.VectorNode(
Elem(..), Breadth, Size, Sized(..),
Node, empty, singleton,
splitR, splitL, force, cons, snoc,
breadth, head, tail, init, last, append, null,
... | jmaessen/Data.FastSequence | src/Data/VectorNode.hs | bsd-3-clause | 5,484 | 0 | 12 | 1,201 | 1,894 | 999 | 895 | 103 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE UnicodeSyntax #-}
{- | These functions take only the NAME, not the whole path.
-}
module Node
( nodeNamed
, fileNodeNamed
, tagNodeNamed
) where
import Data.Maybe (isJust)
import System.Fuse (getFuseContext)
im... | marklar/TagFS | src/Node.hs | bsd-3-clause | 1,316 | 0 | 14 | 354 | 359 | 183 | 176 | 34 | 3 |
{-# LANGUAGE RankNTypes, FlexibleInstances, TypeSynonymInstances, QuasiQuotes, MultiParamTypeClasses, TypeFamilies, OverloadedStrings #-}
module MediaSub.Sections.BackendGitAnnex
--( AnnexSec, mkAnnexSec )
where
import Prelude hiding (mapM_)
import qualified Prelude as P
import Utils
i... | SimSaladin/rnfssp | rnfssp-media/MediaSub/Sections/BackendGitAnnex.hs | bsd-3-clause | 7,514 | 1 | 25 | 2,449 | 1,912 | 977 | 935 | -1 | -1 |
module CRF.Gradient
( computeGradient
, applyGradient
, Gradient
) where
import CRF.Base
import CRF.LogMath (logAdd)
import CRF.Feature (featuresIn)
import CRF.Model (Model, expectedFeaturesIn)
import qualified CRF.Model.Internal as MI
import qualified CRF.Data.MarkedArray as MA
type Gradient = MA.MarkedArray
comput... | kawu/tagger | src/CRF/Gradient.hs | bsd-3-clause | 975 | 4 | 16 | 224 | 294 | 166 | 128 | 25 | 1 |
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module App where
import Yesod
import Yesod.Paginator
import Network.Wai.Handler.Warp (run)
data App = App
mkYesod "App" [p... | jamesdabbs/yesod-paginator | Test.hs | bsd-3-clause | 1,462 | 0 | 10 | 542 | 181 | 99 | 82 | 25 | 1 |
{-# LANGUAGE TypeFamilies,
MultiParamTypeClasses,
RankNTypes,
DeriveFunctor,
GeneralizedNewtypeDeriving
#-}
{-|
Module : Control.Monad.Free.NonPure
Copyright : (c) 2015 Maciej Piróg
License : MIT
Maintainer : maciej.adam.pirog@gmail.com
Stability : exp... | maciejpirog/modules-over-monads | src/Control/Monad/Free/NonPure.hs | mit | 2,260 | 9 | 12 | 475 | 670 | 362 | 308 | 39 | 1 |
{-# LANGUAGE OverloadedStrings, CPP #-}
{- hpodder component
Copyright (C) 2006-2007 John Goerzen <jgoerzen@complete.org>
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 Licen... | jgoerzen/twidge | Types.hs | gpl-2.0 | 3,774 | 0 | 13 | 806 | 881 | 464 | 417 | 73 | 1 |
{- |
Module : $Header$
Copyright : (c) Felix Gabriel Mance
License : GPLv2 or higher, see LICENSE.txt
Maintainer : f.mance@jacobs-university.de
Stability : provisional
Portability : portable
Printer for N-triples
-}
module RDF.Print where
import Common.AS_Annotation
import Common.Doc hiding (se... | mariefarrell/Hets | RDF/Print.hs | gpl-2.0 | 4,628 | 0 | 18 | 1,160 | 1,496 | 741 | 755 | 113 | 4 |
left `after` right = right ++ left
| evolutics/haskell-formatter | testsuite/resources/source/handles_infix_binding/Output.hs | gpl-3.0 | 35 | 0 | 5 | 7 | 18 | 9 | 9 | 1 | 1 |
{-# 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-iam/gen/Network/AWS/IAM/DeleteAccountPasswordPolicy.hs | mpl-2.0 | 2,954 | 0 | 11 | 553 | 284 | 174 | 110 | 48 | 1 |
{-# LANGUAGE FlexibleInstances, TypeFamilies #-}
{- |
Defines the prisoner's dilemma, stag hunt, and a suite of strategies.
From GHCi, try some of the following.
>>> nash pd
>>> pareto pd
>>> paretoNash pd
>>> paretoNash stag
>>> execGame pd [tft, pavlov] (times 10 >> printTranscripts >> printScore)
>>> axelrod [fi... | pparkkin/Hagl | Hagl/Examples/Prisoner.hs | bsd-3-clause | 4,225 | 0 | 11 | 908 | 956 | 526 | 430 | 70 | 3 |
module All where
import FP ()
import MAAM ()
import Lang.LamIf ()
import Lang.Hask ()
| FranklinChen/maam | src/All.hs | bsd-3-clause | 87 | 0 | 4 | 16 | 32 | 21 | 11 | 5 | 0 |
{-# LANGUAGE PartialTypeSignatures, NamedWildcards #-}
module GenNamed where
bar :: _a -> _a
bar x = not x
| bitemyapp/ghc | testsuite/tests/partial-sigs/should_compile/GenNamed.hs | bsd-3-clause | 108 | 0 | 5 | 19 | 25 | 14 | 11 | 4 | 1 |
import Data.List
import Data.Function
main :: IO ()
main = do
let input = replicate 1000000 'c' ++ "defghi"
print $ trampoline $ snd $ break (== 'd') input
| rahulmutt/ghcvm | tests/suite/trampoline/run/TrampolineBreak.hs | bsd-3-clause | 161 | 0 | 11 | 34 | 68 | 34 | 34 | 6 | 1 |
-- |
-- Module : Crypto.MAC.HMAC
-- License : BSD-style
-- Maintainer : Vincent Hanquez <vincent@snarc.org>
-- Stability : experimental
-- Portability : unknown
--
-- Provide the HMAC (Hash based Message Authentification Code) base algorithm.
-- <http://en.wikipedia.org/wiki/HMAC>
--
{-# LANGUAGE BangPatter... | vincenthz/cryptonite | Crypto/MAC/HMAC.hs | bsd-3-clause | 5,167 | 0 | 28 | 1,786 | 1,069 | 568 | 501 | 88 | 4 |
{-# LANGUAGE GADTs, FlexibleInstances, TypeOperators, ScopedTypeVariables, RankNTypes #-}
-- |
-- Module : Data.Array.Accelerate.Pretty.Print
-- Copyright : [2008..2011] Manuel M T Chakravarty, Gabriele Keller, Sean Lee
-- License : BSD3
--
-- Maintainer : Manuel M T Chakravarty <chak@cse.unsw.edu.au>
-- St... | wilbowma/accelerate | Data/Array/Accelerate/Pretty/Print.hs | bsd-3-clause | 14,281 | 0 | 16 | 3,777 | 4,972 | 2,477 | 2,495 | 263 | 2 |
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving, TemplateHaskell #-}
module Distribution.Server.Framework.AuthTypes where
import Distribution.Server.Framework.MemSize
import Data.SafeCopy (base, deriveSafeCopy)
import Data.Typeable (Typeable)
-- | A plain, unhashed password. Careful what you do with them... | mpickering/hackage-server | Distribution/Server/Framework/AuthTypes.hs | bsd-3-clause | 895 | 0 | 8 | 131 | 143 | 86 | 57 | 13 | 0 |
module Nesting where
{-|
* We can
* easily go back
1. some indentation
* levels
1. @back at the top@
-}
d :: t
d = undefined
{-|
* Beginning of list
* second list
* Some indented list but
the presence of this text pushes it out of nesting back to the top.
-}
e :: t
e = undefined
... | Acidburn0zzz/haddock | html-test/src/Nesting.hs | bsd-2-clause | 1,973 | 0 | 4 | 778 | 92 | 59 | 33 | 17 | 1 |
-- !!! Pattern binding must bind (not an error in standard Haskell)
module M where
x = let ['a'] = "a" in 'a'
| urbanslug/ghc | testsuite/tests/module/mod64.hs | bsd-3-clause | 110 | 0 | 9 | 23 | 25 | 14 | 11 | 2 | 1 |
module Parser where
import Expense
import StringUtils
import Data.Char
import Data.List
import Text.ParserCombinators.ReadP
data ParseError = ParseError { line :: Int
, col :: Int
, snip :: String
}
instance Show ParseError where... | fredmorcos/attic | projects/pet/archive/pet_haskell_pet2/Parser.hs | isc | 3,032 | 0 | 14 | 1,270 | 911 | 457 | 454 | 77 | 2 |
import Control.Monad (liftM2)
import Notes
import Test.QuickCheck
instance Arbitrary PitchClass where
arbitrary = elements [C .. B]
instance Arbitrary Note where
arbitrary = liftM2 Note arbitrary arbitrary
testInverse :: Note -> Semitone -> Bool
testInverse (Note p o) x = ... | Lokilow/Functional-Music | test-suite/Algebraic/NoteTest.hs | mit | 419 | 0 | 10 | 117 | 138 | 72 | 66 | 11 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Chattp.Webapp.IPC where
import Chattp.Webapp.Conf
import Chattp.Webapp.Protocol
import Chattp.Webapp.InternalCommunication
import Text.ProtocolBuffers.Header
import Text.ProtocolBuffers.WireMessage
import Chattp.WebappRequestMessage as Rq
import Chattp.WebappResponseMessage ... | Spheniscida/cHaTTP | webapp/Chattp/Webapp/IPC.hs | mit | 3,337 | 0 | 16 | 862 | 774 | 394 | 380 | 56 | 2 |
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-}
module Y2018.M04.D11.Exercise where
{--
Like we've done before, we need to download packets of information (articles)
and (eventually) store those articles, but also store the packet information
that we used to download the articles
see also: Y2017.M12.D20.Exercise.
... | geophf/1HaskellADay | exercises/HAD/Y2018/M04/D11/Exercise.hs | mit | 1,911 | 0 | 9 | 329 | 184 | 116 | 68 | 21 | 1 |
module Language.Plover.CLI
(CompilerOpts(..), TargetFlag(..), hasOptFlag, compilerOpts, splitColon)
where
import System.Console.GetOpt
import System.Exit
import qualified Data.Set as S
import Data.Maybe
import Data.List
data CompilerOpts
= CompilerOpts
{ inputFiles :: [String]
, unitName :: Ma... | swift-nav/plover | src/Language/Plover/CLI.hs | mit | 7,435 | 0 | 14 | 2,279 | 2,108 | 1,119 | 989 | 164 | 5 |
module KAT.Utils
( module Crypto.Cipher.Tests
, concatKATs
) where
import Crypto.Cipher.Tests
concatKATs :: [KATs] -> KATs
concatKATs l = KATs (m kat_ECB) (m kat_CBC) (m kat_CFB) (m kat_CTR) (m kat_XTS) (m kat_AEAD)
where
m :: (KATs -> [x]) -> [x]
m sel = concat $ map sel l
| stbuehler/haskell-nettle | src/Tests/KAT/Utils.hs | mit | 284 | 4 | 10 | 57 | 138 | 75 | 63 | 8 | 1 |
module Test.DistMatrix where
import Data.Aeson
import Data.Either
import qualified Data.ByteString.Char8 as C8
import Test.Hspec
import Web.Google.Maps.Services.DistanceMatrix
import Test.DistMatrixData
tests :: Spec
tests =
describe "Response tests" $ do
let result :: Either String DMResponse
... | jhedev/google-maps | test/Test/DistMatrix.hs | mit | 626 | 0 | 13 | 142 | 170 | 92 | 78 | 19 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ExtendedDefaultRules #-}
{-# LANGUAGE LambdaCase #-}
module Main where
import Prelude hiding (FilePath)
import Control.Monad
import Data.Maybe
import qualified Data.Text as T
import System.Environment
import Shelly
psql_path :: FilePath
psql_path = "psql"
schema_... | TravisWhitaker/BroScore-backend | sql/SchemaInit.hs | mit | 1,391 | 0 | 17 | 422 | 405 | 215 | 190 | 30 | 4 |
{------------------------------------------------------------------------------
uPuppet: Evaluation
------------------------------------------------------------------------------}
module UPuppet.Eval ( evalPuppet ) where
import Data.List
import Debug.Trace
import UPuppet.CState
import UPuppet.AST
import UPuppet.... | dcspaul/uPuppet | Src/UPuppet/Eval.hs | mit | 31,319 | 11 | 19 | 8,372 | 10,317 | 5,651 | 4,666 | 290 | 23 |
module Antiqua.Geometry.Circle where
import Data.STRef
import Control.Applicative
import Control.Monad.ST
import Antiqua.Common
bresenham :: XY -> Int -> [XY]
bresenham (x0, y0) r = runST $ do
x <- newSTRef r
y <- newSTRef 0
rError <- newSTRef (1 - r)
list <- newSTRef []
let (+$=) ls (i, j) = mod... | olive/antiqua-prime | src/Antiqua/Geometry/Circle.hs | mit | 1,139 | 0 | 26 | 532 | 456 | 236 | 220 | 28 | 3 |
module GHCJS.DOM.SVGPathSegMovetoAbs (
) where
| manyoo/ghcjs-dom | ghcjs-dom-webkit/src/GHCJS/DOM/SVGPathSegMovetoAbs.hs | mit | 49 | 0 | 3 | 7 | 10 | 7 | 3 | 1 | 0 |
module Rx.Observable.MergeTest (tests) where
import Test.HUnit
import Test.Hspec
import Control.Concurrent.Async (async, wait)
import Control.Monad (forM_, replicateM, replicateM_)
import qualified Rx.Observable as Rx
import qualified Rx.Subject as Rx
tests :: Spec
tests =
describe "Rx.Observable.Merge" $
... | roman/Haskell-Reactive-Extensions | rx-core/test/Rx/Observable/MergeTest.hs | mit | 1,525 | 0 | 14 | 470 | 345 | 172 | 173 | 35 | 2 |
module Text.Documentalist.Types.DocBlock ( DocBlock(..)
, Paragraph(..)
, Span(..)
, Code(..)
, DocParam(..)
, Resu... | jspahrsummers/documentalist | Text/Documentalist/Types/DocBlock.hs | mit | 3,405 | 0 | 19 | 1,104 | 981 | 517 | 464 | 71 | 0 |
{
module Lexer (Alex, runAlex, lexToken) where
import Data.Map (Map)
import Alex
}
%wrapper "basic"
$numbers = 0-9 -- digits
$letters = [a-zA-Z] -- alphabetic characters
$eol = [\n] --Enter
tokens :-
"if" { \_ -> ReservedIdent "if" }
"and" { \_ -> ReservedIdent "and" }
"break" { \_ -> ReservedId... | joshuapassos/GCET525-Compiladores | vodka.hs | mit | 1,122 | 36 | 10 | 308 | 440 | 212 | 228 | -1 | -1 |
main = do
src <- readFile "quux.txt"
putStr $ wordCount src
where wordCount input = (show . length . lines $ input) ++ "\n"
| adz/real_world_haskell | ch01/read_from_file_explicitly.hs | mit | 131 | 0 | 11 | 31 | 55 | 26 | 29 | 4 | 1 |
module FeatureModel.Logic
( alternativeChildren
, dimacsFormat
, essentialFeatures
, eval
, featureToPropositionalLogic
, fmToCNFExpression
, fmToPropositionalLogic
, fmToTseitinEncode
, isMandatory
, isAlternative
, isOptional
, optionalFeatures
, orChildren
, ref
) where
import Data.Generics
import FeatureModel.New... | hephaestus-pl/hephaestus | alexandre/feature-modeling/src/FeatureModel/Logic.hs | mit | 8,451 | 0 | 20 | 1,927 | 3,227 | 1,630 | 1,597 | 184 | 3 |
import Peptide
import Data.ByteString.Char8
main = print $ results
where sequence = pack "V(3D)NK(3F)NKEXCNZRAIEUALDPNLNDQQFHUKIWZIIXDC"
weight = 2194.9
results = calculationResults weight sequence
| stuartnelson3/molecule-weight | haskell/src/test.hs | mit | 220 | 0 | 7 | 44 | 44 | 24 | 20 | 6 | 1 |
module Unification(
Equation,
Equations,
Substitution,
TypeExpr(..),
unify,
applySubstitution) where
import Data.Set as S
import Control.Monad
data TypeExpr = TEVar Int
| TEConst Int
| TEArrow TypeExpr TypeExpr
deriving(Eq, Show,Ord)
-- equations betw... | fsestini/stlc-machine | src/Unification.hs | mit | 5,583 | 0 | 16 | 1,568 | 1,623 | 833 | 790 | 101 | 5 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleInstances #-} -- for class Typeish String
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{- |
Description : build Getopt handler from description using template haskell
Copyright : (c) Martyn J. Pearce 2014, 2015
License : B... | sixears/getopt | src/Console/GetoptTH.hs | mit | 37,982 | 0 | 21 | 13,263 | 3,111 | 1,758 | 1,353 | 226 | 7 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecordWildCards #-}
module TBR.Core
( add
, finish
, list
, move
, random
, remove
, search
, start
, status
... | abhinav/tbr | app/TBR/Core.hs | mit | 6,784 | 0 | 15 | 1,836 | 1,824 | 934 | 890 | 142 | 3 |
------------ exercise 2 : Four in a Row -----------------
-- réussite = 4 de suite, 4 dans la meme colonne, ou 4 en diagonal
checkFour :: [[Char]] -> True
| t00n/ProjectEuler | TP4.hs | epl-1.0 | 159 | 0 | 7 | 31 | 18 | 11 | 7 | 1 | 0 |
module Access.System.IO.Error
( module System.IO.Error
, IOErrorAccess(..)
) where
import System.IO.Error
import Access.Core
class Access io => IOErrorAccess io where
ioError' :: IOError -> io a
catchIOError' :: io a -> (IOError -> io a) -> io a
tryIOError' ... | bheklilr/base-io-access | Access/System/IO/Error.hs | gpl-2.0 | 578 | 0 | 11 | 170 | 169 | 91 | 78 | 15 | 0 |
-- GenI surface realiser
-- Copyright (C) 2009 Eric Kow
--
-- 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.
--
-- Thi... | kowey/GenI | geni-test/NLP/GenI/Regression.hs | gpl-2.0 | 4,700 | 0 | 14 | 920 | 1,171 | 624 | 547 | 88 | 3 |
{-# LANGUAGE ScopedTypeVariables, NoMonomorphismRestriction, RecordWildCards #-}
module Main where
import Control.Applicative
import Control.Monad
import Control.Monad.Error
import Control.Monad.Reader
import Control.Monad.State
import Data.Conduit
import... | wavewave/lhc-analysis-collection | exe/2013-06-10-XQLD-2sg.hs | gpl-3.0 | 5,991 | 0 | 20 | 1,717 | 1,492 | 848 | 644 | 131 | 3 |
module Database.Design.Ampersand.Input
( module Database.Design.Ampersand.Input.ADL1.CtxError
, module Database.Design.Ampersand.Input.Parsing
) where
import Database.Design.Ampersand.Input.ADL1.CtxError (CtxError,Guarded(..),showErr)
import Database.Design.Ampersand.Input.Parsing (parseADL,parseADL1pExpr,pars... | 4ZP6Capstone2015/ampersand | src/Database/Design/Ampersand/Input.hs | gpl-3.0 | 345 | 0 | 6 | 34 | 75 | 54 | 21 | 5 | 0 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UndecidableInstances #-}
{-
Copyright : Copyright (C) 2014-2017 Synchrotron Soleil
License : GPL3+
Maintainer : picca@synchrotron-soleil.fr
Stability : Experimental
Portability: GHC only?
-}
import Numeric.LinearAlgebra (Vector, Matrix,
... | picca/hkl | contrib/haskell/src/hkl.hs | gpl-3.0 | 2,046 | 0 | 13 | 653 | 550 | 298 | 252 | 48 | 1 |
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UnicodeSyntax #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE Rank2Types #-}
module Data.Colour.Mani... | leftaroundabout/colour-space | src/Data/Colour/Manifold.hs | gpl-3.0 | 16,761 | 118 | 17 | 4,622 | 5,908 | 3,137 | 2,771 | 325 | 1 |
{- Цель - сделать генерацию минимального подмножества sql, через которое можно выразить все операции-}
module Database.SQL.SQLSolvent.NaiveSql (
Ariphm(Plus, Minus, Multi, Div)
,ClauseOp(Much, Less, Equ, NoEqu,MEqu, LEqu)
,Logic(And, Or)
,Clause(Clause)
,Where (Where)
... | nixorn/SQL-Solvent | src/Database/SQL/SQLSolvent/NaiveSql.hs | gpl-3.0 | 3,521 | 0 | 17 | 1,219 | 789 | 451 | 338 | 76 | 0 |
{-# LANGUAGE RankNTypes, ExistentialQuantification #-}
module BlastItWithPiss.Captcha
(CurrentSsachCaptchaType
,unsafeMakeYandexCaptchaAnswer
,ssachRecaptchaKey
,cloudflareRecaptchaKey
,CAnswer(..)
,Captcha(..)
,Recaptcha(..)
,recaptchaChallengeKey
,Yandex(..)
,makabaCaptc... | exbb2/BlastItWithPiss | src/BlastItWithPiss/Captcha.hs | gpl-3.0 | 7,979 | 0 | 15 | 2,044 | 1,173 | 622 | 551 | 111 | 2 |
runReader :: Reader e a -> e -> a
runReader (Reader f) e = f e | hmemcpy/milewski-ctfp-pdf | src/content/3.5/code/haskell/snippet07.hs | gpl-3.0 | 62 | 0 | 7 | 15 | 38 | 18 | 20 | 2 | 1 |
{-# LANGUAGE CPP #-}
{- |
UTF-8 aware string IO functions that will work across multiple platforms
and GHC versions. Includes code from Text.Pandoc.UTF8 ((C) 2010 John
MacFarlane).
Example usage:
import Prelude hiding (readFile,writeFile,appendFile,getContents,putStr,putStrLn)
import UTF8IOCompat (readFile,write... | mstksg/hledger | hledger-lib/Hledger/Utils/UTF8IOCompat.hs | gpl-3.0 | 4,261 | 0 | 6 | 793 | 245 | 178 | 67 | 31 | 1 |
-- TTyped: A dependently typed programming language.
-- Copyright (C) 2018 Taran Lynn
--
-- 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 3 of the License, or
-- (at your optio... | lambda-11235/ttyped | src/Check.hs | gpl-3.0 | 5,050 | 0 | 16 | 1,152 | 1,606 | 791 | 815 | 82 | 3 |
module Hadolint.Rule.DL3036 (rule) where
import Hadolint.Rule
import qualified Hadolint.Shell as Shell
import Language.Docker.Syntax
rule :: Rule Shell.ParsedShell
rule = simpleRule code severity message check
where
code = "DL3036"
severity = DLWarningC
message = "`zypper clean` missing after zypper use... | lukasmartinelli/hadolint | src/Hadolint/Rule/DL3036.hs | gpl-3.0 | 733 | 0 | 13 | 155 | 189 | 103 | 86 | 16 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-file/gen/Network/Google/Resource/File/Projects/Locations/Instances/Delete.hs | mpl-2.0 | 4,976 | 0 | 15 | 1,069 | 697 | 408 | 289 | 103 | 1 |
import Data.Char (digitToInt)
safeHead [] = Nothing
safeHead (x:xs) = Just x
safeTail [] = Nothing
safeTail (x:xs) = Just xs
safeLast [] = Nothing
safeLast [x] = Just x
safeLast (x:xs) = safeLast xs
safeInit [] = Nothing
safeInit [x] = Just []
safeInit (x:xs) = safeCons x (safeInit xs)
where
safeCons _ Nothin... | wginolas/playground | haskell/rwh/ch04/ch04.hs | lgpl-3.0 | 1,013 | 2 | 10 | 244 | 518 | 258 | 260 | 32 | 2 |
module Helpers.ChessSequences (chessMoveCounter, queenN, queenNW, queenW, queenSW, kingN, kingNW, kingW, kingSW) where
import Data.MemoCombinators (memo2, integral)
-- Speed this up by keeping row/column/diagonal sums locally.
chessMoveCounter :: (Integer -> Integer -> [(Integer, Integer)]) -> Integer -> Integer -> In... | peterokagey/haskellOEIS | src/Helpers/ChessSequences.hs | apache-2.0 | 912 | 0 | 13 | 220 | 485 | 265 | 220 | 17 | 4 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import ClassyPrelude
import Conduit
import Data.Conduit
import Filesystem
import Concord.IO
import Concord.Types
import Opts
import Types
main :... | erochest/concord | Main.hs | apache-2.0 | 716 | 0 | 14 | 289 | 142 | 73 | 69 | 23 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.