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 OverloadedStrings #-}
-- | Module: System.Linux.Cgroups.CpuAcct
-- Author: Alexander Vershilov <alexander.vershilov@gmail.com>
-- License: BSD
--
-- The CPU accounting controller is used to group tasks using cgroups and
-- account the CPU usage of these groups of tasks.
--
-- The CPU accounting c... | qnikst/cgroups-hs | System/Linux/Cgroups/Subsystem/CpuAcct.hs | bsd-3-clause | 2,673 | 0 | 10 | 567 | 415 | 252 | 163 | 38 | 1 |
{-# LANGUAGE CPP, FlexibleInstances, BangPatterns, ViewPatterns #-}
#if __GLASGOW_HASKELL__ >= 700
{-# OPTIONS -fllvm #-}
#endif
module Data.TrieMap.RadixTrie.Zipper () where
import Data.TrieMap.RadixTrie.Base
#define V(f) f (VVector) (k)
#define U(f) f (PVector) (Word)
#define LOC(args) !(locView -> Loc args)
#defin... | lowasser/TrieMap | Data/TrieMap/RadixTrie/Zipper.hs | bsd-3-clause | 1,613 | 8 | 11 | 340 | 557 | 282 | 275 | -1 | -1 |
module Main where
import Geo.Garmin.OsmAustralia
import System.FilePath
import System.Command
import System.Directory
import System.Environment
import Control.Monad
main ::
IO ()
main =
do a <- getArgs
case a of
[] -> putStrLn "Usage: osmgarmin <output-dir>" >> exitWith (exitCode 107)
(o:_) -> ... | tonymorris/osmaustralia | Main.hs | bsd-3-clause | 631 | 0 | 23 | 254 | 186 | 94 | 92 | 17 | 2 |
-- | This is the syntax for bkp files which are parsed in 'ghc --backpack'
-- mode. This syntax is used purely for testing purposes.
module BkpSyn (
-- * Backpack abstract syntax
HsUnitId(..),
LHsUnitId,
HsModuleSubst,
LHsModuleSubst,
HsModuleId(..),
LHsModuleId,
HsComponentId(..),
... | snoyberg/ghc | compiler/backpack/BkpSyn.hs | bsd-3-clause | 2,371 | 0 | 12 | 614 | 470 | 282 | 188 | 45 | 0 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UnicodeSyntax #-}
{-|
[@ISO639-1@] gv
[@ISO639-2@] glv
[@ISO639-3@] glv
[@Native name@] Gaelg
[@English name@] Manx
-}
... | telser/numerals | src-test/Text/Numeral/Language/GLV/TestData.hs | bsd-3-clause | 4,691 | 0 | 8 | 1,365 | 1,077 | 721 | 356 | 122 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
module Hans.Layer.Tcp.Socket (
-- * Socket Layer
Socket()
, SocketError(..)
, listenPort
, acceptSocket
, connect
, sendSocket
, closeSocket
, readBytes
, readLine
) where
import Hans.Address.IP4
import Hans.Channel
import Hans.Layer
import Hans.Layer.Tcp.... | Tener/HaNS | src/Hans/Layer/Tcp/Socket.hs | bsd-3-clause | 6,132 | 0 | 23 | 1,524 | 2,035 | 1,016 | 1,019 | 153 | 4 |
{-# LANGUAGE RecordWildCards, PatternGuards #-}
module Text.HTML.TagSoup.Specification(parse) where
import Text.HTML.TagSoup.Implementation
import Data.Char (isAlpha, isAlphaNum, isDigit, toLower)
-- We make some generalisations:
-- <!name is a valid tag start closed by >
-- <?name is a valid tag start closed by ?>
... | ndmitchell/tagsoup | src/Text/HTML/TagSoup/Specification.hs | bsd-3-clause | 10,765 | 0 | 14 | 2,824 | 4,171 | 1,981 | 2,190 | 210 | 10 |
module Main where
import Test.Hspec
import Data.Dfa.EquivalenceSpec
import Parser.BuildSpec
import Parser.DfaSpec
import ProgramExecutionSpec
main :: IO ()
main
= hspec $ do
rtSpec
parseSpec
dfaSpec
equivalenceSpec
isomorphismSpec
... | qfjp/csce_dfa_project_test | test/SpecMain.hs | bsd-3-clause | 344 | 0 | 7 | 119 | 65 | 34 | 31 | 15 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Turtle
import Turtle.Options.Scale (Scale, optScale, defScaleHelp)
import Turtle.Options.Percentage (optPercentage, defPercentageHelp)
import Turtle.Options.Quality (optQuality, defQualityHelp)
import Turtle.Options.Timecode (Timecode, optTimecode, defTimeco... | elaye/turtle-options | app/Main.hs | bsd-3-clause | 883 | 0 | 9 | 152 | 251 | 138 | 113 | 19 | 1 |
{-# Language PatternGuards #-}
module Blub
( f
) where
import Ugah.Foo
import Control.Applicative
f :: Int -> Int
f i = i + 3
| dan-t/hsimport | tests/goldenFiles/ReplaceCppTest3.hs | bsd-3-clause | 136 | 0 | 5 | 35 | 41 | 24 | 17 | 7 | 1 |
module Ant.Influence
( lookupInfluence
, makeInfluenceTable
, makeDistanceTable
, makeInfluenceMap
, makeDistanceMap
, moveIndex
, DistanceTable
, InfluenceTable
)
where
import Ant.Map
import Ant.Point
import Ant.RegionBuilder
import Ant.IO
import Ant.Squar... | Saulzar/Ants | Ant/Influence.hs | bsd-3-clause | 3,338 | 0 | 21 | 991 | 1,209 | 650 | 559 | 75 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE TypeOperators #-}
module DTypes.Classes.DApplicative
( DApplicative (..)
, dpureTrafo
, dliftA1, dliftA2, dliftA3, dliftA4, dliftA5, dliftA6, dliftA7, dliftA8
) where
import DTypes.Classes.DFunctor
import DTypes.Compose
i... | timjb/ftypes | src/DTypes/Classes/DApplicative.hs | mit | 3,609 | 0 | 17 | 1,068 | 2,036 | 996 | 1,040 | 96 | 1 |
module RegisteredUser where
newtype UserName =
UserName String
newtype AccountNumber =
AccountNumber Integer
data User =
UnregisteredUser
| RegisteredUser UserName AccountNumber
printUser :: User -> IO ()
printUser UnregisteredUser =
putStrLn "UnregisteredUser"
printUser (RegisteredUser
... | brodyberg/Notes | ProjectRosalind.hsproj/LearnHaskell/lib/HaskellBook/RegisteredUser2.hs | mit | 429 | 0 | 9 | 107 | 102 | 54 | 48 | 15 | 1 |
module Graphics.ArrayObjects where
import Graphics.Rendering.OpenGL
makeArrayObject :: IO VertexArrayObject
makeArrayObject = genObjectName
withArrayObjectBound :: VertexArrayObject -> IO () -> IO ()
withArrayObjectBound vao m = do
bindVertexArrayObject $= Just vao
m
bindVertexArrayObject $= Nothing
| sgillis/HaskHull | src/Graphics/ArrayObjects.hs | gpl-3.0 | 316 | 0 | 8 | 49 | 78 | 39 | 39 | 9 | 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-ec2/gen/Network/AWS/EC2/AllocateAddress.hs | mpl-2.0 | 5,494 | 0 | 14 | 1,144 | 802 | 480 | 322 | 94 | 1 |
{-
Copyright 2012-2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... | mzero/plush | src/Plush/Run/BuiltIns/Utilities.hs | apache-2.0 | 3,995 | 0 | 12 | 699 | 787 | 426 | 361 | 41 | 1 |
module ListSpec where
import Control.Applicative
import Language.Haskell.GhcMod
import Test.Hspec
import TestUtils
spec :: Spec
spec = do
describe "modules" $ do
it "contains at least `Data.Map'" $ do
mdls <- runD $ lines <$> modules
mdls `shouldContain` ["Data.Map"]
| cabrera/ghc-mod | test/ListSpec.hs | bsd-3-clause | 306 | 0 | 15 | 76 | 80 | 43 | 37 | 11 | 1 |
------------------------------------------------------------------------------
--- Knowledge-based Autonomic Heterogeneous Networks (KAHN)
--- @author Rajesh Krishnan, Cosocket LLC
--- @version September 2014
------------------------------------------------------------------------------
{-
Copyright (c) 2014, Cosocket... | Cosocket-LLC/kahn | v2.0/src/KAHN/TimerManager.hs | bsd-3-clause | 2,976 | 0 | 14 | 527 | 476 | 258 | 218 | 24 | 2 |
{-# LANGUAGE Haskell98 #-}
{-# LINE 1 "src/Data/Ratio/Compat.hs" #-}
{-# LANGUAGE CPP, NoImplicitPrelude #-}
module Data.Ratio.Compat (
module Base
) where
import Data.Ratio as Base
| phischu/fragnix | tests/packages/scotty/Data.Ratio.Compat.hs | bsd-3-clause | 235 | 0 | 4 | 78 | 23 | 17 | 6 | 6 | 0 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE Unsafe #-}
{-# OPTIONS_HADDOCK not-home #-}
-------------------------------------------------------------------------... | snoyberg/ghc | libraries/base/GHC/Natural.hs | bsd-3-clause | 22,152 | 0 | 13 | 5,388 | 4,646 | 2,346 | 2,300 | 165 | 1 |
{-# LANGUAGE DeriveFunctor, FlexibleInstances, MultiParamTypeClasses, TemplateHaskell, GeneralizedNewtypeDeriving #-}
module Graphics.UI.Bottle.Widget
( module Graphics.UI.Bottle.WidgetId
, Widget(..), MEnter, R, Size
, EnterResult(..), enterResultEvent, enterResultRect
, EventHandlers
, EventResult(..), even... | schell/lamdu | bottlelib/Graphics/UI/Bottle/Widget.hs | gpl-3.0 | 5,909 | 0 | 14 | 1,090 | 1,824 | 1,004 | 820 | -1 | -1 |
{-# LANGUAGE DataKinds #-}
module Math.Hclaws.Systems.ShallowWater (
system,
solution1,
solution2, solution3, solution4, solution5,
) where
import Data.Proxy
import Math.FTensor.Algebra
import Math.FTensor.General as F
import Math.Hclaws.Fan
import Math.Hclaws.ConservationLaws
h :: F.TensorBoxed '[2] D... | mikebenfield/hclaws | src/Math/Hclaws/Systems/ShallowWater.hs | isc | 5,383 | 0 | 19 | 1,798 | 3,061 | 1,583 | 1,478 | 142 | 1 |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANG... | agrafix/Spock-rest | src/Web/Spock/Rest.hs | mit | 9,564 | 0 | 31 | 3,233 | 2,500 | 1,335 | 1,165 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Network.Neks.Message (formatRequests, parseResponses)
import Network.Neks.NetPack (netWrite, netRead)
import Network.Neks.Actions (Request(Set, Get, Delete, Atomic), Reply(Found, NotFound))
import qualified Network as Net
import System.IO (Handle)
import Sy... | wyager/Neks | Network/Neks/NeksClient.hs | mit | 4,417 | 0 | 19 | 1,095 | 1,191 | 654 | 537 | 60 | 6 |
{-# LANGUAGE OverloadedStrings #-}
module Shiva.Server (
runServer,
testServer
) where
import Paths_shiva (getDataFileName)
import Shiva.Config
import Shiva.Execute
import Shiva.HTML
import Shiva.Sources
import Control.Monad.Except (runExceptT)
import Control.Monad.IO.Class (lif... | BlackBrane/shiva | src/Shiva/Server.hs | mit | 2,539 | 0 | 14 | 611 | 657 | 329 | 328 | 54 | 2 |
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
module Control.Monad.Future.Async
( AsyncT, Async
, future, future_
, runAsyncT, runAsync
, execAsyncT, execAsync
, evalAsyncT, evalAsync
) where
import Control.Applicative
import Control.Arrow
import Control.Monad
im... | pxqr/monad-future | Control/Monad/Future/Async.hs | mit | 6,848 | 0 | 11 | 1,629 | 1,098 | 634 | 464 | 77 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Rx.Logger.TestLogLevelParser where
import Control.Monad (forM_)
import qualified Data.Set as Set
import qualified Data.Text as Text
import Test.Hspec
import Test.HUnit (assertBool, assertFailure)
import Rx.Logger.LogLevelParser
import Rx.Logger.Types
all... | roman/Haskell-Reactive-Extensions | rx-logger/test/Rx/Logger/TestLogLevelParser.hs | mit | 2,158 | 0 | 18 | 608 | 492 | 246 | 246 | 52 | 2 |
{-# htermination intersect :: [(Ratio Int)] -> [(Ratio Int)] -> [(Ratio Int)] #-}
import List
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/List_intersect_9.hs | mit | 94 | 0 | 3 | 15 | 5 | 3 | 2 | 1 | 0 |
module ArgsParserSpec (main, spec) where
import Data.List
import Test.Hspec
import ArgsParser
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "help" $ do
it "contains correct execution command line" $ do
help `shouldSatisfy` ("calculator -n:SAMPLE expr1 [expr2..n]" `isInfixOf`)
desc... | DominikJaniec/LearnHaskell | problems/calculator/test/ArgsParserSpec.hs | mit | 1,232 | 0 | 19 | 290 | 355 | 185 | 170 | -1 | -1 |
-- MakeLowerCase
-- https://www.codewars.com/kata/57a059d753ba33229500001a
module MakeLower where
import Data.Char (toLower)
makeLowerCase :: String -> String
makeLowerCase = map toLower
| gafiatulin/codewars | src/8 kyu/MakeLower.hs | mit | 190 | 0 | 5 | 22 | 33 | 20 | 13 | 4 | 1 |
-- Project Euler Problem 5 - Smallest multiple
--
-- Smallest positive number evenly divisible by all of the numbers from 1 to 20
--
import Data.List
-- Note coprimes assumes the input list is sorted
coprimes :: (Integral a) => [a] -> [a]
coprimes [] = []
coprimes [x] = [x]
coprimes (x:xs) = x:(coprimes (xs \\ [2*x,... | yunwilliamyu/programming-exercises | project_euler/p005_lcm.hs | cc0-1.0 | 885 | 2 | 14 | 181 | 411 | 226 | 185 | 13 | 2 |
module Configuration where
nnConfiguration :: [Int]
nnConfiguration = [2, 6, 4, 3]
initMagnitude :: Double
initMagnitude = 10
mutationRate :: Double
mutationRate = 0.05
mutationTypeThreshold :: Double
mutationTypeThreshold = 0.9
additiveMutationMagnitude :: Double
additiveMutationMagnitude = 0.1
destructiveMutati... | mrlovre/super-memory | Pro7/src/Configuration.hs | gpl-3.0 | 550 | 0 | 5 | 76 | 119 | 73 | 46 | 21 | 1 |
{-# LANGUAGE ScopedTypeVariables, OverloadedStrings #-}
module Ampersand.FSpec.ToFSpec.Calc
( deriveProofs
, showProof, showPrf, conjuncts
, quadsOfRules
) where
import Ampersand.Basics
import Ampersand.Classes
import Ampersand.ADL1
import ... | AmpersandTarski/ampersand | src/Ampersand/FSpec/ToFSpec/Calc.hs | gpl-3.0 | 4,227 | 0 | 21 | 1,277 | 1,221 | 649 | 572 | 65 | 3 |
----------------------------------------------------------------------
-- |
-- Module : Text.TeX.Parser.Core
-- Copyright : 2015-2017 Mathias Schenner,
-- 2015-2016 Language Science Press.
-- License : GPL-3
--
-- Maintainer : mschenner.dev@gmail.com
-- Stability : experimental
-- Port... | synsem/texhs | src/Text/TeX/Parser/Core.hs | gpl-3.0 | 1,399 | 0 | 8 | 253 | 219 | 131 | 88 | 16 | 2 |
{-|
Module : Craeft.Lexer
Description : A Parsec-based lexical analyzer for Craeft.
Copyright : (c) Ian Kuehne, 2017
License : GPL-3
Maintainer : ikuehne@caltech.edu
Stability : experimental
-}
module Craeft.Lexer where
import qualified Data.Char as Char
import Control.Monad
import ... | ikuehne/craeft-hs | lib/Craeft/Lexer.hs | gpl-3.0 | 2,489 | 0 | 11 | 676 | 758 | 406 | 352 | 66 | 1 |
myButLast :: [a] -> a
myButLast xs = xs !! (length xs - 2)
| medik/lang-hack | Haskell/Ninety-Nine_Haskell_Problems/2.hs | gpl-3.0 | 59 | 0 | 8 | 14 | 35 | 18 | 17 | 2 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
module CFG5 where
import Prelude hiding ((++))
import Control.Monad
import HipSpec
(++) :: [a] -> [a] -> [a]
(x:xs) ++ ys = x:(xs ++ ys)
[] ++ ys = ys
data E = T :+: E | Term T
deriving (Typeable,Eq,Ord,Show)
data T = TX | TY
deriving (Typeable,Eq,Ord,Show)
data Tok = C ... | danr/hipspec | examples/CFG5.hs | gpl-3.0 | 1,360 | 0 | 15 | 363 | 751 | 404 | 347 | 42 | 1 |
module TermTest where
import Language.Arith.Eval
import Language.Arith.Syntax
import Test.QuickCheck
instance Arbitrary Term where
arbitrary = undefined
| juanbono/tapl-haskell | arith/test/TermTest.hs | gpl-3.0 | 159 | 0 | 5 | 22 | 34 | 21 | 13 | 6 | 0 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
-- Request and related data types
module Web.BitTorrent.Tracker.Types.Request where
import qualified Data.Sequence as Sequence
import Data.Int (Int32, Int64)
import Web.BitTorrent.Tracker.Types.Common
... | greatest-ape/hs-bt-tracker | src/Web/BitTorrent/Tracker/Types/Request.hs | gpl-3.0 | 1,892 | 0 | 12 | 412 | 438 | 251 | 187 | 81 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-chat/gen/Network/Google/Resource/Chat/Media/Download.hs | mpl-2.0 | 5,468 | 0 | 26 | 1,452 | 906 | 508 | 398 | 125 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
-- |
-- Module : Network.Google.Blogger
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : Mozilla Publ... | rueshyna/gogol | gogol-blogger/gen/Network/Google/Blogger.hs | mpl-2.0 | 12,901 | 0 | 36 | 3,320 | 1,707 | 1,239 | 468 | 350 | 0 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | rueshyna/gogol | gogol-iam/gen/Network/Google/Resource/IAM/Projects/ServiceAccounts/List.hs | mpl-2.0 | 6,726 | 0 | 20 | 1,623 | 1,036 | 598 | 438 | 145 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-toolresults/gen/Network/Google/Resource/ToolResults/Projects/Histories/Create.hs | mpl-2.0 | 4,314 | 0 | 15 | 939 | 476 | 287 | 189 | 73 | 1 |
{-# LANGUAGE CPP #-}
module Utils where
import Control.Monad
import Control.Arrow
import Control.Applicative
import Control.Exception
import Data.Bool
import Data.List
import Data.Char
import Data.Either
import qualified Data.Foldable as F
import qualified Data.Traversable as F
import qualified Data.ByteString.Lazy as... | DanielG/kvm-in-a-box | src/Utils.hs | agpl-3.0 | 7,980 | 0 | 20 | 2,115 | 3,402 | 1,764 | 1,638 | -1 | -1 |
{- |
Module : $Header$
Description : This is the main tempuhs file. It is meant to export all the
functionality you would normally want to use when making a
tempuhs implementation.
The Internal module should not be imported in your
implementation, but ... | plaimi/tempuhs | src/Tempuhs/Chronology.hs | agpl-3.0 | 660 | 0 | 4 | 193 | 34 | 24 | 10 | 5 | 0 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Language.Haskell.TokenUtils.DualTree (
renderLayoutTree
, layoutTreeToSourceTree
, retrieveLinesFromLayoutTree
, retrieveLines
, renderLines
, renderSourceTree
, SourceTree
, Line(..... | alanz/haskell-token-utils | src/Language/Haskell/TokenUtils/DualTree.hs | unlicense | 16,929 | 4 | 19 | 4,301 | 4,120 | 2,200 | 1,920 | 233 | 9 |
-- Copyright 2017 gRPC authors.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to i... | grpc/grpc-haskell | src/Network/Grpc/Lib/ChannelArgs.hs | apache-2.0 | 6,078 | 0 | 8 | 913 | 659 | 388 | 271 | 77 | 2 |
-- This approach is very straightforward. We just use two separate
-- databases. We have one database for production, called
-- "production.sqlite", and one database for testing, called
-- "testing.sqlite". The database name is specified in the 'main'
-- function.
{-# LANGUAGE ConstraintKinds #-}
{-# LA... | cdepillabout/testing-code-that-accesses-db-in-haskell | with-db/testing-db/src/Lib.hs | apache-2.0 | 7,822 | 0 | 19 | 1,802 | 999 | 590 | 409 | 84 | 2 |
module ListUtils where
import Data.Monoid
dropLast :: Int -> [a] -> [a]
dropLast n = reverse. drop n. reverse
takeLast :: Int -> [a] -> [a]
takeLast n = reverse. take n. reverse
-- vector minus
vecminus :: Num a => [a] -> [a] -> [a]
vecminus = zipWith (-)
-- element-wise min
vecmin x = map (min x)
fconcat :: [(a -... | epeld/zatacka | old/ListUtils.hs | apache-2.0 | 376 | 0 | 8 | 81 | 182 | 99 | 83 | 11 | 1 |
module Codewars.Kata.SIGT where
import Prelude hiding (read, reads, readsPrec, Integer, fromIntegral, fromInteger, toInteger)
import Data.Char
stringIntGreaterThan :: String -> String -> Bool
stringIntGreaterThan a b = if a == b then
False
else
... | lisphacker/codewars | SIGT.hs | bsd-2-clause | 1,425 | 0 | 12 | 749 | 311 | 166 | 145 | 20 | 10 |
--
-- Copyright (c) 2013, Carl Joachim Svenn
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- 1. Redistributions of source code must retain the above copyright notice... | karamellpelle/MEnv | source/MEnv/System/GLFW.hs | bsd-2-clause | 2,128 | 0 | 7 | 468 | 174 | 102 | 72 | 19 | 1 |
{-# LANGUAGE OverloadedStrings #-}
import System.IO
import Text.XML.Pipe
import Network
import Network.PeyoTLS.ReadFile
import Network.XmlPush.HttpPush.Tls
import qualified Data.ByteString.Char8 as BSC
import TestPusher
main :: IO ()
main = do
ca <- readCertificateStore ["certs/cacert.sample_pem"]
k' <- readKey "... | YoshikuniJujo/xml-push | examples/httpPushTlsE.hs | bsd-3-clause | 1,286 | 16 | 14 | 206 | 492 | 258 | 234 | 37 | 1 |
{-# LANGUAGE BangPatterns #-}
module Lookup(lookupTiles,withTemplate,withTemplates,Score,Val,Count,Hist(..),HandTiles(..)) where
import qualified Data.IntMap as M
import Data.Array.IArray((!))
--import Data.List(group,sort)
import Data.Monoid(Monoid(..))
--import Data.Ix(inRange)
import Data.Char (toLower)
import Data... | ChrisKuklewicz/XWords | src/Lookup.hs | bsd-3-clause | 7,088 | 0 | 18 | 2,005 | 2,984 | 1,575 | 1,409 | 163 | 5 |
{-# LANGUAGE FlexibleContexts #-}
module Rash.IR.Bash2Rough
( translate
, convertList
) where
import qualified Data.Data
import Data.Generics.Uniplate.Data (rewriteBi)
import qualified Data.Maybe as Maybe
import qualified Data.Typeable as Typeable
import qualified L... | pbiggar/rash | src/Rash/IR/Bash2Rough.hs | bsd-3-clause | 21,423 | 0 | 18 | 4,700 | 6,835 | 3,504 | 3,331 | 344 | 40 |
{-# LANGUAGE TypeFamilies #-}
module FPNLA.Operations.Parameters(
-- * Elements
Elt(..),
-- * Strategies and contexts
StratCtx(),
-- * Result type
-- | In BLAS it's common that operations in higher levels use operations in the lower levels, so, an operation in level three that by its signature... | mauroblanco/fpnla | src/FPNLA/Operations/Parameters.hs | bsd-3-clause | 8,055 | 0 | 13 | 1,631 | 1,667 | 902 | 765 | 111 | 1 |
-- http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_4_B
-- Circle
-- input: 2
-- output: 12.566371 12.566371
import Control.Applicative
import Data.Fixed
main = do
r <- (read :: String -> Double) <$> getLine
putStrLn $ unwords $ show . toFixedE9 <$> [(pi*r^2), (2*pi*r)]
toFixedE9 :: Double -> ... | ku00/aoj-haskell | src/ITP1_4_B.hs | bsd-3-clause | 368 | 0 | 11 | 64 | 117 | 63 | 54 | 7 | 1 |
module Frontend
(
ec2Properties
, s3Properties
, r53Properties
, cfProperties
, rdsProperties
, dbProperties
, ecProperties
, vpcProperties
, lsProperties
) where
import Frontend.Properties.EC2
import Frontend.Properties.S3
import Frontend.Properties.R53
import Frontend.Properties.CF
import ... | Rizary/awspi | Lib/Frontend.hs | bsd-3-clause | 465 | 0 | 4 | 67 | 87 | 58 | 29 | 20 | 0 |
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}
module Visualization.Queue.RealTime (rtQueueVis) where
import Visualization.Common
import VisualizationData.Thunk
import qualif... | timjb/pfds-visualizations | src/Visualization/Queue/RealTime.hs | bsd-3-clause | 3,731 | 0 | 17 | 781 | 1,127 | 568 | 559 | 97 | 6 |
module Patch where
import Catalogue
import Control.Applicative
import Control.Monad
import CSV
import qualified Data.EdgeLabeledGraph as G -- TMP!
import Data.List
import Data.Maybe
import qualified Data.Set as S
import System.Directory
import System.Environment
import System.FilePath
import Data.Tree
import Debug.... | jsnajder/fer3-catalogue | src/Patch.hs | bsd-3-clause | 6,904 | 0 | 17 | 1,878 | 2,488 | 1,337 | 1,151 | 142 | 5 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeFamilies #-}
-- | <http://www.libtorrent.org/reference-Core.html#block-info block_info> structure for "Libtorrent"
module Network.Libtorrent.TorrentHandle.Blo... | eryx67/haskell-libtorrent | src/Network/Libtorrent/TorrentHandle/BlockInfo.hs | bsd-3-clause | 3,265 | 0 | 9 | 955 | 549 | 316 | 233 | 58 | 1 |
module Embot
( module Export
) where
import Embot.Action as Export
import Embot.Config as Export
import Embot.Driver as Export
import Embot.Types as Export
| Dridus/embot | src/Embot.hs | bsd-3-clause | 165 | 0 | 4 | 32 | 38 | 27 | 11 | 6 | 0 |
{-# LANGUAGE
TypeOperators
, GADTs
, KindSignatures
, FlexibleContexts
, RankNTypes
, ScopedTypeVariables
#-}
module Data.Morphism.Apomorphism where
-- import Control.Applicative
import Control.Monad hiding (mapM)
import Control.Monad.Identity
import Data.Annotation
import Data.Fixpoint
import Data.Ide... | sebastiaanvisser/fixpoints | src/Data/Morphism/Apomorphism.hs | bsd-3-clause | 1,026 | 0 | 13 | 198 | 376 | 203 | 173 | -1 | -1 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
\section[TcType]{Types used in the typechecker}
This module provides the Type interface for front-end parts of the
compiler. These parts
* treat "source types" as opaque:
newtypes, and predicates ... | AlexeyRaga/eta | compiler/ETA/TypeCheck/TcType.hs | bsd-3-clause | 70,176 | 0 | 15 | 18,673 | 12,825 | 6,728 | 6,097 | -1 | -1 |
{- Data/Singletons/Names.hs
(c) Richard Eisenberg 2014
eir@cis.upenn.edu
Defining names and manipulations on names for use in promotion and singling.
-}
{-# LANGUAGE TemplateHaskell #-}
module Data.Singletons.Names where
import Data.Singletons
import Data.Singletons.SuppressUnusedWarnings
import Data.Singletons.De... | int-index/singletons | src/Data/Singletons/Names.hs | bsd-3-clause | 7,886 | 1 | 15 | 1,439 | 1,820 | 1,030 | 790 | -1 | -1 |
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE OverloadedStrings #-}
module Develop (run) where
import Control.Applicative ((<|>))
import Control.Concurrent (threadDelay)
import Control.Monad (guard)
import Control.Monad.Trans (MonadIO(liftIO))
import qualified Data.HashMap.Strict as HashMap
import qualified Data.ByteString.C... | evancz/cli | src/Develop.hs | bsd-3-clause | 6,694 | 0 | 19 | 1,641 | 1,609 | 854 | 755 | 178 | 2 |
-- Example of Multiple Type Binding
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE Undeci... | notae/haskell-exercise | pack/MultiTypeBinding.hs | bsd-3-clause | 7,209 | 0 | 12 | 1,844 | 2,197 | 1,191 | 1,006 | 172 | 1 |
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE DataKinds #-... | xicesky/sky-haskell-playground | src/Sky/Compositional/PolyKindCats.hs | bsd-3-clause | 2,553 | 0 | 11 | 721 | 789 | 417 | 372 | 48 | 1 |
-----------------------------------------------------------------------------
-- |
-- License : BSD-3-Clause
-- Maintainer : Oleg Grenrus <oleg.grenrus@iki.fi>
--
module GitHub.Data.GitData where
import GitHub.Data.Definitions
import GitHub.Data.Name (Name)
import GitHub.Data.URL (URL)
import Git... | jwiegley/github | src/GitHub/Data/GitData.hs | bsd-3-clause | 8,572 | 0 | 33 | 2,458 | 2,568 | 1,357 | 1,211 | 399 | 0 |
{-# LANGUAGE DeriveDataTypeable#-}
module Main where
import Control.Monad
import Data.Generics
import Data.List
import Iptables
import Iptables.Parser
import Iptables.Print
import Iptables.Types
import Iptables.Types.Arbitrary
import System.Console.GetOpt
import System.Environment
import System.Exit
import Test.Quick... | etarasov/iptables-helpers | src/Test.hs | bsd-3-clause | 5,120 | 0 | 18 | 1,799 | 1,643 | 813 | 830 | 116 | 5 |
{-# LANGUAGE CPP #-}
{-# OPTIONS_HADDOCK hide #-}
module Distribution.Compat.CopyFile (
copyFile,
filesEqual,
copyOrdinaryFile,
copyExecutableFile,
setFileOrdinary,
setFileExecutable,
setDirOrdinary,
) where
import Control.Applicative
( (<$>), (<*>) )
import Control.Monad
( when )
im... | fpco/cabal | Cabal/Distribution/Compat/CopyFile.hs | bsd-3-clause | 3,254 | 0 | 19 | 808 | 783 | 428 | 355 | -1 | -1 |
module ZipTest where
--import Base
import PreludeIO
class Zip a b c where
z :: a -> b -> c
instance Zip [a] [b] [(a,b)] where
z = []
instance Zip [(a,b)] c_d e => Zip [a] [b] (c_d->e) where
z as bs c_d = z (z as bs) c_d
test = do print ( z [1] [2] )
print ( z [1] [2] [3])
print ( z [1] ... | rodrigogribeiro/mptc | src/Libs/ZipTest.hs | bsd-3-clause | 334 | 0 | 10 | 106 | 218 | 118 | 100 | -1 | -1 |
module Ho.Collected(
CollectedHo(..),
choDataTable,
choClassHierarchy,
choTypeSynonyms,
choFixities,
choAssumps,
choRules,
choEs,
updateChoHo
)where
import Control.Monad.Identity
import Data.List
import Data.Monoid
import DataConstructors
import E.Annotate
import E.E
import Ho.... | dec9ue/jhc_copygc | src/Ho/Collected.hs | gpl-2.0 | 2,775 | 0 | 17 | 666 | 941 | 514 | 427 | 64 | 2 |
{-# LANGUAGE FlexibleInstances, FlexibleContexts, TypeFamilies,
MultiParamTypeClasses, GeneralizedNewtypeDeriving,
StandaloneDeriving #-}
{-| A pure implementation of MonadLog using MonadWriter
-}
{-
Copyright (C) 2014 Google Inc.
All rights reserved.
Redistribution and use in source and ... | apyrgio/ganeti | src/Ganeti/Logging/WriterLog.hs | bsd-2-clause | 4,387 | 0 | 11 | 795 | 668 | 370 | 298 | 63 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Data.Set
-- Copyright : (c) Daan Leijen 2002
-- License : BSD-style
-- Maintainer : libraries@haskell.org
-- Stability : provisional
-- Portability : portable
--
-- An efficient implementation of sets.
--
... | alekar/hugs | packages/base/Data/Set.hs | bsd-3-clause | 38,039 | 0 | 18 | 9,708 | 7,651 | 3,856 | 3,795 | -1 | -1 |
{-|
Module : Data.STM.PriorityQueue.Internal.THeapPQ
Description : STM-based Concurrent Priority Queue data structure class implementation
Copyright : (c) Alex Semin, 2015
License : BSD3
Maintainer : alllex.semin@gmail.com
Stability : experimental
Portability : portable
An implementation of 'Data.STM.Pri... | Alllex/stm-data-collection | src/Data/STM/PriorityQueue/Internal/THeapPQ.hs | bsd-3-clause | 2,580 | 0 | 13 | 832 | 1,023 | 501 | 522 | 73 | 2 |
-- (c) The University of Glasgow 2006
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
module Unify (
tcMatchTy, tcMatchTys, tcMatchTyX, tcMatchTysX, tcUnifyTyWithTFs,
ruleMatchTyX,
-- * Rough matching
roughMatchTcs, instanceCantMatch,
t... | oldmanmike/ghc | compiler/types/Unify.hs | bsd-3-clause | 47,551 | 302 | 19 | 13,809 | 7,004 | 3,838 | 3,166 | 549 | 9 |
module Main where
import Data.Version
import Control.Monad
import Data.Monoid
import Prelude
import Language.Futhark.Parser
import Futhark.Version
import Futhark.Passes
import Futhark.Compiler
import Futhark.Util.Options
banner :: String
banner = unlines [
"|// |\\ | |\\ |\\ /",
"|/ | \\ |\\ |\\ |/... | CulpaBS/wbBach | src/futharki.hs | bsd-3-clause | 1,066 | 0 | 8 | 248 | 259 | 133 | 126 | 34 | 3 |
{-
Copyright 2012-2015 Vidar Holen
This file is part of ShellCheck.
http://www.vidarholen.net/contents/shellcheck
ShellCheck 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... | icyfork/shellcheck | ShellCheck/AST.hs | gpl-3.0 | 12,632 | 0 | 16 | 4,147 | 4,547 | 2,230 | 2,317 | 327 | 92 |
module WithCli.ArgumentSpec where
import Data.Proxy
import Test.Hspec
import WithCli.Argument
spec :: Spec
spec = do
describe "Option.Double" $ do
it "parses doubles" $ do
parseArgument "1.2" `shouldBe` Just (1.2 :: Double)
it "renders as NUMBER in help and error outpu... | kosmikus/getopt-generics | test/WithCli/ArgumentSpec.hs | bsd-3-clause | 737 | 0 | 16 | 192 | 206 | 102 | 104 | 18 | 1 |
{-# OPTIONS -XImpredicativeTypes -fno-warn-deprecated-flags -XEmptyDataDecls -XGADTs -XLiberalTypeSynonyms -XFlexibleInstances -XScopedTypeVariables #-}
-- See #1627. The point is that we should get nice
-- compact code for Foo
-- In GHC 7.0 this fails, and rightly so.
module M(foo) where
import C... | sdiehl/ghc | testsuite/tests/simplCore/should_compile/simpl017.hs | bsd-3-clause | 1,830 | 0 | 17 | 572 | 777 | 399 | 378 | -1 | -1 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.InstallSymlink
-- Copyright : (c) Duncan Coutts 2008
-- License : BSD-like
--
-- Maintainer : cabal-devel@haskell.org
-- Stability : provisional
-- Portability : po... | tolysz/prepare-ghcjs | spec-lts8/cabal/cabal-install/Distribution/Client/InstallSymlink.hs | bsd-3-clause | 11,228 | 0 | 12 | 3,180 | 188 | 113 | 75 | 152 | 4 |
-----------------------------------------------------------------------------
-- |
-- Module : Codec.Archive.Tar.Entry
-- Copyright : (c) 2007 Bjorn Bringert,
-- 2008 Andrea Vezzosi,
-- 2008-2009 Duncan Coutts
-- License : BSD3
--
-- Maintainer : duncan@community.ha... | waldheinz/ads | src/lib/Codec/Archive/Tar/Entry.hs | gpl-3.0 | 2,201 | 0 | 5 | 409 | 168 | 127 | 41 | 33 | 0 |
{-# LANGUAGE TypeFamilies, EmptyDataDecls, FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances, OverlappingInstances, UndecidableInstances #-}
module NonLinearLHS where
type family E a b
type instance E a a = [a]
foo :: E [Int] (E Int Int) -> Int
foo = sum . concat
data family... | frantisekfarka/ghc-dsi | testsuite/tests/indexed-types/should_compile/NonLinearLHS.hs | bsd-3-clause | 848 | 0 | 8 | 170 | 295 | 160 | 135 | -1 | -1 |
module Main (main) where
import Control.Monad.State
import Data.Char
import Data.List
import System.Directory
import System.Environment
import System.FilePath
import BuildInfo
import FilenameDescr
import Change
import Utils
import Tar
-- TODO:
-- * Check installed trees too
-- * Check hashbangs
sizeChangeThresholds... | ghc-android/ghc | distrib/compare/compare.hs | bsd-3-clause | 13,480 | 0 | 20 | 4,596 | 4,254 | 2,149 | 2,105 | 289 | 9 |
{-# LANGUAGE BangPatterns, DataKinds, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Hadoop.Protos.ClientNamenodeProtocolProtos.ConcatResponseProto (ConcatResponseProto(..)) where
import Prelude ((+), (/))
import qualified Prelude as Prelude'
import ... | alexbiehl/hoop | hadoop-protos/src/Hadoop/Protos/ClientNamenodeProtocolProtos/ConcatResponseProto.hs | mit | 2,815 | 1 | 16 | 529 | 554 | 291 | 263 | 53 | 0 |
{-# LANGUAGE CPP #-}
module CommandLoop
( newCommandLoopState
, startCommandLoop
) where
import Control.Monad (when)
import Data.IORef
import Data.List (find, intercalate)
#if __GLASGOW_HASKELL__ < 709
import Data.Traversable (traverse)
#endif
import MonadUtils (MonadIO, liftIO)
import System.Exit (ExitCod... | dan-t/hdevtools | src/CommandLoop.hs | mit | 8,173 | 0 | 18 | 2,398 | 2,208 | 1,107 | 1,101 | 164 | 7 |
import Crypto
import qualified Data.ByteString.Char8 as C8
import qualified Data.ByteString as B
import qualified Data.LargeWord as LGW
import qualified Data.Word as W
crack :: LGW.Word128 -> W.Word64 -> B.ByteString -> B.ByteString
crack key nonce ct = aesCTR key nonce ct
main :: IO ()
main = do
print $ crack (aes... | asib/cryptopals-haskell | s3ch18.hs | mit | 446 | 0 | 12 | 63 | 139 | 75 | 64 | 10 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Database.LEsqueleto.LSql where
import Control.Applicative
import Data.Attoparsec.Text
import qualified Data.Char as Char
import qualified Data.Text as Text
-- | Represent the AST for lsql statements.
data Command = Command {
commandSelect :: Select
, commandTe... | jprider63/LMonad-Yesod | src/Database/LEsqueleto/LSql.hs | mit | 10,442 | 0 | 23 | 4,895 | 2,346 | 1,165 | 1,181 | 250 | 13 |
--this module provides some utility functions for lists
--author: Tristan Bepler (tbepler@gmail.com)
module Utils where
import Data.List
import qualified Data.Map as Map
import qualified Data.Set as Set
rmdups :: Ord a => [a] -> [a]
rmdups = rmdups' Set.empty where
rmdups' _ [] = []
rmdups' a (b:c) = if Set.membe... | tbepler/PBM-Analysis | Utils.hs | mit | 2,559 | 8 | 14 | 591 | 1,345 | 706 | 639 | 57 | 3 |
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE BangPatterns #-}
module Network.WebSockets.Messaging.Connection where
import Network.WebSockets hiding (send, Request, Message)
import Control.Concurrent (forkIO)
import Control.Concurrent.STM
impor... | leonidas/lambda-webdev | lib/Network/WebSockets/Messaging/Connection.hs | mit | 7,321 | 4 | 20 | 1,965 | 2,434 | 1,191 | 1,243 | 183 | 5 |
module S01C06Spec where
import Test.Hspec
import S01C06
main :: IO()
main = hspec spec
spec :: Spec
spec = do
describe "Hamming distance" $ do
it "should correctly calculate the distance between two strings" $ do
let fromstr = "this is a test"
let tostr = "wokka wokka!!!"
... | blast-hardcheese/cryptopals | test/S01C06Spec.hs | mit | 362 | 0 | 15 | 106 | 92 | 46 | 46 | 12 | 1 |
module LC where
missingNumber :: [Int] -> Int
missingNumber [] = 0
missingNumber [_] = 1
missingNumber (x:y:ys) = if y - x == 1 then missingNumber ys else x + 1
| AriaFallah/leetcode | haskell/MissingNumber.hs | mit | 162 | 0 | 8 | 33 | 79 | 43 | 36 | 5 | 2 |
doubleMe x = x + x
doubleSmallNumber x = if x > 100
then x
else x*2
doubleSmallNumber' x = (if x > 100 then x else x*2) + 1
| ikemonn/haskellPractice | LearnYouAHaskell/p5.hs | mit | 174 | 1 | 8 | 80 | 71 | 36 | 35 | 5 | 2 |
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE... | zenhack/haskell-capnp | lib/Capnp/Repr.hs | mit | 8,804 | 0 | 19 | 2,300 | 2,699 | 1,460 | 1,239 | -1 | -1 |
-- Problems/Problem044.hs
module Problems.Problem044 (p44) where
import Data.Set
main = print p44
p44 :: Int
p44 = head [a-b | a <- pentagonal, b <- takeWhile (<a) pentagonal, isPentagonal (a-b), isPentagonal (b+a)]
isPentagonal :: Int -> Bool
isPentagonal = (`Data.Set.member` Data.Set.fromList pentagonal)
pentago... | Sgoettschkes/learning | haskell/ProjectEuler/src/Problems/Problem044.hs | mit | 400 | 0 | 12 | 65 | 181 | 102 | 79 | 9 | 1 |
{-# LANGUAGE TemplateHaskell #-}
module Diagrams.Plots.PlotArea
( P(..)
, PlotArea
, plotAreaWidth
, plotAreaHeight
, plotAreaLeft
, plotAreaRight
, plotAreaTop
, plotAreaBottom
, plotAreaBackground
, plotArea
, showPlot
, placeOn
, (<+)
) where
import Diagrams... | kaizhang/haskell-plot | src/Diagrams/Plots/PlotArea.hs | mit | 3,918 | 0 | 19 | 1,422 | 1,262 | 677 | 585 | 117 | 4 |
{-# LANGUAGE CPP #-}
module GHCJS.DOM.WheelEvent (
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined(USE_WEBKIT)
module GHCJS.DOM.JSFFI.Generated.WheelEvent
#else
module Graphics.UI.Gtk.WebKit.DOM.WheelEvent
#endif
) where
#if (defined(ghcjs_HOST_OS) && defined(USE_JAVASCRIPTFFI)) || !defined... | plow-technologies/ghcjs-dom | src/GHCJS/DOM/WheelEvent.hs | mit | 435 | 0 | 5 | 39 | 33 | 26 | 7 | 4 | 0 |
-- stack script
import Prelude (putStrLn, IO)
import Control.Category
import Control.Arrow
import Data.Either
import Control.Applicative
newtype Apply f a b = Apply (f (a -> b))
-- first of all, Apply forms a category (similar to Kleisli category)
--
instance (Applic... | shouya/thinking-dumps | cat-code/Arrow.hs | mit | 936 | 0 | 10 | 260 | 358 | 187 | 171 | 20 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module IndexController where
import qualified Web.Scotty as S
import qualified IndexViews
import Session (getSession)
app :: S.ScottyM ()
app = do
S.get "/" $ getSession >>= IndexViews.index
| robertjlooby/scotty-story-board | app/controllers/IndexController.hs | mit | 244 | 0 | 10 | 49 | 60 | 35 | 25 | 8 | 1 |
--
-- Copyright (c) 2014 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... | OpenXT/manager | xenmgr/Vm/Config.hs | gpl-2.0 | 41,309 | 0 | 27 | 13,167 | 9,109 | 4,781 | 4,328 | 746 | 27 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.