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 FlexibleContexts #-}
module Persistent where
import Control.Monad.State (MonadState)
import Control.Monad.State (StateT)
import Control.Monad.State (execStateT)
import Control.Monad.State (get)
import Control.Monad.State (gets)
import Control.Monad.State (modify)
import Control.Monad.Trans (liftIO)
data... | notae/haskell-exercise | io/Persistent.hs | bsd-3-clause | 1,897 | 0 | 13 | 537 | 644 | 334 | 310 | 64 | 6 |
import System.Environment (getArgs)
import Data.List (isInfixOf)
import Data.List.Split (splitOn)
count :: (Eq a) => a -> [a] -> Int
count x ys = length (filter (== x) ys)
details :: [String] -> Int
details [] = 10
details (x:xs) | isInfixOf "XY" x = 0
| otherwise = min (count '.' x) (... | nikai3d/ce-challenges | easy/details.hs | bsd-3-clause | 484 | 0 | 12 | 129 | 228 | 116 | 112 | 14 | 1 |
{-# language CPP #-}
-- | = Name
--
-- VK_EXT_validation_flags - instance extension
--
-- == VK_EXT_validation_flags
--
-- [__Name String__]
-- @VK_EXT_validation_flags@
--
-- [__Extension Type__]
-- Instance extension
--
-- [__Registered Extension Number__]
-- 62
--
-- [__Revision__]
-- 2
--
-- [__Exte... | expipiplus1/vulkan | src/Vulkan/Extensions/VK_EXT_validation_flags.hs | bsd-3-clause | 9,655 | 1 | 18 | 1,817 | 1,471 | 896 | 575 | -1 | -1 |
{-# LANGUAGE BangPatterns #-}
module Facebook.Gen.Types
where
import Data.Text hiding (length)
import Data.Csv
import Data.Coerce
import Control.Monad
import Control.Applicative
newtype Entity = Entity Text deriving (Show, Ord, Eq)
data InteractionMode =
Reading
| Creating
| Updating
| Deleting
... | BeautifulDestinations/fb | gen/src/Facebook/Gen/Types.hs | bsd-3-clause | 1,829 | 0 | 11 | 517 | 476 | 253 | 223 | 51 | 1 |
{-# LANGUAGE UnicodeSyntax #-}
module LineCount.Select
( selectProfile
) where
import Control.Arrow
import Control.Monad
import Data.Foldable
import Data.Function
import Data.Function.JAExtra
import Data.Tuple.JAExtra
import LineCount.Base
impor... | JustusAdam/hlinecount | src/LineCount/Select.hs | bsd-3-clause | 1,314 | 0 | 13 | 298 | 287 | 159 | 128 | 28 | 1 |
-----------------------------------------------------------------------------
-- |
-- Module : Control.Concurrent.MVar
-- Copyright : (c) The University of Glasgow 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : libraries@haskell.org
-- Stability : experimental
-... | OS2World/DEV-UTIL-HUGS | libraries/Control/Concurrent/MVar.hs | bsd-3-clause | 2,864 | 14 | 14 | 726 | 600 | 312 | 288 | 54 | 1 |
module Language.Haskell.Generate.Expression
( Expression(..)
, app
) where
import Language.Haskell.Exts.Syntax
newtype Expression t = Expression { runExpression :: Exp }
app :: Expression (a -> b) -> Expression a -> Expression b
app (Expression a) (Expression b) = Expression $ App a b
| bennofs/haskell-generate | src/Language/Haskell/Generate/Expression.hs | bsd-3-clause | 297 | 0 | 8 | 54 | 101 | 58 | 43 | 7 | 1 |
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE ImplicitParams #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import BGFX
import Control.Lens ((&), (.~))
import Data.Bits
import Data.Distributive
import Data.Foldable (for_)
import Data.Word
import Foreign
import Foreign.Ptr
import GHC.Stack
import Li... | haskell-game/bgfx | Cubes.hs | bsd-3-clause | 6,439 | 0 | 35 | 2,788 | 1,709 | 863 | 846 | 193 | 2 |
module Abstract.Counter.Get (
module Abstract.Interfaces.Counter.Get,
mkCounter'Get
) where
import Abstract.Counter
import Abstract.Interfaces.Counter
import Abstract.Interfaces.Counter.Get
mkCounter'Get url = do
c <- mkCounter url
return $ counterToGet c
| adarqui/Abstract | src/Abstract/Counter/Get.hs | bsd-3-clause | 263 | 0 | 8 | 33 | 66 | 38 | 28 | 9 | 1 |
-- | Debug Options
module Graphics.QML.Debug (
setDebugLogLevel
) where
import Graphics.QML.Internal.Engine
-- | Sets the global debug log level. At level zero, no logging information
-- will be printed. Higher levels will increase debug verbosity.
setDebugLogLevel :: Int -> IO ()
setDebugLogLevel = hsqmlSetDebug... | drhodes/HsQML | src/Graphics/QML/Debug.hs | bsd-3-clause | 329 | 0 | 7 | 51 | 41 | 26 | 15 | 5 | 1 |
module JavaScript.AceAjax.Raw.Annotation where
import qualified GHCJS.Types as GHCJS
import qualified GHCJS.Marshal as GHCJS
import qualified Data.Typeable
import GHCJS.FFI.TypeScript
import GHCJS.DOM.Types (HTMLElement)
import JavaScript.AceAjax.Raw.Types
foreign import javascript "$1.row" row :: Annotation -> IO (GH... | fpco/ghcjs-from-typescript | ghcjs-ace/JavaScript/AceAjax/Raw/Annotation.hs | bsd-3-clause | 573 | 6 | 7 | 64 | 145 | 87 | 58 | 11 | 0 |
{-# LANGUAGE MultiParamTypeClasses, TypeFamilies, FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS -Wall #-}
module FiniteStateMachine.Machine (
FSM(FSM), FSM1
) where
import Basic.Types
import Basic.Memory
import Basic.Features
import Basic.Operations
impor... | davidzhulijun/TAM | FiniteStateMachine/Machine.hs | bsd-3-clause | 1,667 | 0 | 10 | 304 | 478 | 267 | 211 | 38 | 0 |
{-# LANGUAGE TemplateHaskell #-}
module Dampf.Docker.Args.Network where
import Dampf.Docker.Args.Class
import Data.Text (Text)
import Control.Lens
import Data.Monoid ((<>))
import qualified Data.Text as T
data Driver = Bridge
instance Show Driver where
show Bridge = "bridge"
data CreateArgs = CreateArgs {
... | filopodia/open | dampf/lib/Dampf/Docker/Args/Network.hs | mit | 1,254 | 2 | 18 | 255 | 423 | 229 | 194 | -1 | -1 |
{-# LANGUAGE DeriveDataTypeable #-}
{- |
Module : $Header$
Description : Abstract syntax for common logic
Copyright : (c) Karl Luc, DFKI Bremen 2010, Eugen Kuksa and Uni Bremen 2011
License : GPLv2 or higher, see LICENSE.txt
Maintainer : eugenk@informatik.uni-bremen.de
Stability : provisional
Porta... | mariefarrell/Hets | CommonLogic/AS_CommonLogic.der.hs | gpl-2.0 | 9,494 | 0 | 13 | 2,372 | 2,793 | 1,443 | 1,350 | 222 | 5 |
{-# LANGUAGE DeriveDataTypeable #-}
module Common where
import Control.Exception
import Data.Typeable
import Data.Data
-- A EndUserFailure corresponds to user error; anything other exceptions
-- are our fault
data EndUserFailure = UpdateFailure | ParseFailure
deriving (Typeable, Show, Data)
instance Exception En... | diflying/logitext | Common.hs | bsd-3-clause | 333 | 0 | 6 | 47 | 54 | 32 | 22 | 8 | 0 |
{-# LANGUAGE Haskell2010 #-}
{-# LINE 1 "System/FilePath.hs" #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE Safe #-}
{- |
Module : System.FilePath
Copyright : (c) Neil Mitchell 2005-2014
License : BSD3
Maintainer : ndmitchell@gmail.com
Stability : stable
Portabil... | phischu/fragnix | tests/packages/scotty/System.FilePath.hs | bsd-3-clause | 681 | 0 | 5 | 151 | 26 | 19 | 7 | 6 | 0 |
{-# LANGUAGE FlexibleInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- | orphan instances
module Instances where
import Control.Monad.State.Strict
import Network.MPD.Core
instance MonadMPD (StateT a MPD) where
getVersion = lift getVersion
open = lift open
close = lift ... | haasn/vimus | src/Instances.hs | mit | 426 | 5 | 8 | 114 | 90 | 49 | 41 | 12 | 0 |
{-# LANGUAGE Unsafe #-}
{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples #-}
{-# OPTIONS_HADDOCK hide #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Pack
-- Copyright : (c) The University of Glasgow 1997-2002
-- License : see libraries/base/... | alexander-at-github/eta | libraries/base/GHC/Pack.hs | bsd-3-clause | 3,267 | 0 | 13 | 738 | 743 | 401 | 342 | 52 | 2 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
Type checking of type signatures in interface files
-}
{-# LANGUAGE CPP #-}
module TcIface (
tcLookupImported_maybe,
importDecl, checkWiredInTyCon, tcHiBootIface, typecheckIface,
tcIfaceDecl, tcIf... | wxwxwwxxx/ghc | compiler/iface/TcIface.hs | bsd-3-clause | 63,828 | 879 | 49 | 22,069 | 9,262 | 5,593 | 3,669 | -1 | -1 |
{-# LANGUAGE FlexibleContexts, ParallelListComp #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
module Validate (Similar(..), validate, validate') where
import Data.Int
import Data.Word
import Data.Array.IArray
import Foreign.C.Types
import Foreign.Storable
import Control.Exception (assert)
import Unsaf... | blambo/accelerate-examples | src/Validate.hs | bsd-3-clause | 3,372 | 4 | 20 | 764 | 1,258 | 678 | 580 | 73 | 1 |
import Sudoku
import Control.Exception
import System.Environment
import Control.Parallel.Strategies hiding (parMap)
import Data.Maybe
-- <<main
main :: IO ()
main = do
[f] <- getArgs
file <- readFile f
let puzzles = lines file
solutions = runEval (parMap solve puzzles)
evaluate (length puzzles)
pri... | lywaterman/parconc-examples | sudoku4.hs | bsd-3-clause | 505 | 0 | 12 | 113 | 232 | 116 | 116 | 19 | 1 |
{-# LANGUAGE FlexibleInstances, UndecidableInstances, OverlappingInstances, OverloadedStrings, TypeFamilies, RankNTypes, DeriveDataTypeable, StandaloneDeriving, FlexibleContexts, TypeSynonymInstances, ScopedTypeVariables, GADTs, GeneralizedNewtypeDeriving, BangPatterns, DeriveGeneric #-}
------------------------------... | philderbeast/ghcjs | src/Compiler/JMacro/Base.hs | mit | 34,012 | 0 | 21 | 9,648 | 12,066 | 6,181 | 5,885 | 647 | 35 |
{-# LANGUAGE UnboxedTuples #-}
module T9404 where
foo _ = case seq () (# #) of (# #) -> ()
foo2 _ = case () `seq` (# #) of (# #) -> ()
| siddhanathan/ghc | testsuite/tests/typecheck/should_compile/T9404.hs | bsd-3-clause | 137 | 0 | 8 | 35 | 60 | 32 | 28 | 4 | 1 |
{-# OPTIONS_GHC -fwarn-missing-signatures #-}
module Main (main, c_type_default, c_unused_bind) where
import A (a)
import B (b)
main :: IO ()
main = print (a + b)
c_type_default :: Int
c_type_default = 2 ^ 2
c_unused_bind :: Int -> Int
c_unused_bind x = 2
| urbanslug/ghc | testsuite/tests/driver/dynamic_flags_001/C.hs | bsd-3-clause | 263 | 0 | 7 | 50 | 88 | 51 | 37 | 10 | 1 |
module Anagrams where
import Data.List (sort, intercalate)
import qualified Data.Map.Lazy as Map
type Word = String
extractN :: Int -> [Word] -> [Word]
extractN n =
filter lengthN
where
lengthN :: String -> Bool
lengthN word = length word == n
anagram :: Word -> Word
anagram = sort
anagramList ::... | dirkz/Thinking_Functionally_With_Haskell | 1/Anagrams.hs | isc | 843 | 0 | 11 | 189 | 372 | 209 | 163 | 21 | 1 |
-- Where my anagrams at?
-- http://www.codewars.com/kata/523a86aa4230ebb5420001e1/
module Anagram where
import Data.List (sort)
anagrams :: String -> [String] -> [String]
anagrams w = filter $ (sort w ==) . sort
| gafiatulin/codewars | src/5 kyu/Anagram.hs | mit | 215 | 0 | 8 | 33 | 58 | 34 | 24 | 4 | 1 |
{-# OPTIONS_HADDOCK show-extensions #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances ... | dmcclean/exact-pi | src/Data/ExactPi/TypeLevel.hs | mit | 5,423 | 13 | 10 | 1,066 | 903 | 535 | 368 | -1 | -1 |
module Console (execute, executeInLoop) where
import Data.List.Split
import MyHttp (
Context(..)
, ServerPart
, Request(..)
, RequestType(..)
, Response(..)
)
execute :: Context -> ServerPart -> IO ()
execute inputContext serverpart =
case serverpart inputContext of
Just c... | nicolocodev/learnhappstack | 5_UsingMsum/Console.hs | mit | 1,137 | 0 | 15 | 352 | 340 | 181 | 159 | 34 | 3 |
{-# htermination isNothing :: Maybe a -> Bool #-}
import Maybe
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/Maybe_isNothing_1.hs | mit | 63 | 0 | 3 | 11 | 5 | 3 | 2 | 1 | 0 |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
module Models.Url
( Url(..)
, isDetailUrl
) where
import BasicPrelude
import Data.Aeson (FromJSON(..), ToJSON(..), genericParseJSON, genericToJSON)
import Data.Aeson.Types (defaultOptions, fieldLabelModifier)
i... | nicolashery/example-marvel-haskell | Models/Url.hs | mit | 732 | 0 | 9 | 143 | 185 | 109 | 76 | 22 | 1 |
{-# htermination intersectFM_C :: Ord a => (b1 -> b2 -> b3) -> FiniteMap a b1 -> FiniteMap a b2 -> FiniteMap a b3 #-}
import FiniteMap
| ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/full_haskell/FiniteMap_intersectFM_C_1.hs | mit | 135 | 0 | 3 | 27 | 5 | 3 | 2 | 1 | 0 |
module Q07 where
data NestedList a = Elem a | List [NestedList a]
flatten :: NestedList a -> [a]
flatten x =
let
flatten' :: NestedList a -> [a] -> [a]
flatten' (Elem x) = \y -> x:y
flatten' (List y) = foldr (.) (\x -> x) $ map flatten' y
in
(flatten' x) [] | cshung/MiscLab | Haskell99/q07.hs | mit | 283 | 0 | 12 | 80 | 148 | 78 | 70 | 9 | 2 |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module QPX.API.Response.Currency where
import Control.Lens (makeLenses)
import Control.Monad (mzero)
import Data.Aeson (FromJSON, Value (String), parseJSON)
import Data.Char ... | timbodeit/qpx-api | src/QPX/API/Response/Currency.hs | mit | 836 | 0 | 10 | 282 | 210 | 115 | 95 | 18 | 0 |
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
module Game where
import Control.Monad.Random
import Utils (maximumByKey, iterateN)
type Heuristic a s = s -> a -> Double
class Game a s | s -> a where
agent :: s -> a
actions :: s -> [s]
terminal :: s -> Bool
evaluate :: Heuris... | vladfi1/game-ai | lib/Game.hs | mit | 2,122 | 0 | 11 | 459 | 899 | 454 | 445 | 51 | 2 |
{-# LANGUAGE OverloadedStrings #-}
module Slack
( OAuthAccessResponse(..)
, Token(..)
, TeamId
, issueSlackToken
) where
import Data.Aeson
import Data.Aeson.Types (typeMismatch)
import Data.List (intercalate)
import Network.HTTP.Simple (httpJSON, getResponseBody, parseRequest)
import ... | Kercoin/yummy | src/Slack.hs | mit | 2,049 | 0 | 17 | 523 | 544 | 292 | 252 | 48 | 1 |
import Prelude hiding (Left, Right)
import Control.Applicative
import Control.Monad (join)
import Data.Monoid hiding (Sum, First)
import Test.QuickCheck hiding (Success)
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
-- Write Monad instances for the following types. Use the QuickCheck properties
-- we ... | diminishedprime/.org | reading-list/haskell_programming_from_first_principles/18_07.hs | mit | 4,484 | 0 | 13 | 1,179 | 1,770 | 907 | 863 | 120 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Y2020.M11.D17.Exercise where
{--
So.
Okay.
I was going to go all: map countries and their airbases to a KML-file, but
to do that, I need a lat-long of the country, and where best to do that,
other than the country's capital. But we don't have country capitals, so
it's back ... | geophf/1HaskellADay | exercises/HAD/Y2020/M11/D17/Exercise.hs | mit | 3,997 | 0 | 8 | 771 | 334 | 201 | 133 | 41 | 1 |
module Text.Highlighting.Color.QQ (str) where
import Language.Haskell.TH
import Language.Haskell.TH.Quote
str = QuasiQuoter
{ quoteExp = stringE
, quotePat = undefined
, quoteType = undefined
, quoteDec = undefined
}
| dmalikov/highlighting-colors | src/Text/Highlighting/Color/QQ.hs | mit | 229 | 0 | 6 | 40 | 57 | 38 | 19 | 8 | 1 |
{-# LANGUAGE TemplateHaskell, RankNTypes, ScopedTypeVariables #-}
module Language.Meta.C99.Quote (
c,
ce,
cs
) where
import Language.Haskell.TH
import Language.Haskell.TH.Lib
import Language.Haskell.TH.Quote
import Language.Haskell.TH.Lift
import Language.Haskell.TH.Syntax
import qualified Language.Haskell.... | ykst/MetaC | Language/Meta/C99/Quote.hs | mit | 6,857 | 3 | 22 | 1,783 | 2,231 | 1,209 | 1,022 | 178 | 8 |
module CabalSpec (main, spec) where
import Helper
import Cabal
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "format" $ do
it "creates a cabal file" $ do
format "foo" [
package "base-4.6.0.1"
, package "bytestring-0.10.0.2"
] [
pa... | sol/depends | test/CabalSpec.hs | mit | 1,380 | 0 | 16 | 552 | 205 | 118 | 87 | 46 | 1 |
{-# LANGUAGE GADTs, CPP, Trustworthy, TemplateHaskell, TupleSections, ViewPatterns, DeriveDataTypeable, ScopedTypeVariables #-}
module Main where
import JavaScript.Web.Worker.Extras
import qualified Tarefa6_li1g147 as G147
main :: IO ()
main = runSyncWorker $ \(inp::[String],player::Int,ticks::Int) -> G147.bot inp... | hpacheco/HAAP | examples/gameworker/Worker3.hs | mit | 341 | 0 | 9 | 47 | 75 | 45 | 30 | 6 | 1 |
module Three where
main :: IO ()
main = do
putStrLn greeting
printSecond
where greeting = "Yarrrrr"
printSecond :: IO ()
printSecond = do
putStrLn greeting
| mudphone/HaskellBook | src/Three.hs | mit | 189 | 0 | 9 | 59 | 56 | 28 | 28 | 9 | 1 |
-- Copyright (c) 2016-present, SoundCloud Ltd.
-- All rights reserved.
--
-- This source code is distributed under the terms of a MIT license,
-- found in the LICENSE file.
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
module Kubern... | soundcloud/haskell-kubernetes | lib/Kubernetes/Model/V1/ISCSIVolumeSource.hs | mit | 2,055 | 0 | 14 | 573 | 374 | 220 | 154 | 47 | 1 |
{-# LANGUAGE DeriveDataTypeable, ViewPatterns #-}
import Control.Monad (when, unless)
import Data.List (delete)
import System.Console.CmdArgs
import System.Directory (doesFileExist, removeFile)
import System.Environment (getEnvironment)
import System.IO.Error (catchIOError)
data Options = Options
{ filename :: S... | lomeo/linecache | Main.hs | mit | 1,937 | 0 | 17 | 505 | 634 | 326 | 308 | 50 | 2 |
module Roman (numerals) where
import Control.Monad (liftM2, liftM)
import qualified Data.Map.Strict as Map
import Data.Maybe (fromMaybe)
import Debug.Trace
base = [(1, Just "I"),
(5, Just "V"),
(10, Just "X"),
(50, Just "L"),
(100, Just "C"),
(500, Just "D"),
(1000, Jus... | c19/Exercism-Haskell | roman-numerals/src/Roman.hs | mit | 1,275 | 0 | 13 | 339 | 614 | 323 | 291 | 28 | 1 |
{-# LANGUAGE CPP #-}
{-# LANGUAGE PackageImports #-}
import "terrelln-me" Application (getApplicationDev)
import Network.Wai.Handler.Warp
(runSettings, defaultSettings, setPort)
import Control.Concurrent (forkIO)
import System.Directory (doesFileExist, removeFile)
import System.Exit (exitSuccess)
import Control.Con... | terrelln/terrelln.me | devel.hs | mit | 895 | 0 | 12 | 134 | 238 | 131 | 107 | 24 | 2 |
module Network.Skype.Protocol.ChatMember where
import Data.Typeable (Typeable)
import Network.Skype.Protocol.Chat
import Network.Skype.Protocol.Types
data ChatMemberProperty = ChatMemberChatName ChatID
| ChatMemberIdentity UserID
| ChatMemberRole ChatRole
... | emonkak/skype4hs | src/Network/Skype/Protocol/ChatMember.hs | mit | 388 | 0 | 6 | 104 | 71 | 44 | 27 | 9 | 0 |
{-# LANGUAGE TemplateHaskell, DeriveDataTypeable #-}
module Robots2.Quiz where
import Inter.Types
import Autolib.ToDoc
import Autolib.Reader
import Data.Typeable
data RC = RC { width :: Integer -- ^ feld geht von (-w.-w) .. (w,w)
, num_robots :: Int
, num_targets :: Int
, at_least :: Int -- ^ ... | Erdwolf/autotool-bonn | src/Robots2/Quiz.hs | gpl-2.0 | 643 | 4 | 9 | 158 | 148 | 93 | 55 | 19 | 1 |
-- We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital and is also prime.
--
-- What is the largest n-digit pandigital prime that exists?
import Data.List
import Prime
main :: IO ()
main = print answer
-- Pull out the large... | ciderpunx/project_euler_in_haskell | euler041.hs | gpl-2.0 | 861 | 0 | 12 | 207 | 177 | 97 | 80 | 14 | 2 |
module Utils (zipK) where
zipK :: [a] -> [a] -> a -> [(a, a)]
zipK (x:xs) (y:ys) k = (x, y) : zipK xs ys k
zipK (x:xs) _ k = (x, k) : zipK xs [] k
zipK _ (y:ys) k = (k, y) : zipK [] ys k
zipK _ _ k = []
| aauger/HaskellCoreUtils | HaskellCoreUtils/src/Utils.hs | gpl-3.0 | 224 | 0 | 9 | 77 | 174 | 95 | 79 | 6 | 1 |
{-# LANGUAGE CPP #-}
module Main (main) where
import Control.Applicative ((<|>))
import Control.Monad (forM_, unless, (>=>))
import Data.Char (toLower)
import Data.List (nub, partition, sort)
import Data.Maybe (catMaybe... | mtolly/jammittools | Main.hs | gpl-3.0 | 14,153 | 0 | 26 | 4,188 | 4,516 | 2,321 | 2,195 | 324 | 23 |
{-# LANGUAGE OverloadedStrings #-}
module XMonad.Hooks.DynamicLog.Status.DZen2.Fancy where
import XMonad.Hooks.DynamicLog.Status.System
import XMonad.Hooks.DynamicLog.Status.StatusText
import XMonad.Hooks.DynamicLog.Status.DZen2.Universal
import Control.Monad.IO.Class
colorBattery :: Int -> (String -> StatusText)
c... | Fizzixnerd/xmonad-config | site-haskell/src/XMonad/Hooks/DynamicLog/Status/DZen2/Fancy.hs | gpl-3.0 | 605 | 0 | 13 | 104 | 192 | 104 | 88 | 18 | 1 |
module Nucleic.FlatColor (
lightGrey, mediumGrey,
torquoise, emerald, peterriver, amethyst, wetasphalt,
greensea, nephritis, belizehole, wisteria, midnightblue,
sunflower, carrot, alizarin, clouds, concrete,
orange, pumpkin, pomegranate, silver, asbestos
) where
import Nucleic.Color (RGB (..))
-- accent0 ... | RayRacine/nucleic | Nucleic/FlatColor.hs | gpl-3.0 | 1,788 | 0 | 6 | 461 | 439 | 267 | 172 | 34 | 1 |
module Hadolint.Rule.DL3033 (rule) where
import qualified Data.Text as Text
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 = "DL3033"
severity = DLWarningC
message = "Spec... | lukasmartinelli/hadolint | src/Hadolint/Rule/DL3033.hs | gpl-3.0 | 821 | 0 | 11 | 151 | 231 | 127 | 104 | 18 | 2 |
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators ... | brendanhay/gogol | gogol-doubleclick-bids/gen/Network/Google/Resource/DoubleClickBidManager/Sdf/Download.hs | mpl-2.0 | 4,473 | 0 | 18 | 1,096 | 711 | 414 | 297 | 103 | 1 |
{-
This file is part of Tractor.
Tractor is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Tractor is distribu... | ak1211/tractor | src/SBIsecCoJp/Broker.hs | agpl-3.0 | 15,718 | 0 | 17 | 3,922 | 2,920 | 1,551 | 1,369 | 225 | 2 |
module Codewars.Kata.FactorialTail where
import Data.List (group)
import Control.Arrow ((&&&))
zeroes :: Integral a => a -> a -> a
zeroes base n = minimum . ((f . (head &&& length)) <$>) . group . pd $ base
where f (a, b) = (`div` fromIntegral b) . sum . ((n `div`) <$>) $ [a ^ i | i <- [1 .. floor (fromIntegral a... | ice1000/OI-codes | codewars/301-400/factorial-tail.hs | agpl-3.0 | 560 | 0 | 15 | 175 | 294 | 162 | 132 | 10 | 1 |
module Main where
import Prelude as P hiding ((.), id)
import System.Console.GetOpt
import System.Environment
import System.FilePath.Posix
import Control.Applicative
import Control.Category
import qualified Data.ByteString as B
import Text.CSV
import Types
import Conduits
--Run main program, either encoding or d... | nsmryan/BIC | Main.hs | unlicense | 1,866 | 0 | 21 | 570 | 540 | 295 | 245 | 49 | 3 |
module Algo.List (
splitAts,
interswap,
interswapInRange,
slice,
inRange,
rangeSize,
shrinkRange,
splits
) where
import Control.Monad (MonadPlus(..))
tuple2ToList tpl = case tpl of
(p,r) -> [p,r]
splitAts :: [Int] -> [a] -> [[a]]
splitAts ids lst = go ids lst 0
where go... | seckcoder/lang-learn | haskell/algo/src/Algo/List.hs | unlicense | 1,469 | 0 | 12 | 403 | 853 | 469 | 384 | 44 | 2 |
-----------------------------------------------------------------------------
-- Copyright 2019, Ideas project team. This file is distributed under the
-- terms of the Apache License 2.0. For more information, see the files
-- "LICENSE.txt" and "NOTICE.txt", which are included in the distribution.
-----------------... | ideas-edu/ideas | src/Ideas/Encoding/StrategyInfo.hs | apache-2.0 | 4,771 | 0 | 17 | 1,320 | 492 | 271 | 221 | 37 | 2 |
{-# LANGUAGE RebindableSyntax #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ViewPatterns #-}
{-
Copyright 2018 The CodeWorld Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this f... | tgdavies/codeworld | codeworld-base/src/Internal/Color.hs | apache-2.0 | 4,344 | 0 | 12 | 773 | 1,342 | 749 | 593 | 91 | 1 |
module {-# REL #-} BottomHidden (
HiddenType(..)
) where
-- This is hidden only at the package level, but we're not using packages...
newtype HiddenType = Hide String deriving Show
| dimitri-xyz/relative-imports-test-bottom | BottomHidden.hs | apache-2.0 | 188 | 0 | 5 | 37 | 26 | 18 | 8 | 3 | 0 |
module Main where
import Data.List (genericLength)
import Data.Maybe (catMaybes)
import System.Console.ANSI
import System.Exit (exitFailure, exitSuccess)
import System.Process (readProcessWithExitCode)
import Text.Regex (matchRegex, mkRegex)
average :: (Fractional a, Real b) => [b] -> a
average xs = realToFrac (sum x... | listx/miro | test/doc-coverage.hs | bsd-2-clause | 1,325 | 0 | 12 | 290 | 441 | 218 | 223 | 39 | 2 |
{-# LANGUAGE BangPatterns #-}
module Network.Wai.Handler.Warp.MultiMap (
MultiMap
, isEmpty
, empty
, singleton
, insert
, Network.Wai.Handler.Warp.MultiMap.lookup
, pruneWith
, toList
, merge
) where
import Data.Hashable (hash)
import Data.IntMap.Strict (IntMap)
import qualified Data.IntMap.Str... | sordina/wai | warp/Network/Wai/Handler/Warp/MultiMap.hs | bsd-2-clause | 3,104 | 0 | 15 | 649 | 848 | 451 | 397 | 57 | 3 |
{-# LANGUAGE CPP, FlexibleInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-| Common helper functions and instances for all Ganeti tests.
-}
{-
Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permit... | ganeti/ganeti | test/hs/Test/Ganeti/TestCommon.hs | bsd-2-clause | 21,600 | 0 | 20 | 4,628 | 4,955 | 2,653 | 2,302 | 374 | 4 |
module Transformer.JustUnfold where
import qualified ConsPD.Unfold
import qualified Transformer.ConsPD
transform l = Transformer.ConsPD.transform "test/out/consPD" Nothing (ConsPD.Unfold.justUnfold l)
| kajigor/uKanren_transformations | src/Transformer/JustUnfold.hs | bsd-3-clause | 203 | 0 | 8 | 19 | 45 | 26 | 19 | 4 | 1 |
-- | Simple-config is a parser generator for simple configuration file.
--
-- To use this library, one needs import a module and set extensions.
--
-- > {-# LANGUAGE TemplateHaskell, QuasiQuotes #-}
-- > import Text.Config
--
-- The following is quick example.
--
-- > mkConfig "configParser" [config|
-- > TestConfig
--... | yunomu/simple-config | Text/Config.hs | bsd-3-clause | 1,398 | 0 | 5 | 398 | 88 | 77 | 11 | 6 | 0 |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
module Snap.Snaplet.Mandrill
( initMandrill
, runMandrill
, MandrillState (..)
, HasMandrill (..)
) where
import Control.Applicative
import Control.Monad.State
import Control.Monad.Trans.Reader
import ... | ixmatus/snaplet-mandrill | src/Snap/Snaplet/Mandrill.hs | bsd-3-clause | 1,596 | 0 | 11 | 291 | 309 | 171 | 138 | 31 | 1 |
-- |Read data from stdin, print FNV-1a hash to stdout
import Text.Printf (printf)
import qualified Data.ByteString.Lazy as L
import Data.Digest.Pure.FNV1a
main :: IO ()
main = do
c <- L.getContents
let hsh = fnv1a c
putStrLn $ show hsh
| zdavkeos/pureFNV1a | Test/fnv1a.hs | bsd-3-clause | 259 | 0 | 10 | 62 | 74 | 40 | 34 | 8 | 1 |
{-# LANGUAGE TemplateHaskell #-}
module TestAux where
import Ciel
-- import Debug.Trace (trace)
sumup :: [Int] -> CielWF Int
sumup is = return $ sum is
add5 :: Int -> CielWF Int
add5 i = return (i+5)
add1 :: Int -> CielWF Int
add1 i = return (i+1)
$(remotable ['sumup,'add5,'add1])
| jepst/Cielhs | TestAux.hs | bsd-3-clause | 288 | 0 | 8 | 56 | 121 | 65 | 56 | 10 | 1 |
module Data.Metagraph.Builder(
-- * Types
MetaGraphM
-- * Basic API
, buildMetaGraph
, newMetaGraph
, newNode
, newEdge
, addNode
, addEdge
-- * Helpers
, lookupGraph
, lookupEdge
, lookupNode
) where
import Data.Metagraph.Strict
import Data.IntMap (IntMap)
import qualified Data.IntMap.St... | Teaspot-Studio/metagraph | src/Data/Metagraph/Builder.hs | bsd-3-clause | 7,694 | 0 | 17 | 1,630 | 2,191 | 1,125 | 1,066 | -1 | -1 |
module Rad.QL.Define.Util where
import Data.Monoid ((<>))
import Unsafe.Coerce
import Rad.QL.Internal.Builders
import Rad.QL.Internal.Types
import Rad.QL.AST
import Rad.QL.Types
unit :: (Applicative m) => m ()
unit = pure ()
-- The describeable class, allows use to use the `describe` method to append a description... | jqyu/bustle-chi | src/Rad/QL/Define/Util.hs | bsd-3-clause | 1,128 | 0 | 9 | 201 | 337 | 189 | 148 | -1 | -1 |
{-# LANGUAGE OverloadedStrings, PackageImports #-}
import "GLFW-b" Graphics.UI.GLFW as GLFW
import Binary.Fast
import Codec.Image.STB
import Control.Applicative
import Control.Monad
import Data.Bitmap.Pure
import Data.Vect
import FRP.Elerea.Param
import GLBackend
import GraphicsPipeline
import Utils
import qualified D... | csabahruska/GFXDemo | Main.hs | bsd-3-clause | 13,343 | 0 | 22 | 3,841 | 3,322 | 1,751 | 1,571 | 232 | 2 |
{-# LANGUAGE LambdaCase, RecordWildCards, Strict #-}
module AbstractInterpretation.BinaryIR (encodeAbstractProgram) where
import Control.Monad.State
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Map (Map)
import qualified Data.Map as Map
import qualified Data.ByteString.Lazy as LBS
import Data.Byt... | andorp/grin | grin/src/AbstractInterpretation/BinaryIR.hs | bsd-3-clause | 5,955 | 0 | 19 | 1,493 | 1,991 | 924 | 1,067 | 204 | 12 |
module Machine.Gates (nand
,not
,and
,or
,xor
,mux
,dmux
,notN
,andN
,orN
,muxN
,orNWay
... | btipling/machine-vm | src/Machine/Gates.hs | bsd-3-clause | 4,869 | 0 | 15 | 1,888 | 1,643 | 866 | 777 | 80 | 1 |
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Language.ECMAScript5.Parser
import Language.ECMAScript5.Syntax
import Data.ByteString
import Data.String
import Prelude hiding (getContents, putStr)
main :: IO ()
main = do src <- getContents
case parse program "" src of
Left err -> put... | achudnov/language-ecmascript-console | Main.hs | bsd-3-clause | 433 | 0 | 13 | 103 | 124 | 67 | 57 | 12 | 2 |
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Test.Tasty
import Test.Tasty.HUnit
import Language.Haskell.TH
import Language.Haskell.TH.Alpha
main :: IO ()
main = defaultMain tests
tests :: TestTree
tests = testGroup "Tests" [unitTests]
unitTests :: TestTree
unitTests = testGroup "Unit tests"
[ tes... | jkarni/th-alpha | tests/tests.hs | bsd-3-clause | 1,817 | 0 | 16 | 501 | 477 | 250 | 227 | 50 | 1 |
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
module Duckling.Ordinal.HR.Tests
( tests ) where
import Data.String
import Prelude
import Test.Tasty
import Du... | facebookincubator/duckling | tests/Duckling/Ordinal/HR/Tests.hs | bsd-3-clause | 503 | 0 | 9 | 77 | 79 | 50 | 29 | 11 | 1 |
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
Utilities for desugaring
This module exports some utility functions of no great interest.
-}
{-# LANGUAGE CPP #-}
-- | Utility functions for constructing Core syntax, principally for desugaring
module DsUtils (
... | elieux/ghc | compiler/deSugar/DsUtils.hs | bsd-3-clause | 34,479 | 0 | 19 | 9,741 | 5,537 | 2,889 | 2,648 | -1 | -1 |
-----------------------------------------------------------------------------
-- |
-- Module : Language.VHDL.Error
-- Copyright : (c) SAM Group, KTH/ICT/ECS 2007-2008
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : christiaan.baaij@gmail.com
-- Stability : experimental
-- Portabilit... | christiaanb/vhdl | Language/VHDL/Error.hs | bsd-3-clause | 1,948 | 0 | 8 | 468 | 198 | 127 | 71 | 22 | 0 |
module Main where
import System.IO
import Control.Applicative
import Control.Monad.Trans.Reader
import qualified Data.Map as Map
import Parser
import TypeInferencer
import Interpreter
import Ast
main :: IO ()
main = withFile
"test/lambda.js"
ReadMode
(\handle -> do
source <- hGetCont... | fiigii/fJS | Main.hs | mit | 998 | 0 | 12 | 459 | 219 | 111 | 108 | 24 | 3 |
module PCProblem.Generator
( generator
)
where
import PCProblem.Type
import PCProblem.Param
import PCProblem.Solver
import Autolib.Util.Zufall
import Autolib.Letters
import Data.Maybe
import Data.List ( nub )
import Autolib.Set
import Inter.Quiz
gen :: Param -> IO PCP
gen p = do
{- hier kamen noch doppelte paar... | florianpilz/autotool | src/PCProblem/Generator.hs | gpl-2.0 | 2,708 | 20 | 20 | 950 | 911 | 470 | 441 | -1 | -1 |
{-# LANGUAGE DeriveDataTypeable #-}
{- |
Module : $Header$
Description : definition of the datatype describing
the abstract FreeCAD terms and and a few tools describing simple
mathematical operations on those building-blocks (3d vectors,
rotation matrices, rotation qu... | mariefarrell/Hets | FreeCAD/As.hs | gpl-2.0 | 4,093 | 0 | 10 | 1,111 | 621 | 364 | 257 | 43 | 0 |
module Aar.Parser.Numeric.Int where
import Control.Monad
import Text.Parsec.Prim (ParsecT)
import Text.ParserCombinators.Parsec
import Aar.Lexer.Token
sourcePos :: Monad m => ParsecT s u m SourcePos
sourcePos = statePos `liftM` getParserState
parseOctNum :: Parse... | aar-lang/aar | lib/Aar/Parser/Numeric/Int.hs | gpl-3.0 | 820 | 0 | 10 | 205 | 262 | 130 | 132 | 26 | 1 |
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecursiveDo #-}... | bitemyapp/fusion | Fusion.hs | bsd-3-clause | 23,019 | 0 | 24 | 6,974 | 7,765 | 3,946 | 3,819 | -1 | -1 |
{-
Teak synthesiser for the Balsa language
Copyright (C) 2007-2010 The University of Manchester
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... | balangs/eTeak | src/BalsaLexer.hs | bsd-3-clause | 7,791 | 0 | 18 | 2,493 | 2,233 | 1,221 | 1,012 | 152 | 5 |
{-# LANGUAGE CPP, MagicHash, NondecreasingIndentation, UnboxedTuples,
RecordWildCards, BangPatterns #-}
-- -----------------------------------------------------------------------------
--
-- (c) The University of Glasgow, 2005-2007
--
-- Running statements interactively
--
-- --------------------------------------... | olsner/ghc | compiler/main/InteractiveEval.hs | bsd-3-clause | 38,399 | 13 | 30 | 10,053 | 8,705 | 4,438 | 4,267 | 681 | 4 |
module Main (main) where
import qualified System.FilePath.Glob as Glob
import qualified Test.DocTest as DocTest
includeDirs :: [String]
includeDirs = []
doctestWithIncludeDirs :: [String] -> IO ()
doctestWithIncludeDirs fs = DocTest.doctest (map ("-I" ++) includeDirs ++ fs)
main :: IO ()
main = Glob.glob "src/**/*.... | rcook/sudoku-solver | test/Main.hs | bsd-3-clause | 350 | 0 | 9 | 49 | 111 | 64 | 47 | 9 | 1 |
string1 = "hello"
string2 = "world"
greeting = string1 ++ " " ++ string2 | keshavbashyal/playground-notes | unfinished-courses/haskell-fundamentals/hello.hs | mit | 73 | 0 | 6 | 14 | 24 | 13 | 11 | 3 | 1 |
{-# language ScopedTypeVariables, OverloadedStrings #-}
module Base.Renderable.Header (header, headerHeight) where
import Data.Abelian
import Graphics.Qt
import Utils
import Base.Types
import Base.Constants
import Base.Prose
import Base.Font
import Base.Pixmap
import Base.Renderable.HBox
import Base.Renderable.C... | geocurnoff/nikki | src/Base/Renderable/Header.hs | lgpl-3.0 | 2,265 | 0 | 20 | 519 | 561 | 288 | 273 | 58 | 4 |
-------------------------------------------------------------------------------
-- |
-- Module : System.Hardware.Haskino.SamplePrograms.Deep.ScheduledBlinkE
-- Copyright : (c) University of Kansas
-- License : BSD3
-- Stability : experimental
--
-- The /hello world/ of the arduino world, blinking the l... | ku-fpg/kansas-amber | legacy/Deep/ScheduledBlinkE.hs | bsd-3-clause | 1,986 | 0 | 11 | 404 | 341 | 173 | 168 | 35 | 1 |
-- GSoC 2013 - Communicating with mobile devices.
-- | This library defines an API for communicating with Android powered devices, sending Push Notifications through Google Cloud Messaging (HTTP connection).
module Network.PushNotify.Gcm
(
-- * GCM Service
sendGCM
-- * GCM Settings
, GCMHttpConf... | MarcosPividori/GSoC-Communicating-with-mobile-devices | push-notify/Network/PushNotify/Gcm.hs | mit | 506 | 0 | 5 | 113 | 56 | 41 | 15 | 9 | 0 |
{-# LANGUAGE TypeFamilies, DataKinds, PolyKinds, ExplicitForAll, GADTs,
UndecidableInstances, RankNTypes, ScopedTypeVariables #-}
module T14066a where
import Data.Proxy
import Data.Kind
import Data.Type.Bool
type family Bar x y where
Bar (x :: a) (y :: b) = Int
Bar (x :: c) (y :: d) = Bool -- a,b... | sdiehl/ghc | testsuite/tests/dependent/should_compile/T14066a.hs | bsd-3-clause | 2,522 | 0 | 11 | 632 | 707 | 413 | 294 | -1 | -1 |
-----------------------------------------------------------------------------
-- |
-- Module : Main (hlint)
-- Copyright : (C) 2013-2015 Edward Kmett
-- License : BSD-style (see the file LICENSE)
-- Maintainer : Edward Kmett <ekmett@gmail.com>
-- Stability : provisional
-- Portability : portable
--
... | ekmett/concurrent | tests/hlint.hs | bsd-2-clause | 718 | 0 | 10 | 117 | 96 | 57 | 39 | 10 | 1 |
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.Complex
-- Copyright : (c) The University o... | tolysz/prepare-ghcjs | spec-lts8/base/Data/Complex.hs | bsd-3-clause | 8,399 | 2 | 15 | 2,957 | 2,779 | 1,455 | 1,324 | -1 | -1 |
module Test18 where
f = 45
| kmate/HaRe | old/testing/refacSlicing/Test18_TokOut.hs | bsd-3-clause | 30 | 0 | 4 | 9 | 9 | 6 | 3 | 2 | 1 |
{-# LANGUAGE TemplateHaskell, FlexibleInstances #-}
module TH_overlaps where
import Language.Haskell.TH
class C1 a where c1 :: a
class C2 a where c2 :: a
class C3 a where c3 :: a
[d|
instance {-# OVERLAPPABLE #-} C1 [a] where c1 = []
instance C1 [Int] where c1 = [1]
instance ... | olsner/ghc | testsuite/tests/th/TH_overlaps.hs | bsd-3-clause | 743 | 0 | 7 | 247 | 159 | 98 | 61 | 20 | 1 |
{-# LANGUAGE ForeignFunctionInterface #-}
module Shared001 where
-- Test for building DLLs with ghc -shared, see #2745
f :: Int -> Int
f x = x+1
foreign export ccall f :: Int -> Int
| ezyang/ghc | testsuite/tests/driver/Shared001.hs | bsd-3-clause | 185 | 0 | 6 | 37 | 41 | 24 | 17 | 5 | 1 |
module Spring where
import Data.Array.Unboxed
step :: UArray Int Double -> [Double]
step y = [y!1 + y!0]
| urbanslug/ghc | testsuite/tests/codeGen/should_compile/T3132.hs | bsd-3-clause | 107 | 0 | 8 | 20 | 50 | 28 | 22 | 4 | 1 |
{-
collatz computes the number of Collatz chains from one to the maximum
starting number where the length of the chain is greater than bound.
-}
module Main where
start = 100000
bound = 40
chain :: Integer -> [Integer]
chain 1 = [1]
chain x
| even x = x: chain (div x 2)
| odd x = x : chain (3 * x + 1)
numLong... | kisom/collatz | collatz.hs | isc | 490 | 0 | 10 | 135 | 165 | 85 | 80 | 13 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.