code stringlengths 5 1.03M | repo_name stringlengths 5 90 | path stringlengths 4 158 | license stringclasses 15
values | size int64 5 1.03M | n_ast_errors int64 0 53.9k | ast_max_depth int64 2 4.17k | n_whitespaces int64 0 365k | n_ast_nodes int64 3 317k | n_ast_terminals int64 1 171k | n_ast_nonterminals int64 1 146k | loc int64 -1 37.3k | cycloplexity int64 -1 1.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
module Main where
import Control.Concurrent
import Control.Concurrent.Throttle
import Control.Monad
main :: IO ()
main = do res <- throttle 5 tasks
putStrLn "-------------"
forM_ res print
where
tasks = map performTask ([1..100] :: [Int])
performTask i = do putStrLn $ "task start " ++ sh... | rodrigosetti/io-throttle | test/Main.hs | mit | 462 | 0 | 10 | 163 | 140 | 69 | 71 | 13 | 1 |
module Language.RuScript.Optimize where
import Language.RuScript.ByteCode
import Language.RuScript.Traversal
-- POP after PUSH optimization
optimize :: [ByteCode] -> [ByteCode]
optimize bs@(PUSH i : POP i' : bs')
| i == i' = bs'
| otherwise = bs
optimize bs = bs
| izgzhen/RuScript | rusc/src/Language/RuScript/Optimize.hs | mit | 278 | 0 | 10 | 54 | 90 | 49 | 41 | 8 | 1 |
module Problem36 where
main = print $ sum $ filter (\n -> (palidrome . show $ n) && (palidrome . toBinary $ n)) [1..999999]
palidrome :: String -> Bool
palidrome s = reverse s == s
toBinary :: (Integral n) => n -> String
toBinary n = binarySub (2^(floor . log2 . fromIntegral $ n)) n
where
log2 n = log... | DevJac/haskell-project-euler | src/Problem36.hs | mit | 590 | 0 | 12 | 191 | 276 | 144 | 132 | 12 | 3 |
{-
- Hanoi 2 "a" "b" "c" = [("a", "c"), ("a", "b"), ("c", "b")]
-}
-- sleeping on it
type Peg = String
type Move = (Peg, Peg)
hanoi :: Integer -> Peg -> Peg -> Peg -> [Move] | mohamedhayibor/haskelling-hard | cs194/towersOfHanoi.hs | mit | 175 | 0 | 9 | 40 | 45 | 27 | 18 | 3 | 0 |
{-# LANGUAGE TemplateHaskell #-}
{-|
Module : Tests.Murl.Api.Urls
Description : murl URL API tests
Copyright : (c) 2016 murl developers
License : MIT
Maintainer : alunduil@alunduil.com
Stability : experimental
Portability : portable
-}
module Tests.Murl.Api.Urls where
import Control.Mona... | alunduil/murl | tests/murl/Tests/Murl/Api/Urls.hs | mit | 1,054 | 0 | 11 | 286 | 232 | 126 | 106 | 19 | 3 |
{-# LANGUAGE FlexibleContexts, FlexibleInstances, OverloadedStrings, MultiWayIf #-}
module Main where
import Control.Applicative
import Control.Arrow
import Control.Concurrent (MVar, newMVar, takeMVar, putMVar, threadDelay)
import Control.Monad (guard)
import Control... | gibiansky/IHaskell | ipython-kernel/examples/Calc.hs | mit | 9,334 | 0 | 16 | 2,276 | 2,890 | 1,507 | 1,383 | 215 | 7 |
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TupleSections #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Od... | schell/odin | odin-engine/src/Odin/Engine/Tiled.hs | mit | 10,217 | 0 | 18 | 2,769 | 3,122 | 1,598 | 1,524 | 232 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ExtendedDefaultRules #-}
{-# LANGUAGE DeriveDataTypeable #-}
module Web.Kirstie.Hooks.TagArchives (tagArchives) where
import Control.Exception
import Control.Monad
import Data.Data (Data, Typeable)
import qualified Data.Map as M
import qual... | hekt/blog-system | src/Web/Kirstie/Hooks/TagArchives.hs | mit | 2,700 | 0 | 16 | 635 | 839 | 442 | 397 | 64 | 2 |
----------------------------------------------------------------------------
-- |
-- Module : Main
-- License : MIT (see LICENSE)
-- Authors : Bit Connor <bit@mutantlemon.com>
--
-- Maintainer : Bit Connor <bit@mutantlemon.com>
-- Stability : unstable
-- Portability : portable
--
-- lushtags, Crea... | bitc/lushtags | src/Main.hs | mit | 3,950 | 0 | 21 | 1,258 | 938 | 515 | 423 | 77 | 3 |
import HuttonsRazor
import Data.List
data Javable = JInt Int | JNew String [Javable]
java (JInt i) = show i
java (JNew cls vals) = "new " ++ cls ++ "(" ++ intercalate "," (map java vals) ++ ")"
toJava HALT = JNew "HaltNode" []
toJava (PUSH i c) = JNew "PushNode" [JInt i, toJava c]
toJava (ADD c) = JNew "AddNode" [t... | orchid-hybrid/JLambda | CodePrinter.hs | gpl-2.0 | 1,449 | 0 | 9 | 228 | 343 | 168 | 175 | 15 | 1 |
{- |
Module : ./OWL2/Extract.hs
Description : extraction of the sign from the frames
Copyright : (c) Francisc-Nicolae Bungiu, Felix Gabriel Mance
License : GPLv2 or higher, see LICENSE.txt
Maintainer : f.bungiu@jacobs-university.de
Stability : provisional
Portability : portable
Extraction of all ... | spechub/Hets | OWL2/Extract.hs | gpl-2.0 | 13,268 | 0 | 17 | 3,701 | 3,874 | 1,731 | 2,143 | 330 | 42 |
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.UI.GLUT.Fonts
-- Copyright : (c) Sven Panne 2002-2005
-- License : BSD-style (see the file libraries/GLUT/LICENSE)
--
-- Maintainer : sven.panne@aedion.de
-- Stability : stable
-- Portability : ... | ducis/haAni | hs/common/Graphics/UI/GLUT/Fonts.hs | gpl-2.0 | 7,979 | 0 | 12 | 1,653 | 844 | 476 | 368 | 76 | 7 |
{-| Unittest runner for ganeti-htools.
-}
{-
Copyright (C) 2009, 2011, 2012, 2013 Google 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) a... | vladimir-ipatov/ganeti | test/hs/htest.hs | gpl-2.0 | 4,258 | 0 | 12 | 730 | 621 | 406 | 215 | 106 | 1 |
{- This module was generated from data in the Kate syntax
highlighting file relaxng.xml, version 0.8, by Thomas Schraitle (tom_schr AT web DOT de) -}
module Text.Highlighting.Kate.Syntax.Relaxng
(highlight, parseExpression, syntaxName, syntaxExtensions)
where
import Text.Highlighting.Kate.Types
import Tex... | ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Relaxng.hs | gpl-2.0 | 6,468 | 0 | 15 | 1,026 | 1,778 | 958 | 820 | 110 | 10 |
module Poker where
data Rank = Two|Three|Four|Five|Six|Seven|Eight|Nine|Ten|J|Q|K|A
deriving (Eq, Ord, Enum, Show, Read)
data Suit = Spades|Hearts|Diamonds|Clubs
deriving (Eq, Show, Read) -- no ordering for poker
data Card = Card Rank Suit
deriving (Show, Read)
... | collective/ECSpooler | backends/haskell/haskell_libs/Poker.hs | gpl-2.0 | 596 | 0 | 9 | 196 | 235 | 128 | 107 | 14 | 0 |
module SIRConcurrent where
import Control.Concurrent
import Control.Monad.STM
import Control.Concurrent.STM.TChan
import System.IO
import System.IO.Unsafe
import System.Random
import Debug.Trace
{-
NOTE: STM can be used in deterministic, non parallel way: only atomically introduces IO. this could be a remedy for pulli... | thalerjonathan/phd | coding/prototyping/haskell/sir/src/SIRConcurrent.hs | gpl-3.0 | 8,299 | 0 | 13 | 1,666 | 2,492 | 1,287 | 1,205 | 173 | 1 |
module Main where
import Application
import PageManager
import Types
import Config
import WebApp
import Control.Monad
import Control.Monad.IO.Class (liftIO)
import Control.Concurrent
import Control.Concurrent.STM
import qualified Network.WebSockets as WS
import System.IO
import Web.Scotty
import System.Posix.User
--... | Cipherwraith/alacrity | src/Main.hs | gpl-3.0 | 1,015 | 0 | 10 | 196 | 168 | 96 | 72 | 21 | 1 |
import TCPPingClient
import TCPPingServer
import Control.Concurrent
main = do
forkIO runServer
threadDelay 1000
forkIO runClient
runClient
threadDelay 1000
| ConnorDillon/haskell-experiments | Main.hs | gpl-3.0 | 181 | 0 | 7 | 43 | 44 | 19 | 25 | 9 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/NodeGroups/SetNodeTemplate.hs | mpl-2.0 | 5,495 | 0 | 19 | 1,255 | 636 | 378 | 258 | 101 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.Composer.Ty... | brendanhay/gogol | gogol-composer/gen/Network/Google/Composer/Types/Product.hs | mpl-2.0 | 78,858 | 0 | 21 | 17,115 | 11,802 | 6,865 | 4,937 | 1,320 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-siteverification/gen/Network/Google/Resource/SiteVerification/WebResource/Delete.hs | mpl-2.0 | 2,742 | 0 | 12 | 592 | 303 | 186 | 117 | 46 | 1 |
module NGramCrackers.Ops.Infixes
(
(<#>)
) where
import qualified Data.Text as T
{-| Infix synonym for T.append. Handy for gluing bits of Text together -}
(<#>) :: T.Text -> T.Text -> T.Text
(<#>) = T.append
| R-Morgan/NGramCrackers | src/NGramCrackers/Ops/Infixes.hs | agpl-3.0 | 211 | 0 | 7 | 37 | 53 | 35 | 18 | 6 | 1 |
module Graphics.CheeseGrater.TestVecMath (unitTests) where
import Data.Maybe (isNothing)
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (assertBool, testCase)
import Test.Tasty.QuickCheck (choose, fo... | lancelet/cheesegrater | tests/Graphics/CheeseGrater/TestVecMath.hs | apache-2.0 | 3,431 | 0 | 11 | 1,074 | 900 | 504 | 396 | 71 | 1 |
module Braxton.A284432 (a284432) where
import Helpers.BraxtonHelper (enumerateSequences, SymmetricRelation(..), ReflexiveRelation(..))
a284432 n = length $ enumerateA284432 n n
enumerateA284432 = enumerateSequences Reflexive NonSymmetric sum
-- (1,1,2,2,4,4,4,48,48,144...)
-- Counts A282168
| peterokagey/haskellOEIS | src/Braxton/A284432.hs | apache-2.0 | 293 | 0 | 6 | 29 | 66 | 39 | 27 | 4 | 1 |
module Identity where
data Identity a = Identity a
-- We can use a type class constraints
-- in instance declarations, ensuring that
-- compiler or REPL understand that the operation
-- (==) applies to values of type a (v, v')
instance Eq a => Eq (Identity a) where
(==) (Identity v) (Identity v') = v == v'
| OCExercise/haskellbook-solutions | chapters/chapter06/scratch/identity.hs | bsd-2-clause | 314 | 0 | 8 | 64 | 67 | 38 | 29 | 4 | 0 |
module Genetic
( module Genetic
) where
import Types
import System.Random
import Control.Lens
import Data.Char
-- A fitness function count how much a program was 'efficient'
-- according to some contrainsts (output, number of instructions, etc…)
type FitnessFunction = State... | Zenol/brainf_gen | Genetic.hs | bsd-2-clause | 2,575 | 0 | 11 | 738 | 694 | 395 | 299 | 55 | 5 |
{-# LANGUAGE DeriveDataTypeable #-}
module Application.Hoodle.Cache.ProgType where
import System.Console.CmdArgs
data Hoodle_cache = Test
deriving (Show,Data,Typeable)
test :: Hoodle_cache
test = Test
mode = modes [test]
| wavewave/hoodle-cache | lib/Application/Hoodle/Cache/ProgType.hs | bsd-2-clause | 244 | 0 | 6 | 48 | 58 | 35 | 23 | 8 | 1 |
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE CPP #-}
module ShakespeareJsTest (specs) where
import Test.HUnit hiding (Test)
import Test.Hspec.Monadic
import Test.Hspec.HUnit ()
import Prelude hiding (reverse)
#ifdef TEST_COFFEE
import Text.Coffee
#endif
import Text.Julius
i... | piyush-kurur/shakespeare | shakespeare-js/test/ShakespeareJsTest.hs | bsd-2-clause | 4,292 | 0 | 17 | 1,186 | 1,170 | 634 | 536 | 98 | 1 |
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE... | rob-b/appoint | src/Appoint/Entities.hs | bsd-3-clause | 1,536 | 0 | 8 | 338 | 202 | 116 | 86 | 27 | 1 |
-- file sudoku.hs
module Main where
import qualified Data.Set as Set
import qualified Data.List as List
import Data.Array
import Data.Maybe
main :: IO ()
main = do
putStrLn $ showPuzzle hardP
putStrLn "Is solved as...\n\n"
putStrLn $ showPuzzle $ solve hardP
{---------------------------------CONSTANTS---... | ethanpailes/sudoku-solver | src/Main.hs | bsd-3-clause | 5,518 | 0 | 16 | 1,717 | 1,911 | 1,091 | 820 | 96 | 6 |
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, UndecidableInstances, TypeOperators #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Monoid.Multiplicative
-- Copyright : (c) Edward Kmett 2009
-- License : BSD-style
-- Maintainer : ekmett@gma... | ekmett/monoids | Data/Monoid/Multiplicative.hs | bsd-3-clause | 3,723 | 0 | 10 | 774 | 809 | 447 | 362 | 66 | 0 |
<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE helpset
PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN"
"../dtd/helpset_2_0.dtd">
<helpset version="1.0">
<!-- title -->
<title>LightZone - Help</title>
<!-- maps -->
<maps>
<homeID>top</homeID>
<mapref locati... | AntonKast/LightZone | linux/help/LightZone.hs | bsd-3-clause | 1,896 | 150 | 115 | 357 | 782 | 397 | 385 | -1 | -1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
module HIndent.Styles.Html where
import Control.Monad
import Control.Monad.State.Class
import Data.Int
import Data.Default.Class
import Data.Maybe
import HIndent.Pretty
import HIndent.Types
import Language.Haskell.Exts.Annotated.Syntax
import Prelud... | imalsogreg/tasty-hpc | src/HIndent/Styles/Html.hs | bsd-3-clause | 1,618 | 0 | 8 | 519 | 338 | 180 | 158 | 41 | 1 |
module Life where
import Control.Comonad
data Stream a = a :> Stream a deriving (Show, Eq)
infixr 5 :>
instance Functor Stream where
fmap f (a :> as) = f a :> fmap f as
instance Applicative Stream where
pure a = a :> pure a
(f :> fs) <*> (a :> as) = f a :> (fs <*> as)
instance Comonad Strea... | parsonsmatt/gol | src/Life.hs | bsd-3-clause | 3,596 | 0 | 11 | 1,011 | 1,746 | 890 | 856 | 109 | 3 |
{-# LANGUAGE FlexibleContexts, FlexibleInstances, RankNTypes #-}
module GL.Program where
import Data.Foldable (for_, toList)
import Data.Functor.Union
import Foreign.Ptr
import GL.Exception
import GL.Shader
import Graphics.GL.Core41
import Graphics.GL.Types
import qualified Linear.V4 as Linear
import qualified Linear.... | robrix/ui-effects | src/GL/Program.hs | bsd-3-clause | 2,538 | 0 | 20 | 425 | 852 | 430 | 422 | 51 | 1 |
-- | Functionality for detecting and removing cycles.
{-# LANGUAGE ScopedTypeVariables #-}
module Data.Cfg.Cyclic (
isCyclic,
removeCycles,
removeCycles'
) where
import Data.Cfg.Cfg(Cfg, Production(..), ProductionMap, V(..), Vs,
lookupProductions, productions)
import qualified Data.Cfg.CycleRemoval... | nedervold/context-free-grammar | src/Data/Cfg/Cyclic.hs | bsd-3-clause | 3,723 | 0 | 13 | 1,133 | 1,301 | 689 | 612 | 82 | 4 |
-- !!! Testing error checking in qualified names (patterns)
-- No qualified variables in patterns
module TestQual1 where
f (A.x : xs) = xs
| FranklinChen/Hugs | tests/static/qual1.hs | bsd-3-clause | 141 | 1 | 8 | 26 | 25 | 14 | 11 | -1 | -1 |
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE FlexibleContexts #-}
import Data.Shaped hiding (Focused (..), Delayed (..))
-- import Data.Shaped.Base
import Data.Shaped.Pixels
import Control.Lens
-- import qualified Data.Shaped.Delayed.Generic as U
-- import Data.Shaped.Delayed
import qualified Data.Shaped.Generic as U
impo... | cchalmers/shaped-pixels | examples/blur.hs | bsd-3-clause | 5,110 | 0 | 15 | 1,352 | 1,654 | 892 | 762 | 104 | 3 |
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 708
{-# LANGUAGE PatternSynonyms #-}
#endif
{-| Types and functions for
<http://en.wikipedia.org/wiki/Coordinated_Universal_Time UTC> and
<http://en.wikipedia.org/wiki/Universal_Time#Versions UT1>.
If you don't care about leap seconds, keep to 'UTCTime' and
'NominalDiff... | liyang/thyme | src/Data/Thyme/Clock.hs | bsd-3-clause | 5,559 | 0 | 11 | 921 | 533 | 358 | 175 | 66 | 1 |
{-# LANGUAGE OverloadedStrings, QuasiQuotes, LambdaCase #-}
module Transformations.Optimising.ConstantFoldingSpec where
import Control.Monad
import Test.Hspec
import Test.QuickCheck
import Transformations.Optimising.ConstantFolding
import Test.Check
import Grin.Grin
import Grin.TH
import Test.Test
import Test.Assertio... | andorp/grin | grin/test/Transformations/Optimising/ConstantFoldingSpec.hs | bsd-3-clause | 3,804 | 0 | 15 | 1,661 | 536 | 287 | 249 | 64 | 1 |
module InitGHC(initGHC) where
import Prelude hiding (putStrLn)
import System.IO.Unsafe
import AbstractIO (putStrLn)
import Maybe
import List
import TypeCheck
import RefacUtils
initGHC filenames
= do
AbstractIO.putStrLn $ ghcInit filenames
| forste/haReFork | refactorer/InitGHC.hs | bsd-3-clause | 258 | 0 | 8 | 47 | 64 | 38 | 26 | 11 | 1 |
module Model.Types where
import Codec.Picture
import Codec.Picture.Repa
import Data.Array.Repa
type Layer = [Cell]
type HmaxImage = Array D DIM3 Double
data Cell = SimpleCell Tuning
| ComplexCell [Cell]
type Tuning = HmaxImage
newtype Score = Score { unScore :: Double }
deriving (Eq, Show... | imalsogreg/hmax | src/Model/Types.hs | bsd-3-clause | 322 | 0 | 7 | 75 | 92 | 57 | 35 | 11 | 0 |
module Seven( main, sevenWriting ) where
{- |
Module : Seven
Description : File handling example
Copyright : (c) Thomas Lang
License : BSD3
Stability : stable
Portability : portable
This module uses the System.IO module to
write the number 7 ... | langthom/Hack-A-Thon-Haskell | Seven.hs | bsd-3-clause | 885 | 0 | 10 | 244 | 150 | 75 | 75 | 13 | 2 |
-----------------------------------------------------------------------------
--
-- Module : Demos.TraceExample
-- Copyright :
-- License : BSD3
--
-- Maintainer : agocorona@gmail.com
-- Stability :
-- Portability :
--
-- | This is an example of trace generated by Control.Monad.Supervisor.Trace
--
-- T... | agocorona/control-monad-supervisor | Demos/TraceExample.hs | bsd-3-clause | 907 | 0 | 9 | 181 | 104 | 64 | 40 | 14 | 2 |
module Math.Probably.Circular where
import Math.Probably.FoldingStats
import Numeric.LinearAlgebra
import Control.Applicative
--approximate method first mentioned http://en.wikipedia.org/wiki/Mean_of_circular_quantities
circularMean :: Fold Double Double
circularMean = before (after vmean getAngle) toCartesian where
... | glutamate/probably-baysig | src/Math/Probably/Circular.hs | bsd-3-clause | 846 | 0 | 11 | 113 | 232 | 123 | 109 | 16 | 1 |
{-# LANGUAGE OverloadedStrings #-}
import Agon.Server
import Agon.Types
import Crypto.Cipher.AES
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Base16 as B16
import Network.HTTP.Conduit
import Network.Wai.Handler.Warp
import Network.Wai.Middleware.Static
import System.Environment
main ... | Feeniks/Agon | app/API.hs | bsd-3-clause | 992 | 0 | 15 | 218 | 310 | 161 | 149 | 28 | 2 |
module Network.SPDY.Frame
( parse
, serialize
, emptyFlags
, Flag(..)
, inflateNvHeaders
, deflateNvHeaders
, ControlFrameHeader(..)
, NvHeaders
, StatusCode (..)
, Frame(..) )
where
import Prelude hiding (length)
import Control.Monad (foldM, replicateM, sequence_)
import qu... | robinbrandt/haskell-spdy-playground | Network/SPDY/Frame.hs | bsd-3-clause | 12,069 | 55 | 15 | 2,564 | 3,902 | 1,973 | 1,929 | 371 | 9 |
-- MergeSort.hs
module Math.MergeSort where
-- based on Rabhi, Lapalme, Algorithms: A functional programming approach
-- MERGESORT
-- This version requires the input to be an Ord type, and uses the <= operator to do the comparisons
split :: [a] -> [[a]]
split [] = []
split (x:xs) = [x] : split xs
... | nfjinjing/bench-euler | src/Math/MergeSort.hs | bsd-3-clause | 1,439 | 12 | 9 | 377 | 729 | 395 | 334 | 36 | 3 |
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Derive (smartRep
) where
import Language.Haskell.TH hiding (Cxt)
import Control.Monad
import Data.Comp.Derive.Utils
import Data.Comp.Sum
import Data.Comp.Term
import Data.Rewriting.Rules
smartRep fname = do
TyConI (DataD _cxt tn... | tomberek/RETE | src/RETE/Derive.hs | bsd-3-clause | 2,864 | 0 | 19 | 1,086 | 721 | 369 | 352 | 44 | 2 |
import Control.Monad
import Data.Monoid
import Test.HUnit
import Pt2_Test
import PolyPt2_Test
import LinePt2_Test
import TestUtils
tests = TestList [
polyPt2Tests,
pt2Tests,
linePt2Tests ]
main :: IO Counts
main = runTes... | trenttobler/hs-asteroids | test/Spec.hs | bsd-3-clause | 337 | 0 | 6 | 137 | 61 | 35 | 26 | 13 | 1 |
-- | Rollback functionality in Auxx.
module Command.Rollback
( rollbackAndDump
) where
import Universum
import Control.Lens (_Wrapped)
import Data.Aeson (encode)
import qualified Data.ByteString.Lazy as BSL
import Data.List (genericTake)
import Formatti... | input-output-hk/pos-haskell-prototype | auxx/src/Command/Rollback.hs | mit | 3,121 | 0 | 19 | 826 | 740 | 407 | 333 | 59 | 4 |
{- |
Module : ./CMDL/Shell.hs
Description : shell related functions
Copyright : uni-bremen and DFKI
License : GPLv2 or higher, see LICENSE.txt
Maintainer : r.pascanu@jacobs-university.de
Stability : provisional
Portability : portable
CMDL.Shell contains almost all functions related
the CMDL shell or hask... | spechub/Hets | CMDL/Shell.hs | gpl-2.0 | 15,717 | 0 | 37 | 6,397 | 3,737 | 1,886 | 1,851 | 299 | 49 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- Derived from AWS service descriptions, licensed under Apache 2.0.
-- |
-- Module : Network.AWS.CloudHSM.Types.Sum
-- Cop... | fmapfmapfmap/amazonka | amazonka-cloudhsm/gen/Network/AWS/CloudHSM/Types/Sum.hs | mpl-2.0 | 4,141 | 0 | 12 | 952 | 813 | 416 | 397 | 104 | 0 |
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- License : BSD-3-Clause
-- Maintainer : Oleg Grenrus <oleg.grenrus@iki.fi>
--
-- This module re-exports the @GitHub.Data.@ and "GitHub.Auth" submodules.
module GitHub.Data (
-- * Tagged types
-- ** N... | jwiegley/github | src/GitHub/Data.hs | bsd-3-clause | 3,420 | 0 | 6 | 588 | 762 | 480 | 282 | 114 | 1 |
-----------------------------------------------------------------------------
--
-- Stg to C--: code generation for constructors
--
-- This module provides the support code for StgCmm to deal with with
-- constructors on the RHSs of let(rec)s.
--
-- (c) The University of Glasgow 2004-2006
--
---------------------------... | mcmaniac/ghc | compiler/codeGen/StgCmmCon.hs | bsd-3-clause | 9,613 | 0 | 13 | 2,565 | 1,356 | 731 | 625 | 123 | 1 |
{-
Copyright 2015 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 a... | Ye-Yong-Chi/codeworld | codeworld-base/src/Data/Complex.hs | apache-2.0 | 739 | 0 | 4 | 136 | 23 | 17 | 6 | 4 | 0 |
module Graphics.QML.Internal.Types where
import Data.Map (Map)
import Data.Typeable
import Data.Unique
import Foreign.Ptr
newtype TypeId = TypeId Int deriving (Eq, Ord)
type UniformFunc = Ptr () -> Ptr (Ptr ()) -> IO ()
data MemberKey
= TypeKey TypeRep
| DataKey Unique
deriving (Eq, Ord)
data ClassInfo... | marcinmrotek/hsqml-fork | src/Graphics/QML/Internal/Types.hs | bsd-3-clause | 435 | 0 | 10 | 89 | 148 | 84 | 64 | 15 | 0 |
--------------------------------------------------------------------------------
-- |
-- Module : Text.Show.Value
-- Copyright : (c) Iavor S. Diatchki 2009
-- License : MIT
--
-- Maintainer : iavor.diatchki@gmail.com
-- Stability : provisional
-- Portability : Haskell 98
--
-- Generic representation... | phadej/pretty-show | Text/Show/Value.hs | mit | 1,744 | 0 | 8 | 564 | 165 | 115 | 50 | 15 | 0 |
module Inter.Click where
-- $Id$
data Click = Submit | Example | Previous | Change | Reset
deriving ( Eq, Ord, Show, Read, Enum, Bounded )
| Erdwolf/autotool-bonn | trial/src/Inter/Click.hs | gpl-2.0 | 149 | 0 | 6 | 36 | 53 | 31 | 22 | 3 | 0 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.SrcDist
-- Copyright : Simon Marlow 2004
-- License : BSD3
--
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- This handles the @sdist@ command. The module exports a... | tolysz/prepare-ghcjs | spec-lts8/cabal/Cabal/Distribution/Simple/SrcDist.hs | bsd-3-clause | 19,342 | 0 | 24 | 5,086 | 3,938 | 2,012 | 1,926 | 320 | 6 |
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
#endif
------------------------------------------------------------------------
-- |
-- Module : Data.HashMap.Lazy
-- Copyright : 2010-2012 Johan Tibell
-- License : BSD-style
-- Maintainer : johan.tibell@gmail.com
-- Sta... | mightymoose/liquidhaskell | benchmarks/unordered-containers-0.2.1.0/Data/HashMap/Lazy.hs | bsd-3-clause | 1,872 | 0 | 5 | 509 | 161 | 120 | 41 | 35 | 0 |
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.List
-- Copyright : (c) David Himmelstrup 2005
-- Duncan Coutts 2008-2011
-- License : BSD-like
--
-- Maintainer : cabal-devel@haskell.org
--
-- Search for and print info... | DavidAlphaFox/ghc | libraries/Cabal/cabal-install/Distribution/Client/List.hs | bsd-3-clause | 24,240 | 0 | 20 | 7,569 | 5,563 | 2,927 | 2,636 | 459 | 8 |
-- some degenerate cases
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StandaloneDeriving #-}
import Prelude hiding (filter)
import Database.Persist
import Database.Persist.State
import Database.Persist.S... | yesodweb/persistent | persistent-sqlite/test2.hs | mit | 575 | 0 | 9 | 89 | 110 | 68 | 42 | -1 | -1 |
{-# LANGUAGE ScopedTypeVariables #-}
module T7827 where
bug :: a -> ()
bug ((_ :: a) :: a) = ()
| ryantm/ghc | testsuite/tests/typecheck/should_compile/T7827.hs | bsd-3-clause | 97 | 0 | 9 | 21 | 40 | 23 | 17 | 4 | 1 |
-- |
-- Module: Math.NumberTheory.Moduli.EquationsTests
-- Copyright: (c) 2018 Andrew Lelechenko
-- Licence: MIT
-- Maintainer: Andrew Lelechenko <andrew.lelechenko@gmail.com>
--
{-# LANGUAGE ScopedTypeVariables #-}
module Math.NumberTheory.Moduli.EquationsTests
( testSuite
) where
import Test.Tasty
... | Bodigrim/arithmoi | test-suite/Math/NumberTheory/Moduli/EquationsTests.hs | mit | 1,879 | 0 | 14 | 309 | 667 | 367 | 300 | 33 | 1 |
import System.Environment
import qualified MacroExpander
import qualified Parser
import qualified Beautifier
import qualified Generator
import qualified Serializer
import qualified Optimizer
import qualified Assembler
import qualified Text.Show.Pretty as Pr
import Control.Monad.Writer
import Paths_hdc(version)
import ... | aleksanb/hdc | src/Main.hs | mit | 1,462 | 0 | 12 | 266 | 415 | 210 | 205 | 37 | 2 |
module Main where
import HSFV (Flags(..), run)
import System.Environment (getArgs, getProgName)
import System.Console.GetOpt
import System.Exit (exitWith)
main :: IO ()
main = getArgs >>= parseArgs >>= uncurry HSFV.run >>= exitWith
parseArgs :: [String] -> IO (Flags, FilePath)
parseArgs args =
case getOpt Require... | asvanberg/hsfv | Main.hs | mit | 950 | 0 | 15 | 200 | 354 | 198 | 156 | 20 | 2 |
{-# LANGUAGE OverloadedStrings, TypeSynonymInstances, FlexibleInstances #-}
-- module Phunctor where
import Data.Text (Text)
class IsString a where
fromString :: String -> a
class DoSomething a where
something :: a -> IO ()
instance Class DoSomething where
something _ = putStrLn "String"
instance DoSomething Tex... | HaskellForCats/HaskellForCats | phunctor.hs | mit | 648 | 0 | 9 | 146 | 119 | 64 | 55 | 12 | 1 |
module MyData
(MetricUnit(..),
ImperialUnit(..),
Measurement(..),
convert)
where
data MetricUnit = Meter
| Liter
| KiloGram
deriving (Show, Eq)
data ImperialUnit = Yard
| Gallon
| Pound
derivi... | iambernie/tryhaskell | MyData.hs | mit | 1,001 | 0 | 8 | 325 | 332 | 172 | 160 | 29 | 1 |
module Rebase.Data.Kind
(
module Data.Kind
)
where
import Data.Kind
| nikita-volkov/rebase | library/Rebase/Data/Kind.hs | mit | 71 | 0 | 5 | 12 | 20 | 13 | 7 | 4 | 0 |
module Feature.RpcSpec where
import qualified Data.ByteString.Lazy as BL (empty)
import Network.Wai (Application)
import Network.Wai.Test (SResponse (simpleBody, simpleStatus))
import Network.HTTP.Types
import Test.Hspec hiding (pendingWith)
import Test.Hspec.Wai
import Test.Hspec.Wai.JSON
import Text.... | diogob/postgrest | test/Feature/RpcSpec.hs | mit | 24,502 | 0 | 21 | 6,551 | 3,977 | 2,304 | 1,673 | -1 | -1 |
module Utils.IOFold.Tests (test) where
import Test.Hspec
import Test.QuickCheck
test :: IO ()
test = hspec $ do
describe "Modulo IOFold" $ do
context "ioFoldl" $ do
it "should" $ do
pending
context "ioFoldl" $ do
it "should" $ do
pending
| Miguel-Fontes/hs-file-watcher | test/Utils/IOFold/Tests.hs | mit | 298 | 0 | 16 | 100 | 97 | 46 | 51 | 12 | 1 |
#include <h>
procLine :: String -> [Int]
procLine l =
map (read . (:[])) $ filter isDigit pinyin
where
pinyin = words l !! 1
main = do
[n] <- map read <$> getArgs
ls <- take (n :: Int) . lines <$>
readFile "/home/danl/p/l/melang/out/gbRec/mem"
let tonesSeen = concatMap procLine ls
... | dancor/melang | src/MostCommonTone.hs | mit | 625 | 0 | 18 | 197 | 241 | 122 | 119 | 16 | 1 |
main = print euler4
euler4 = maximum [x | y <- [100..999], z <- [y..999], let x=y*z, let s=show x, s == reverse s]
| dmitry106/projecteulerimsa | haskell/euler0004.hs | mit | 118 | 0 | 11 | 27 | 84 | 42 | 42 | 2 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Graphics.Flipdots
( Dims (..), FlipboardConfig (..), Img
, renderImage, sendImage', sendImage
) where
import Network.Socket hiding (sendTo)
import Network.Socket.ByteString (sendTo)
import Data.Word8 (Word8)
import Data.ByteString as BS
import Data.Aeson
import Control.... | curry-club-aux/haskell-flipdots | src/Graphics/Flipdots.hs | mit | 1,945 | 0 | 18 | 460 | 802 | 416 | 386 | 55 | 3 |
import Utils (digitsToNumber)
import Data.List
import qualified Data.Set as Set
theDigits = [1..9]
makeNDigitLists :: Integer -> [Integer] -> [[Integer]]
makeNDigitLists n dig
| n>(fromIntegral (length dig)) = error "n must be <= length dig"
| n==1 = map (\x -> [x]) dig
| otherwise = [ x:y | x... | arekfu/project_euler | p0032/p0032.hs | mit | 1,536 | 0 | 13 | 384 | 645 | 341 | 304 | 33 | 1 |
module Labyrinth.Board (
InsertionPoint(..),
allPositions,
distanceBetween,
isValid,
insert,
insertionPoints,
insertionPointIdentifiers,
identifierToInsertionPoint,
getTile,
getAssociatedMove,
getAffectedPositions,
getReachablePositions,
getReachableTreasures,
getAllTreasures,
removeTreasu... | amoerie/labyrinth | Labyrinth/Board.hs | mit | 6,503 | 0 | 11 | 1,310 | 1,825 | 1,001 | 824 | 130 | 2 |
import System.IO
import Data.List
import Data.Char
main = do
contents <- readFile "day8input.txt"
let result = compute $ lines contents
printScreen result
type Screen = [[Bool]]
screenWidth :: Int
screenWidth = 50
screenHeight :: Int
screenHeight = 6
initScreen :: Screen
initScreen = r... | aBhallo/AoC2016 | Day 8/day8part2.hs | mit | 1,829 | 0 | 14 | 416 | 739 | 377 | 362 | 43 | 1 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayroutetable.html
module Stratosphere.Resources.EC2TransitGatewayRouteTable where
import Strat... | frontrowed/stratosphere | library-gen/Stratosphere/Resources/EC2TransitGatewayRouteTable.hs | mit | 2,290 | 0 | 15 | 248 | 279 | 162 | 117 | 31 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module JSBoiler.Parser.LiteralSpec where
import Test.Hspec
import TestUtil
import JSBoiler.Parser.Literal
spec = do
describe "numbers" $ testMany numberLiteral $
[ ("4", 4)
, ("42", 42)
]
++ allShouldBe ["0", ".0", "0.", "0.0", "+0", "+.0", "+0.",... | cuklev/JSBoiler | test/JSBoiler/Parser/LiteralSpec.hs | gpl-3.0 | 1,394 | 0 | 17 | 410 | 450 | 262 | 188 | 33 | 1 |
{-# LANGUAGE ViewPatterns, TemplateHaskell, StandaloneDeriving #-}
{-# OPTIONS -Wall -fno-warn-orphans #-}
module OrphanInstances() where
import Control.DeepSeq
import Data.Colour.SRGB as SRGB(RGB(..),toSRGB,Colour)
import Data.Graph.Inductive.Graph(labEdges)
import Data.Graph.Inductive.Graph(labNodes)
import Data.Gr... | DanielSchuessler/hstri | OrphanInstances.hs | gpl-3.0 | 2,768 | 0 | 14 | 573 | 868 | 499 | 369 | 70 | 0 |
--------------------------------------------------------------------------------
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveFunctor #-}
--------------------------------------------------------------------------------
-- |
-- Module : Melkor.Types.Eff
-- Description : Eff type class declaration
-- Copyri... | d12frosted/environment | melkor/src/Melkor/Types/Eff.hs | gpl-3.0 | 1,584 | 0 | 12 | 269 | 371 | 201 | 170 | 27 | 1 |
-- | This module defines functions concerning the keys on the keyboard
module View.Key where
import Euterpea
import View.Fun
import Graphics.UI.GLUT
-- | Displays all of the black keys of the one octave of a keyboard.
displayBlackKeys :: IO ()
displayBlackKeys = do
currentColor $= Color4 0 0 0 1
renderAs Quad... | flofehrenbacher/music-project | EasyNotes/View/Key.hs | gpl-3.0 | 2,772 | 0 | 12 | 641 | 998 | 516 | 482 | 62 | 1 |
-- Project Level Imports --
import File (buildJobList)
import Parsers (addJobOutputParser)
import Datatypes (Job (..), Document (..))
-- Global Level Imports --
import Data.List (nub)
import Paths_AAUDOC (version)
import Control.DeepSeq (($!!))
import Data.Version (showVersion)
import System.Environment (getArgs)
impo... | skejserjensen/AAUDOC | src/Main.hs | gpl-3.0 | 7,448 | 0 | 13 | 1,969 | 1,410 | 730 | 680 | 93 | 4 |
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Fresh (
Fresh(..), runFresh, fresh
) where
import Control.Monad.State
newtype Fresh s a = Fresh { unFresh :: State [s] a }
deriving Monad
runFresh m s = evalState (unFresh m) s
fresh = do (x:xs) <- Fresh get ; Fresh (put xs) ; return x
| orchid-hybrid/bee | Bee/Fresh.hs | gpl-3.0 | 295 | 0 | 9 | 59 | 115 | 65 | 50 | 8 | 1 |
{-|
Module : Voogie.Boogie.Smart
Description : Smart constructors for the Boogie data types.
Copyright : (c) Evgenii Kotelnikov, 2019
License : GPL-3
Maintainer : evgeny.kotelnikov@gmail.com
Stability : provisional
-}
module Voogie.Boogie.Smart (
TopLevel,
Statement,
Assignment,
Property,
... | aztek/voogie | src/Voogie/Boogie/Smart.hs | gpl-3.0 | 1,799 | 0 | 10 | 346 | 526 | 294 | 232 | 60 | 1 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Locations/Agents/Environments/Sessions/MatchIntent.hs | mpl-2.0 | 7,421 | 0 | 16 | 1,495 | 793 | 468 | 325 | 129 | 1 |
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
module Data.RTree.Internal.RTree where
import Control.Applicative
import C... | johnpmayer/concurrent-rtree | Data/RTree/Internal/RTree.hs | agpl-3.0 | 11,098 | 0 | 21 | 3,132 | 4,320 | 2,133 | 2,187 | 265 | 6 |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Web.Scotty
import Data.Monoid (mconcat)
import Control.Monad.IO.Class (liftIO)
import Control.Concurrent.STM
import qualified Data.Text.Lazy as L
import Chain
import Lib
main = do
blockchain <- atomically $ makeChain
... | mreluzeon/block-monad | oldmain/Main1.hs | lgpl-3.0 | 1,094 | 0 | 16 | 253 | 181 | 100 | 81 | 20 | 1 |
module Trace where
import Data.List (find)
import Control.Monad (mplus,msum)
data Trace a = Fork a [Trace a]
instance Show a => Show (Trace a) where
show = unlines . go
where
go (Fork x ts) = show x:bars (map go ts)
bar :: [String] -> [String]
bar [] = []
bar (s:xs) = ("┣┉"... | danr/structural-induction | test/Trace.hs | lgpl-3.0 | 639 | 0 | 14 | 206 | 354 | 187 | 167 | 17 | 1 |
import Control.Monad (replicateM)
import Data.List (foldl')
cost (n, b)
| b - n > 2 = Nothing
| otherwise = Just (b - n)
carry mc mb = do
(n, c1, c2) <- mc
b <- mb
go b n c1 c2
where
dec n = max 0 (n - 1)
go 2 n c1 c2 = return (n + 2, c1, c2 + 1)
go a n c1 c... | itsbruce/hackerrank | alg/implementation/nyChaos.hs | unlicense | 833 | 0 | 12 | 299 | 450 | 224 | 226 | 27 | 2 |
import XMonad
import XMonad.Config.Azerty
import XMonad.Util.EZConfig
import XMonad.Actions.CycleWS
import XMonad.Layout.FixedColumn
import XMonad.Layout.ShowWName
import XMonad.Layout.PerWorkspace
import XMonad.Layout.ToggleLayouts
import XMonad.Layout.NoBorders
import XMonad.Prompt
import XMonad.Prompt.XMonad
import ... | thierr26/thierr26_xmonad_config_and_dot_files | .xmonad/xmonad.hs | unlicense | 6,595 | 0 | 14 | 1,395 | 1,017 | 600 | 417 | 106 | 1 |
module Numeric.Integration.Gauss (
integrate
) where
import Numeric.Polinomials.Legendre
-- | Gauss integration with Legendre polinomials of n'th order
-- er - accuracy for polinomial roots
-- n - order of Legendre polinomyal
-- f - function to integrate
-- a, b - integration limits
integrate :: Double -> Int -> ... | xdcrafts/Numenor | src/Numeric/Integration/Gauss.hs | apache-2.0 | 616 | 0 | 13 | 166 | 214 | 115 | 99 | 9 | 1 |
chk [a,b,c,d] [] = [a,b,c,d]
chk [a,b,c,d] (x:xs)
| x >= 1.1 = chk [a+1,b,c,d] xs
| x >= 0.6 = chk [a,b+1,c,d] xs
| x >= 0.2 = chk [a,b,c+1,d] xs
| otherwise= chk [a,b,c,d+1] xs
ans i =
let l = map (\ [l,r] -> l) i
r = map (\ [l,r] -> r) i
tl = chk [0,0,0,0] l
tr = chk [0,0,0,0] r
in
... | a143753/AOJ | 0149.hs | apache-2.0 | 511 | 0 | 14 | 160 | 421 | 227 | 194 | 17 | 1 |
module Graham.A092487 (a092487) where
import Graham.A006255 (a006255)
a092487 :: Integer -> Integer
a092487 n = a006255 n - n
| peterokagey/haskellOEIS | src/Graham/A092487.hs | apache-2.0 | 127 | 0 | 6 | 20 | 45 | 25 | 20 | 4 | 1 |
import Text.Printf
import Data.Char
ans :: [Char] -> String -> [Int]
ans [] _ = []
ans (c:cs) text =
(length $ filter (==c) text):(ans cs text)
main = do
c <- getContents
let a = ['a'..'z']
o = ans a $ map toLower c
t = zip a o
mapM_ (\(a,b) -> printf "%c : %d\n" a b) t
| a143753/AOJ | ITP1_8_C.hs | apache-2.0 | 294 | 0 | 11 | 83 | 171 | 89 | 82 | 12 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Finance.Hqfl.Rate.Libor
-- Copyright : (C) 2018 Mika'il Khan
-- License : (see the file LICENSE)
-- Maintainer : Mika'il Khan <co.category@gmail.com>
-- Stability : stable
-- Portability : portable
--
----... | cokleisli/hqfl | src/Finance/Hqfl/Rate/Libor.hs | apache-2.0 | 1,047 | 0 | 6 | 325 | 94 | 65 | 29 | 21 | 0 |
-- http://www.codewars.com/kata/552679ea44a9e400b600124f
module Codewars.Kata.NthRoot where
import Prelude hiding ((**))
root :: Double -> Double -> Double
root x n = exp $ log x / n | Bodigrim/katas | src/haskell/B-Nth-Root-of-a-Number-Redux.hs | bsd-2-clause | 183 | 0 | 7 | 26 | 53 | 31 | 22 | 4 | 1 |
module Data.Coap.Internal where
class XEnum a where
toxEnum :: Int -> Either String a
fromxEnum :: a -> Int
| Xandaros/coap | src/Data/Coap/Internal.hs | bsd-2-clause | 113 | 0 | 8 | 24 | 39 | 21 | 18 | 4 | 0 |
-----------------------------------------------------------------------------
-- |
-- Module : Numeric.Interval
-- Copyright : (c) Edward Kmett 2010-2014
-- License : BSD3
-- Maintainer : ekmett@gmail.com
-- Stability : experimental
-- Portability : DeriveDataTypeable
--
-- Interval arithmetic
-----... | ekmett/intervals | src/Numeric/Interval.hs | bsd-2-clause | 1,000 | 0 | 4 | 225 | 209 | 152 | 57 | 39 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.