_id stringlengths 64 64 | repository stringlengths 6 84 | name stringlengths 4 110 | content stringlengths 0 248k | license null | download_url stringlengths 89 454 | language stringclasses 7
values | comments stringlengths 0 74.6k | code stringlengths 0 248k |
|---|---|---|---|---|---|---|---|---|
1831e067d1592703a7ac9e0fedbed3bee8cdc7798bf6e0b6977c8c27eec7bcc1 | mirage/ocaml-9p | protocol_9p_filesystem.ml |
* Copyright ( C ) 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/mirage/ocaml-9p/b72ccf01d3c8d7942e7ba8daefda08bf08c902b1/lib/protocol_9p_filesystem.ml | ocaml |
* Copyright ( C ) 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | |
9a62885ff391dd08002c98787a2d5c0368088d075fa7bdeca65f9b4539099361 | racket/plai | command-line.rkt | #lang scheme
(provide disable-tests provide abridged-test-output gc-disable-import-gc?
alternate-collector set-alternate-collector!)
HACK ! ! !
(define (alternate-collector)
(getenv "PLAI_ALTERNATE_COLLECTOR"))
(define (set-alternate-collector! path)
(putenv "PLAI_ALTERNATE_COLLECTOR"
(if (p... | null | https://raw.githubusercontent.com/racket/plai/164f3b763116fcfa7bd827be511650e71fa04319/plai-lib/private/command-line.rkt | racket | #lang scheme
(provide disable-tests provide abridged-test-output gc-disable-import-gc?
alternate-collector set-alternate-collector!)
HACK ! ! !
(define (alternate-collector)
(getenv "PLAI_ALTERNATE_COLLECTOR"))
(define (set-alternate-collector! path)
(putenv "PLAI_ALTERNATE_COLLECTOR"
(if (p... | |
8fbcf9fc1fa51cf0444211f190d0080ec503fa818fc767ac2639cdccd49598b4 | bia-technologies/statsbit | component.clj | Copyright 2020 BIA - Technologies Limited Liability Company
;;
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
;;
;; -2.0
;;
;; Unless required by applicable law or agreed t... | null | https://raw.githubusercontent.com/bia-technologies/statsbit/4102ca5e5d39b1c06541b49615c6de83e7f4ef36/backend/src/ru/bia_tech/statsbit/utils/component.clj | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governi... | Copyright 2020 BIA - Technologies Limited Liability Company
distributed under the License is distributed on an " AS IS " BASIS ,
(ns ru.bia-tech.statsbit.utils.component
(:require
[com.stuartsierra.component :as component]))
(defrecord Derefable [value init dispose]
clojure.lang.IDeref
(deref [_] value... |
6a58fd298504d28fc1466fbebf731e5e40391b52871f0e8863c37d1693ee6a7f | MaskRay/OJHaskell | 12.hs | import Data.List
factors n = foldr (\x y ->
if n `mod` x == 0
then if x * x == n then x : y else x : n `div` x : y
else y) [] [1..floor $ (+1e-5) $ sqrt $ fromIntegral n]
main = print . head . filter ((> 500) . length . factors) $ tri
where tri = scanl1 (+) [1..] | null | https://raw.githubusercontent.com/MaskRay/OJHaskell/ba24050b2480619f10daa7d37fca558182ba006c/Project%20Euler/12.hs | haskell | import Data.List
factors n = foldr (\x y ->
if n `mod` x == 0
then if x * x == n then x : y else x : n `div` x : y
else y) [] [1..floor $ (+1e-5) $ sqrt $ fromIntegral n]
main = print . head . filter ((> 500) . length . factors) $ tri
where tri = scanl1 (+) [1..] | |
f17e436a7a81834fdb72812e56011d08e1cb9646af96f202a3b2696ba6283ba1 | returntocorp/semgrep | Parse_kotlin_tree_sitter.ml |
*
*
* Copyright ( c ) 2021 , 2022 R2C
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in fi... | null | https://raw.githubusercontent.com/returntocorp/semgrep/32dd88e2324ee96babfa09fe7400f44d4b0191ef/languages/kotlin/generic/Parse_kotlin_tree_sitter.ml | ocaml | ***************************************************************************
Prelude
***************************************************************************
***************************************************************************
Helpers
************************************************************************... |
*
*
* Copyright ( c ) 2021 , 2022 R2C
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in fi... |
a3c4e0678791c9a8e94ad66204ca4f89b538873aae2d16afe193da6365d443d3 | 15Galan/asignatura-204 | LinearQueue.hs | -------------------------------------------------------------------------------
-- Inefficient Queue (enqueue is O(n))
--
Data Structures . en Informática . UMA .
, 2012
-------------------------------------------------------------------------------
module DataStructures.Queue.LinearQueue
( Queue
, empty
... | null | https://raw.githubusercontent.com/15Galan/asignatura-204/894f33ff8e0f52a75d8f9ff15155c656f1a8f771/Pr%C3%A1cticas/DataStructures/Queue/LinearQueue.hs | haskell | -----------------------------------------------------------------------------
Inefficient Queue (enqueue is O(n))
-----------------------------------------------------------------------------
Showing a queue
Queue equality | Data Structures . en Informática . UMA .
, 2012
module DataStructures.Queue.LinearQueue
( Queue
, empty
, isEmpty
, enqueue
, first
, dequeue
) where
import Data.List(intercalate)
import Test.QuickCheck
data Queue a = Empty | Node a (Queue a)
empty :: Queue a
empty = Empty
isEmpty :: Queue a... |
d9db7a6994fe212d0b4246006e7d97cafd879c031d68de397939911d4a3cd4c8 | donaldsonjw/bigloo | kmp.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / runtime / Unsafe / kmp.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/donaldsonjw/bigloo/a4d06e409d0004e159ce92b9908719510a18aed5/runtime/Unsafe/kmp.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
*=====================================================================*/
*---------------------------... | * serrano / prgm / project / bigloo / runtime / Unsafe / kmp.scm * /
* Author : * /
* Creation : Mon Apr 10 13:43:22 2006 * /
* Last change : Sun May 30 07:57:30 2010 ( serrano ) * /
* Copy... |
d372158e4ecddaf166e3819387bd02997e190af084b9179ec7c7ad4e5b5a16a9 | clojure-garden/clojure-garden | dev.clj | (ns dev
(:require
[clojure.tools.namespace.repl :as tools.repl]
[integrant.core :as ig]
[integrant.repl :as ig-repl]
[integrant.repl.state :as ig-state]
[platform.system :as system]))
(tools.repl/set-refresh-dirs "src" "dev/src" "test/src")
(defn integrant-prep!
"Load Integrant configuration... | null | https://raw.githubusercontent.com/clojure-garden/clojure-garden/db7e1f2c6a3785b7dc930b3c98a5c74d416ff920/modules/backend/dev/src/dev.clj | clojure | (ns dev
(:require
[clojure.tools.namespace.repl :as tools.repl]
[integrant.core :as ig]
[integrant.repl :as ig-repl]
[integrant.repl.state :as ig-state]
[platform.system :as system]))
(tools.repl/set-refresh-dirs "src" "dev/src" "test/src")
(defn integrant-prep!
"Load Integrant configuration... | |
89f721a2d2ffb7a87cc14b51601eb333e4176c55472bcb4118a17b980bc0cae0 | patricoferris/ocaml-multicore-monorepo | stream.mli | This file is part of Dream , released under the MIT license . See LICENSE.md
for details , or visit .
Copyright 2021
for details, or visit .
Copyright 2021 Anton Bachin *)
(* Note: this is not a stable API! *)
type reader
type writer
type stream
type buffer =
(char, Bigarray.int8_unsigne... | null | https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/22b441e6727bc303950b3b37c8fbc024c748fe55/duniverse/dream/src/pure/stream.mli | ocaml | Note: this is not a stable API!
* A stream which matches each call of the reading function to one call of its
writing functions. For example, calling {!Stream.flush} on a pipe will cause
the reader to call its [~flush] callback.
* A stream which is neither readable nor writable.
* A read-only stream whose r... | This file is part of Dream , released under the MIT license . See LICENSE.md
for details , or visit .
Copyright 2021
for details, or visit .
Copyright 2021 Anton Bachin *)
type reader
type writer
type stream
type buffer =
(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Arr... |
ccd3b9266229940ed8db88eeb8dadf5145a10c847334e69735b3afe1a0f3a1b6 | parapluu/Concuerror | ets_delete_2.erl | -module(ets_delete_2).
-export([ets_delete_2/0]).
-export([ets_delete_2_twice/0]).
-export([scenarios/0]).
scenarios() -> [{?MODULE, inf, dpor}].
ets_delete_2() ->
P = self(),
spawn(fun() ->
ets:new(table, [public, named_table]),
P ! ok
end),
receive ok ->
... | null | https://raw.githubusercontent.com/parapluu/Concuerror/152a5ccee0b6e97d8c3329c2167166435329d261/tests/suites/basic_tests/src/ets_delete_2.erl | erlang | -module(ets_delete_2).
-export([ets_delete_2/0]).
-export([ets_delete_2_twice/0]).
-export([scenarios/0]).
scenarios() -> [{?MODULE, inf, dpor}].
ets_delete_2() ->
P = self(),
spawn(fun() ->
ets:new(table, [public, named_table]),
P ! ok
end),
receive ok ->
... | |
fe155f6f2ad0c669d1d9096e31f385d57a66cba5c8e69e3d5585d347744004a7 | certificate-transparency-watch/hs-certificate-transparency | SyncLogEntriesJob.hs | module Network.CertificateTransparency.SyncLogEntriesJob (
syncLogEntries
) where
import Control.Concurrent (threadDelay)
import Control.Concurrent.Async
import Control.Monad (when)
import qualified Crypto.Hash.MD5 as MD5
import qualified Data.Binary as B
import Data.Binary.Get (ByteOffset)
import qualified Data.B... | null | https://raw.githubusercontent.com/certificate-transparency-watch/hs-certificate-transparency/94da2b8b683ae31d80510223c8b48a91d2160f4e/Network/CertificateTransparency/SyncLogEntriesJob.hs | haskell | |Find the next log entry that we expect, query the log server
Returns whether the log server had new log entries. | module Network.CertificateTransparency.SyncLogEntriesJob (
syncLogEntries
) where
import Control.Concurrent (threadDelay)
import Control.Concurrent.Async
import Control.Monad (when)
import qualified Crypto.Hash.MD5 as MD5
import qualified Data.Binary as B
import Data.Binary.Get (ByteOffset)
import qualified Data.B... |
0a666dbd199853fa0a64e22240c1b1493ba7dda4cf988e89cda74b0dd3df1dac | haskell-gi/haskell-gi | Threading.hs | -- -*-haskell-*-
--
Author :
--
Created : 16 August 2017
--
Copyright ( C ) 2017
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation ; either
version 2.1 of the License , ... | null | https://raw.githubusercontent.com/haskell-gi/haskell-gi/bff8f3b92bf2594ea3d6745c346a8de594fc3709/gi-gtk-hs/src/Data/GI/Gtk/Threading.hs | haskell | -*-haskell-*-
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULA... | Author :
Created : 16 August 2017
Copyright ( C ) 2017
License as published by the Free Software Foundation ; either
version 2.1 of the License , or ( at your option ) any later version .
Portability : portable ( depends on GHC )
module Data.GI.Gtk.Threading
(
| Utility functions to run IO actio... |
d587e4feee32ebbd17becd64bc4f89657e13548bf283f8ebe5922213d7f5e18e | DomainDrivenArchitecture/dda-git-crate | project.clj | (defproject org.domaindrivenarchitecture/dda-git-crate "4.0.1-SNAPSHOT"
:description "Module for cloning and managing git repositories & server conectivity."
:url ""
:license {:name "Apache License, Version 2.0"
:url "-2.0.html"}
:dependencies [[org.domaindrivenarchitecture/dda-pallet "5.0.0"]
... | null | https://raw.githubusercontent.com/DomainDrivenArchitecture/dda-git-crate/0615144d107a2003d26cf157415de4fbeb2ee12a/project.clj | clojure | (defproject org.domaindrivenarchitecture/dda-git-crate "4.0.1-SNAPSHOT"
:description "Module for cloning and managing git repositories & server conectivity."
:url ""
:license {:name "Apache License, Version 2.0"
:url "-2.0.html"}
:dependencies [[org.domaindrivenarchitecture/dda-pallet "5.0.0"]
... | |
c6d41753205a397342f800e301a548c7de80f78a249298dc4c891dc40d200711 | mcorbin/tour-of-clojure | index.clj | (ns tourofclojure.pages.index
(:require [hiccup.element :refer [link-to]]
[clojure.java.io :as io]))
(def code
(slurp (io/resource "public/pages/code/index.clj")))
(defn desc
[lang]
(condp = lang
"fr" [:div
[:h2 "Bonjour !"]
[:p]
[:p "Bienvenue pour une introducti... | null | https://raw.githubusercontent.com/mcorbin/tour-of-clojure/57f97b68ca1a8c96904bfb960f515217eeda24a6/src/tourofclojure/pages/index.clj | clojure | (ns tourofclojure.pages.index
(:require [hiccup.element :refer [link-to]]
[clojure.java.io :as io]))
(def code
(slurp (io/resource "public/pages/code/index.clj")))
(defn desc
[lang]
(condp = lang
"fr" [:div
[:h2 "Bonjour !"]
[:p]
[:p "Bienvenue pour une introducti... | |
593852255c3fad6161b0cce4ad252f9c085d61b907f68115fd7c9c5d647e399f | tweag/sparkle | Dataset.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE LinearTypes #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QualifiedDo #
# LANGUAGE QuasiQuotes #
# LANGUAGE Scope... | null | https://raw.githubusercontent.com/tweag/sparkle/24b8c452e67b414f93e4d7fc8c54c7175ddb1b2f/src/linear-types/Control/Distributed/Spark/Safe/SQL/Dataset.hs | haskell | # LANGUAGE LinearTypes #
# LANGUAGE OverloadedStrings #
# OPTIONS_GHC -fplugin=Language.Java.Inline.Plugin #
| Like 'aggregate', but exposing the underlying iterator
element partition | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE QualifiedDo #
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StaticPointers #
# LANGUAGE Template... |
857df7d981f5fc3a17d734e8242956b9aee8bc48df56f525e76931c7144cf2a2 | RDTK/generator | util.lisp | util.lisp --- Utilities used in the model.project module .
;;;;
Copyright ( C ) 2017 , 2018 , 2019 Jan Moringen
;;;;
Author : < >
(cl:in-package #:build-generator.model.project)
(defun parse-dependency-spec (spec)
(flet ((result (nature target &optional version)
(list* (make-keyword (string-upca... | null | https://raw.githubusercontent.com/RDTK/generator/8d9e6e47776f2ccb7b5ed934337d2db50ecbe2f5/src/model/project/util.lisp | lisp |
New syntax:
nature: NATURE
version: VERSION | util.lisp --- Utilities used in the model.project module .
Copyright ( C ) 2017 , 2018 , 2019 Jan Moringen
Author : < >
(cl:in-package #:build-generator.model.project)
(defun parse-dependency-spec (spec)
(flet ((result (nature target &optional version)
(list* (make-keyword (string-upcase nature)... |
e8608f8f2696df8bfa730064b313b57971d52f06b359338a8cd833a0edad57fc | atzedijkstra/chr | AssocL.hs | module CHR.Data.AssocL
( -- * Assoc list
Assoc, AssocL
, assocLMapElt, assocLMapKey
, assocLElts, assocLKeys
, assocLGroupSort
, assocLMapUnzip
, ppAssocL, ppAssocL'
, ppAssocLV, ppAssocLH
, ppCurlysAssocL
-- * Utils
, combineToDistinguishedElts
)
where
import ... | null | https://raw.githubusercontent.com/atzedijkstra/chr/ad465828b1560831e90c4056e12338231872e8db/chr-data/src/CHR/Data/AssocL.hs | haskell | * Assoc list
* Utils
-----------------------------------------------------------------------------------------
- AssocL
-----------------------------------------------------------------------------------------
| intended for parsing
------------------------------------------------------------------------------------... | module CHR.Data.AssocL
Assoc, AssocL
, assocLMapElt, assocLMapKey
, assocLElts, assocLKeys
, assocLGroupSort
, assocLMapUnzip
, ppAssocL, ppAssocL'
, ppAssocLV, ppAssocLH
, ppCurlysAssocL
, combineToDistinguishedElts
)
where
import CHR.Pretty
import CHR.Utils
import Data... |
7499a5307ecfd4ccaad8d2451c4d445874b1c07d46ae08f5f56815ceae323c93 | sweirich/trellys | Parser.hs | # LANGUAGE StandaloneDeriving , DeriveDataTypeable , , ParallelListComp #
# OPTIONS_GHC -fno - warn - unused - do - bind -fno - warn - orphans #
module Language.SepPP.Parser (
parseModule
) where
import Language.SepPP.Syntax
import Language.SepPP.Options
import Unbound.LocallyNameless hiding (name,Infix,Val,Con,Eq... | null | https://raw.githubusercontent.com/sweirich/trellys/63ea89d8fa09929c23504665c55a3d909fe047c5/lib/sepp/Language/SepPP/Parser.hs | haskell | | Parse a string to module.
User state, so that we can update the operator parsing table.
| Lifting ParseErrors to Exceptions
| Parse an entire module
| Top-level binding
(x,ty) <- parens $ (,) <$> varName <* colon <*> expr
Flag handling
Tokenizer definition
for flags
semi :: ParsecT String u Identity String
... | # LANGUAGE StandaloneDeriving , DeriveDataTypeable , , ParallelListComp #
# OPTIONS_GHC -fno - warn - unused - do - bind -fno - warn - orphans #
module Language.SepPP.Parser (
parseModule
) where
import Language.SepPP.Syntax
import Language.SepPP.Options
import Unbound.LocallyNameless hiding (name,Infix,Val,Con,Eq... |
294ceae232f9dae8b56bd9c34d2e611f4aae6ba150519b909feebc5bf4834cbd | emanjavacas/cosycat | highlight_error.cljs | (ns cosycat.query.components.highlight-error
(:require [goog.string :as gstr]
[cosycat.utils :refer [nbsp]]))
(defn highlight-n [s n]
(let [pre (subs s 0 n)
post (subs s (inc n))
target [:span
{:style {:background-color "rgba(255, 0, 0, 0.3)"}}
(nth s n)]... | null | https://raw.githubusercontent.com/emanjavacas/cosycat/a7186363d3c0bdc7b714af126feb565f98793a6e/src/cljs/cosycat/query/components/highlight_error.cljs | clojure | (ns cosycat.query.components.highlight-error
(:require [goog.string :as gstr]
[cosycat.utils :refer [nbsp]]))
(defn highlight-n [s n]
(let [pre (subs s 0 n)
post (subs s (inc n))
target [:span
{:style {:background-color "rgba(255, 0, 0, 0.3)"}}
(nth s n)]... | |
9624e98ea69c566869d540c4652c544a5d6e2e3417e6232432836feead859b33 | iconnect/api-tools | API.hs | # LANGUAGE RecordWildCards #
# OPTIONS_GHC -fno - warn - orphans #
-- | This module converts an API specified with the DSL into a
-- JSON-encoded object so that it can be used in clients.
module Data.API.API
( apiAPI
, extractAPI
, convertAPI
, unconvertAPI
) where
import Data.API.API.DS... | null | https://raw.githubusercontent.com/iconnect/api-tools/3d7b4dfadf82c7cb859b515d033447bd1d8ef6c6/src/Data/API/API.hs | haskell | | This module converts an API specified with the DSL into a
JSON-encoded object so that it can be used in clients.
| Take an API spec and generate a JSON description of the API
| Generate an API spec from the JSON | # LANGUAGE RecordWildCards #
# OPTIONS_GHC -fno - warn - orphans #
module Data.API.API
( apiAPI
, extractAPI
, convertAPI
, unconvertAPI
) where
import Data.API.API.DSL
import qualified Data.API.API.Gen as D
import Data.API.Types
import Data.API.JSON
im... |
4f629be3f359a43cc34063373bc10b99dd2cc120f93347cb2f645e482360c309 | facebookarchive/pfff | exception.ml | exception X of string
| null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/tests/ml/parsing/exception.ml | ocaml | exception X of string
| |
a50b192791c5f5658bccfa1893b987bd05b32af30e6a6969749bd01fcc297157 | lisp-mirror/clpm | sandbox.lisp | ;;;; Pluggable sandbox clients.
;;;;
This software is part of CLPM . See README.org for more information . See
;;;; LICENSE for license information.
(uiop:define-package #:clpm/sandbox
(:use #:cl
#:clpm/sandbox/defs)
(:reexport #:clpm/sandbox/defs))
(in-package #:clpm/sandbox)
| null | https://raw.githubusercontent.com/lisp-mirror/clpm/ad9a704fcdd0df5ce30ead106706ab6cc5fb3e5b/clpm/sandbox.lisp | lisp | Pluggable sandbox clients.
LICENSE for license information. | This software is part of CLPM . See README.org for more information . See
(uiop:define-package #:clpm/sandbox
(:use #:cl
#:clpm/sandbox/defs)
(:reexport #:clpm/sandbox/defs))
(in-package #:clpm/sandbox)
|
c76e621eb8606ca0748c6f39116be6c8c23a89081dc7280810fa1e5f6efbe390 | racket/typed-racket | metafunction-tests.rkt | #lang racket/base
(require "test-utils.rkt"
rackunit racket/format
typed-racket/typecheck/tc-metafunctions
typed-racket/typecheck/tc-subst
typed-racket/rep/prop-rep
typed-racket/rep/type-rep
typed-racket/rep/object-rep
typed-racket/rep/values-rep
... | null | https://raw.githubusercontent.com/racket/typed-racket/6ea20bec8d41e1a188d7f831c35423293a89c98e/typed-racket-test/unit-tests/metafunction-tests.rkt | racket | we create some bindings so that syntax for the unit tests
refers to identifiers that produce #t for identifier-binding
Check additional props
Substitute into ranges correctly
Substitute into prop of any values
Prop is restricted by type of object
Prop restriction accounts for paths | #lang racket/base
(require "test-utils.rkt"
rackunit racket/format
typed-racket/typecheck/tc-metafunctions
typed-racket/typecheck/tc-subst
typed-racket/rep/prop-rep
typed-racket/rep/type-rep
typed-racket/rep/object-rep
typed-racket/rep/values-rep
... |
a1286ac4af7d038011530f5a23495f5dee925d7e549cf76c9cf0b25bcd8b1022 | herd/herdtools7 | HashedString.mli | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/b86aec8db64f8812e19468893deb1cdf5bbcfb83/tools/HashedString.mli | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2013 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
daf1a6b055da41b009f76a9f4d3b66ebfaab4a52725dae12471ea6325f27b289 | wz1000/HieDb | Orphans.hs | {-# LANGUAGE StandaloneDeriving, CPP #-}
# OPTIONS_GHC -fno - warn - orphans #
module Test.Orphans where
import HieDb.Compat
import HieDb.Types
#if __GLASGOW_HASKELL__ < 902
instance Show ModuleName where show = moduleNameString
#endif
instance Show OccName where show = occNameString
instance Show Name where
show n... | null | https://raw.githubusercontent.com/wz1000/HieDb/45c4671db2da8ce5cd11e964573846cfbf3bbec8/test/Test/Orphans.hs | haskell | # LANGUAGE StandaloneDeriving, CPP # | # OPTIONS_GHC -fno - warn - orphans #
module Test.Orphans where
import HieDb.Compat
import HieDb.Types
#if __GLASGOW_HASKELL__ < 902
instance Show ModuleName where show = moduleNameString
#endif
instance Show OccName where show = occNameString
instance Show Name where
show n =
let occ = nameOccName n
mo... |
7148655ef4752ea2923682336b2775e2ebbfea32964dc2635fdcb0c79135e7c6 | andrewmcloud/consimilo | lsh_util_test.clj | (ns consimilo.lsh-util-test
(:require [clojure.test :refer :all]
[consimilo.lsh-util :refer :all]
[consimilo.lsh-query :refer :all]))
(deftest get-hashranges-test
(testing "all ranges less than k * num trees"
(is (every? #(>= (* 5 8) %) (map #(apply max %) (get-hashranges 5 8)))))
(te... | null | https://raw.githubusercontent.com/andrewmcloud/consimilo/db96c1695248c3486e1d23de5589b39f0e0bd49f/test/consimilo/lsh_util_test.clj | clojure | (ns consimilo.lsh-util-test
(:require [clojure.test :refer :all]
[consimilo.lsh-util :refer :all]
[consimilo.lsh-query :refer :all]))
(deftest get-hashranges-test
(testing "all ranges less than k * num trees"
(is (every? #(>= (* 5 8) %) (map #(apply max %) (get-hashranges 5 8)))))
(te... | |
674961fec2d47e8684a59f7d20d88ae81c5068f2e7ba0bf84684329cadd5fb3d | lispnik/cl-http | dom.lisp | -*- mode : lisp ; package ( " DOM " ) -*-
;;;
this version ( C ) mecom gmbh 24.11.97
;;; available only from the cl-http repository and NOT to be REdistributed
;;; in ANY form. see cl-xml.html.
;;;
this is just a reminder for now , that a DOM - conforming interface would be
;;; nice.
(defPackage "DOM" (:use "CL"... | null | https://raw.githubusercontent.com/lispnik/cl-http/84391892d88c505aed705762a153eb65befb6409/contrib/janderson/xml-1998-02-27/dom.lisp | lisp | package ( " DOM " ) -*-
available only from the cl-http repository and NOT to be REdistributed
in ANY form. see cl-xml.html.
nice.
named character and numeric character references | this version ( C ) mecom gmbh 24.11.97
this is just a reminder for now , that a DOM - conforming interface would be
(defPackage "DOM" (:use "CL" #+:ccl "CCL" "XML-PARSER"))
(in-package :DOM)
(defMethod node.get-replacement-text
((datum xml-numeric-entity-reference))
(dtd-entity.content (xml-node.re... |
80229828ffbca9447ae197168df02fb1919a7da1ff380e9446b22952331a1cd6 | jacekschae/learn-re-frame-course-files | form_group.cljs | (ns app.components.form-group
(:require [re-frame.core :as rf]
[clojure.string :as str]
["@smooth-ui/core-sc" :refer [FormGroup Label Input Textarea ControlFeedback]]))
(defn form-group
[{:keys [id label type values textarea on-key-down]}]
(let [errors @(rf/subscribe [:errors])
in... | null | https://raw.githubusercontent.com/jacekschae/learn-re-frame-course-files/a86e6f14b89c595b4389b03459539a9544af4e1d/increments/57-time-and-trace/src/app/components/form_group.cljs | clojure | (ns app.components.form-group
(:require [re-frame.core :as rf]
[clojure.string :as str]
["@smooth-ui/core-sc" :refer [FormGroup Label Input Textarea ControlFeedback]]))
(defn form-group
[{:keys [id label type values textarea on-key-down]}]
(let [errors @(rf/subscribe [:errors])
in... | |
75842b14fcd261325482b910fed990cc429c355ec65f12aaee169c5cd85b4b81 | Frama-C/Frama-C-snapshot | builtins.mli | (**************************************************************************)
(* *)
This file is part of Frama - C.
(* *)
Copyright ... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/value/domains/cvalue/builtins.mli | ocaml | ************************************************************************
alternatives)
... | This file is part of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , v... |
7ba33212e78ff9ce599c2c14153a74b0ad18ffb04c0c221032ddd6e54d0728c3 | donaldsonjw/bigloo | walk.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / comptime / BackEnd / walk.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/donaldsonjw/bigloo/a4d06e409d0004e159ce92b9908719510a18aed5/comptime/BackEnd/walk.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* Drivers for code generator and linker */
*===========================... | * serrano / prgm / project / bigloo / comptime / BackEnd / walk.scm * /
* Author : * /
* Creation : Mon Aug 4 14:12:02 2003 * /
* Last change : Mon Feb 28 17:04:56 2005 ( serrano ) * /
* Cop... |
51d71ee6dda23d8bf900cdc786d135ca4d714ed248c4440564f90342d83c1243 | TokTok/hs-toxcore | PortNumberSpec.hs | # LANGUAGE StrictData #
# LANGUAGE Trustworthy #
module Network.Tox.NodeInfo.PortNumberSpec where
import Test.Hspec
import Data.Proxy (Proxy (..))
import Network.Tox.EncodingSpec
import Network.Tox.NodeInfo.PortNumber (PortNumber)
spec :: Spec
spec = do... | null | https://raw.githubusercontent.com/TokTok/hs-toxcore/3ceab5974c36c4c5dbf7518ba733ec2b6084ce5d/test/Network/Tox/NodeInfo/PortNumberSpec.hs | haskell | # LANGUAGE StrictData #
# LANGUAGE Trustworthy #
module Network.Tox.NodeInfo.PortNumberSpec where
import Test.Hspec
import Data.Proxy (Proxy (..))
import Network.Tox.EncodingSpec
import Network.Tox.NodeInfo.PortNumber (PortNumber)
spec :: Spec
spec = do... | |
b9c8fbf0d97ebc7aa9d8c48d704c319e7a32b26a743f4dd23214407af11a87d8 | lispcord/lispcord | cache.lisp | (in-package :lispcord.classes)
(defstruct (cache (:constructor primitive-make-cache))
data
(lock (bt:make-recursive-lock "LISPCORD.CLASSES cache")))
(defun make-cache (&optional (n 50))
(primitive-make-cache :data (make-hash-table :test optimal-id-compare :size n)))
(defvar *users* (make-cache 200))
(defvar *... | null | https://raw.githubusercontent.com/lispcord/lispcord/448190cc503a0d7e59bdc0ffddb2e9dba0a706af/src/classes/cache.lisp | lisp | (in-package :lispcord.classes)
(defstruct (cache (:constructor primitive-make-cache))
data
(lock (bt:make-recursive-lock "LISPCORD.CLASSES cache")))
(defun make-cache (&optional (n 50))
(primitive-make-cache :data (make-hash-table :test optimal-id-compare :size n)))
(defvar *users* (make-cache 200))
(defvar *... | |
3f82d393a1a6ba67717e3d08e774a6d2848c752884ce75a7714882feda8bd7de | gregnwosu/haskellbook | DataIni.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Applicative
import Data.ByteString (ByteString)
import Data.Char (isAlpha)
import Data.Map (Map)
import qualified Data.Map as M
import Data.Text (Text)
import qualified Data.Text.IO as TIO
import Test.Hspec
import Text.RawString.QQ
import Text.Trifect... | null | https://raw.githubusercontent.com/gregnwosu/haskellbook/b21fb6772e58f07cff334d9c551d0477ec856897/chapter24/test/DataIni.hs | haskell | # LANGUAGE OverloadedStrings # | module Main where
import Control.Applicative
import Data.ByteString (ByteString)
import Data.Char (isAlpha)
import Data.Map (Map)
import qualified Data.Map as M
import Data.Text (Text)
import qualified Data.Text.IO as TIO
import Test.Hspec
import Text.RawString.QQ
import Text.Trifecta
import IniParser
main :: IO ()
... |
06d764014910bc2b03a2e8e94b33c6aa61a933810c05c960b940b4456409113b | hjcapple/reading-sicp | prime.scm | #lang racket
P33 - 1.2.6 实例 : , [ 寻找因子 ]
(define (square x) (* x x))
(define (smallest-divisor n)
(find-divisor n 2))
(define (find-divisor n test-divisor)
(cond ((> (square test-divisor) n) n)
((divides? test-divisor n) test-divisor)
(else (find-divisor n (+ test-divisor 1)))))
(define (div... | null | https://raw.githubusercontent.com/hjcapple/reading-sicp/7051d55dde841c06cf9326dc865d33d656702ecc/chapter_1/prime.scm | scheme | #lang racket
P33 - 1.2.6 实例 : , [ 寻找因子 ]
(define (square x) (* x x))
(define (smallest-divisor n)
(find-divisor n 2))
(define (find-divisor n test-divisor)
(cond ((> (square test-divisor) n) n)
((divides? test-divisor n) test-divisor)
(else (find-divisor n (+ test-divisor 1)))))
(define (div... | |
1039513a4930d4cba075b6d57320f83c81f78f3b4e1660cc7a3c9651f402230b | RedPRL/cooltt | Scope.mli | type +'a t
val empty : 'a t
val inherit_view : 'a t -> 'a t
val get_export : prefix:Namespace.path option -> 'a t -> 'a Namespace.t
val resolve : Ident.t -> 'a t -> 'a option
val transform_view :
shadowing:bool ->
pp:(Format.formatter -> 'a -> unit) ->
_ Namespace.pattern ->
'a t -> ('a t, 'error) Namespace.r... | null | https://raw.githubusercontent.com/RedPRL/cooltt/076b577e9af8fd0025b9e1c0c6340b6123c497ac/src/core/Scope.mli | ocaml | type +'a t
val empty : 'a t
val inherit_view : 'a t -> 'a t
val get_export : prefix:Namespace.path option -> 'a t -> 'a Namespace.t
val resolve : Ident.t -> 'a t -> 'a option
val transform_view :
shadowing:bool ->
pp:(Format.formatter -> 'a -> unit) ->
_ Namespace.pattern ->
'a t -> ('a t, 'error) Namespace.r... | |
530d9566288f72f709c655cd1d45ddc98614f86ae29a1f77cfc569cc20eb9cb7 | honix/Lire | evaluation.lisp | ;;
;; Lire - evaluation
;;
(in-package :lire)
(defmethod compose-code ((node node))
"Make lisp form"
(with-slots (name parents childs) node
(if (stringp name)
~symbols
(let ((symbol (e-eval `(read-from-string ,name))))
(if childs
; -> (symbol child1 ... | null | https://raw.githubusercontent.com/honix/Lire/36c18b8944919ef428ed856935746955a4cc38cc/evaluation.lisp | lisp |
Lire - evaluation
-> (symbol child1 child2 ...)
-> symbol
~specials
-> (child1 child2 ...)
-> child1 child2 ...
multiple link
short link
(eval (list (read-from-string "+") |
(in-package :lire)
(defmethod compose-code ((node node))
"Make lisp form"
(with-slots (name parents childs) node
(if (stringp name)
~symbols
(let ((symbol (e-eval `(read-from-string ,name))))
(if childs
`(,symbol ,@(mapcar #'compose-code (sort-childs node)))
sym... |
2d5843bee0f05dacb7b1dc6e0d13e8c8fea0f8a7ec5246c33140a5b7f2500bbf | linoscope/okasaki-book-ocaml | pairing_heap.mli | module Make (Element : Ordered_intf.S) : Heap_intf.S with module Elm = Element
| null | https://raw.githubusercontent.com/linoscope/okasaki-book-ocaml/b5a10b0b9b714eccd2b35f76aa402ab5e0e5c1d7/src/ch5/pairing_heap.mli | ocaml | module Make (Element : Ordered_intf.S) : Heap_intf.S with module Elm = Element
| |
24099c39860bc1960ce48b0dc33c23ae3908f2ce835d392e90898c91d78981b0 | HealthSamurai/stresty | core.cljc | (ns app.hack.core
(:require [app.pages :as pages]
[stylo.core :refer [c]]
[re-frame.core :as rf]
[zframes.re-frame :as zrf]
[app.routes :refer [href]]
[app.scenario.editor]
[app.hack.interop :as interop]
[app.hack.codemirror]
... | null | https://raw.githubusercontent.com/HealthSamurai/stresty/36765772e6c40f893b4ef16f16a9f7be61f9f84c/src-ui/app/hack/core.cljc | clojure | \" target=\"_blank\" href=\"" url "/static/console.html#/rest?req=GET%20/" (:resourceType x) "/" (:id x) "" \"">" (:id x) "</a>"))
create Entities
get cases
get-or-create-case | (ns app.hack.core
(:require [app.pages :as pages]
[stylo.core :refer [c]]
[re-frame.core :as rf]
[zframes.re-frame :as zrf]
[app.routes :refer [href]]
[app.scenario.editor]
[app.hack.interop :as interop]
[app.hack.codemirror]
... |
433966cd3fbad51057ee3a057d7ae1a135bf123e04530caafe4beaa965d8a542 | vshaxe/hxparser | lexer.ml |
The Haxe Compiler
Copyright ( C ) 2005 - 2016 Haxe Foundation
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 ve... | null | https://raw.githubusercontent.com/vshaxe/hxparser/8621d5e44805b6d664654d15737faf6a3a4a18fa/src/syntax/lexing/lexer.ml | ocaml | whitespace
numbers
keywords
punctuation
ops
sequences
preprocessor
should not happen |
The Haxe Compiler
Copyright ( C ) 2005 - 2016 Haxe Foundation
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 ve... |
c378df31828578e2c4642f2cb83dbc6138c30f969f6f4a948bd4819c2c62f417 | fukamachi/rove | main.lisp | (uiop:define-package #:rove
(:nicknames #:rove/main)
(:use #:cl)
(:use-reexport #:rove/core/assertion)
(:use-reexport #:rove/core/test)
(:use-reexport #:rove/core/suite)
(:use-reexport #:rove/core/result)
(:use-reexport #:rove/reporter)
(:import-from #:rove/core/suite
#:run-system-tests)... | null | https://raw.githubusercontent.com/fukamachi/rove/6a5dfcdced42879a4eff2a529e7e8ce492fadf41/main.lisp | lisp | Enable the default reporter | (uiop:define-package #:rove
(:nicknames #:rove/main)
(:use #:cl)
(:use-reexport #:rove/core/assertion)
(:use-reexport #:rove/core/test)
(:use-reexport #:rove/core/suite)
(:use-reexport #:rove/core/result)
(:use-reexport #:rove/reporter)
(:import-from #:rove/core/suite
#:run-system-tests)... |
ee8b72732aaf82324c8b1e5c8bb3d89f50fa050b7169da18313458552a869349 | jixiuf/helloerlang | erlcount_counter.erl | -module(erlcount_counter).
-export([start_link/4,init/1]).
-export([handle_call/3,handle_cast/2,handle_info/2,terminate/2,code_change/3]).
-record(state,{dispatchingpid,file,ref,regexp}).
start_link(DispatchingPid,File,Ref,Re)->
erlcount_log:debug("erlcount_counter starting... for ~p in ~p~n",[Re,File]),
gen... | null | https://raw.githubusercontent.com/jixiuf/helloerlang/3960eb4237b026f98edf35d6064539259a816d58/erlcount_release/erlcount/src/erlcount_counter.erl | erlang | regexp_count("a","abab") | -module(erlcount_counter).
-export([start_link/4,init/1]).
-export([handle_call/3,handle_cast/2,handle_info/2,terminate/2,code_change/3]).
-record(state,{dispatchingpid,file,ref,regexp}).
start_link(DispatchingPid,File,Ref,Re)->
erlcount_log:debug("erlcount_counter starting... for ~p in ~p~n",[Re,File]),
gen... |
4ea6678e773de36a805800432b23ec87966167a9f9880273c44fe785b0bbcbb9 | mewa/clojure-k8s | storage.clj | (ns kubernetes.api.storage
(:require [kubernetes.core :refer [call-api check-required-params with-collection-format]])
(:import (java.io File)))
(defn get-storage-api-group-with-http-info
"
get information of a group"
[]
(call-api "/apis/storage.k8s.io/" :get
{:path-params {}
:he... | null | https://raw.githubusercontent.com/mewa/clojure-k8s/a7e8d82f0e0bc47e5678c72d7d9b8216080ccffc/src/kubernetes/api/storage.clj | clojure | (ns kubernetes.api.storage
(:require [kubernetes.core :refer [call-api check-required-params with-collection-format]])
(:import (java.io File)))
(defn get-storage-api-group-with-http-info
"
get information of a group"
[]
(call-api "/apis/storage.k8s.io/" :get
{:path-params {}
:he... | |
17ca5f7e3dfd82de808f8d173a7e6cb8b2e1c5fff52cee90620cd2787409fd3a | marcelosousa/llvmvf | Value.hs | # LANGUAGE UnicodeSyntax #
-------------------------------------------------------------------------------
-- Module : Analysis.Type.Inference.Value
Copyright : ( c ) 2013
-- Type Constraints for Value and Constants
-------------------------------------------------------------------------------
module Analys... | null | https://raw.githubusercontent.com/marcelosousa/llvmvf/c314e43aa8bc8bb7fd9c83cebfbdcabee4ecfe1b/src/Analysis/Type/Inference/Value.hs | haskell | -----------------------------------------------------------------------------
Module : Analysis.Type.Inference.Value
Type Constraints for Value and Constants
-----------------------------------------------------------------------------
Type Constraints for values
generate the minimum type that can contain the v... | # LANGUAGE UnicodeSyntax #
Copyright : ( c ) 2013
module Analysis.Type.Inference.Value where
import Language.LLVMIR
import Analysis.Type.Inference.Base
import Analysis.Type.Memory.Util
import Analysis.Type.Memory.TyAnn as T
import Analysis.Type.Util
import qualified Data.Set as S
import Prelude.Unicode ((⧺),(≡... |
ac7a501961b9c68629376aeedf327b606c25ecb66181d5ee121ac16a2a56eb20 | ghc/packages-Cabal | DList.hs | -----------------------------------------------------------------------------
-- |
-- Module : Distribution.Compat.DList
Copyright : ( c ) 2015 - 2019
-- License : BSD3
--
Maintainer :
-- Stability : experimental
-- Portability : portable
--
-- A very simple difference list.
module Distri... | null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/Cabal/Distribution/Compat/DList.hs | haskell | ---------------------------------------------------------------------------
|
Module : Distribution.Compat.DList
License : BSD3
Stability : experimental
Portability : portable
A very simple difference list.
| Difference list.
| Make 'DList' with containing single element.
| @since 3.4.0.0 | Copyright : ( c ) 2015 - 2019
Maintainer :
module Distribution.Compat.DList (
DList,
runDList,
empty,
singleton,
fromList,
toList,
snoc,
) where
import Prelude ()
import Distribution.Compat.Prelude hiding (toList, empty)
newtype DList a = DList ([a] -> [a])
runDList :: DLi... |
e4ea5f8efd99c325fc3967f4686eaf86818b304db88ed52563b9137c5557aa20 | Copilot-Language/copilot | Prelude.hs | Copyright © 2011 National Institute of Aerospace / Galois , Inc.
-- | Reexports 'Prelude' from package "base" hiding identifiers redefined by
-- Copilot.
{-# LANGUAGE Safe #-}
module Copilot.Language.Prelude
( module Prelude
) where
import Prelude hiding
( (++)
, (==), (/=)
, div, mod
, (<=), (>=), (<... | null | https://raw.githubusercontent.com/Copilot-Language/copilot/17a9b45eea4e95a465d6e773c6fbcf9bf810b6cc/copilot-language/src/Copilot/Language/Prelude.hs | haskell | | Reexports 'Prelude' from package "base" hiding identifiers redefined by
Copilot.
# LANGUAGE Safe # | Copyright © 2011 National Institute of Aerospace / Galois , Inc.
module Copilot.Language.Prelude
( module Prelude
) where
import Prelude hiding
( (++)
, (==), (/=)
, div, mod
, (<=), (>=), (<), (>)
, (&&)
, (^)
, (||)
, const
, drop
, not
, mod
, until
, sum
, max
, min
, (!!)
... |
c46eba7c766d2ea2902909d5bffda30053183e112e19f18b65f20bc22a2b410b | well-typed/optics | Core.hs | -- |
-- Module: Optics.Empty.Core
-- Description: A 'Prism' for a type that may be '_Empty'.
--
-- This module defines the 'AsEmpty' class, which provides a 'Prism' for a type
-- that may be '_Empty'.
--
Note that orphan instances for this class are defined in the @Optics . Empty@
module from @optics - extra@ , so ... | null | https://raw.githubusercontent.com/well-typed/optics/ba3c5a4d2f110c82238bc2fe7bb187023ab516f5/optics-core/src/Optics/Empty/Core.hs | haskell | |
Module: Optics.Empty.Core
Description: A 'Prism' for a type that may be '_Empty'.
This module defines the 'AsEmpty' class, which provides a 'Prism' for a type
that may be '_Empty'.
you may wish to import that module instead.
>>> isn't _Empty [1,2,3]
True
>>> case Nothing of { Empty -> True; _ -> False }
... | Note that orphan instances for this class are defined in the @Optics . Empty@
module from @optics - extra@ , so if you are not simply depending on @optics@
# LANGUAGE CPP #
module Optics.Empty.Core
( AsEmpty(..)
, pattern Empty
) where
import Control.Applicative (ZipList(..))
import Data.Maybe (isNothing)
im... |
c1f01c70369495687e9ad9634a98eacd4fa32196aa55deff35fc7f1c916aaab9 | amirghaffari/DEbench | de_commands.erl | DE - Bench : A benchmarking suite for distributed Erlang
DE - Bench 's commands are defined in this module
Author : < >
%% RELEASE project (-project.eu/)
-module(de_commands).
-export([run/4, getback_remote_data/2]).
-include("de_bench.hrl").
run(TargetNode, Ope, Data, S_Groups) ->
case Ope of
call a ... | null | https://raw.githubusercontent.com/amirghaffari/DEbench/8079fbc3a1f2db9af37d6bebd73f0fea03368167/src/de_commands.erl | erlang | RELEASE project (-project.eu/)
register a name globally
unregister a name globally
queries a name globally
queries a name locally
unregister a name locally | DE - Bench : A benchmarking suite for distributed Erlang
DE - Bench 's commands are defined in this module
Author : < >
-module(de_commands).
-export([run/4, getback_remote_data/2]).
-include("de_bench.hrl").
run(TargetNode, Ope, Data, S_Groups) ->
case Ope of
call a fsm process on remote TargetNode n... |
c531913f64d9f7aa7ed731318c8b04e7ff7daf3b29f894062b16f6466a32f5ae | gildor478/ocaml-gettext | invalid_format2.ml | open TestGettext
open Printf
let () = eprintf (f_ "%Ld") 2
| null | https://raw.githubusercontent.com/gildor478/ocaml-gettext/9b7afc702bccace9a544b8efa2a28bc2b13371ed/test/testdata/invalid_format2.ml | ocaml | open TestGettext
open Printf
let () = eprintf (f_ "%Ld") 2
| |
77947ec04932f8ca0336e540e93d569cd7b64151d98ac04e8618b3d9ed640a8c | thelema/ocaml-community | image.mli | ##ifdef CAMLTK
val names : unit -> options list
##else
val names : unit -> image list
##endif
| null | https://raw.githubusercontent.com/thelema/ocaml-community/ed0a2424bbf13d1b33292725e089f0d7ba94b540/otherlibs/labltk/builtin/image.mli | ocaml | ##ifdef CAMLTK
val names : unit -> options list
##else
val names : unit -> image list
##endif
| |
d509dc0533c4572301c38dae8fd8a2056b4175d7380f0be2b9cd3df8836a2446 | rjnw/sham | function.rkt | #lang racket
(require sham/ir
(prefix-in ll- sham/llvm/ir/simple))
(provide (all-defined-out))
(define identity-f (function (id [x : i64] : i64) (stmt-return x)))
(define pow-f
(function (pow [x : i64] [n : i64] : i64)
(stmt-if (op-icmp-ule n (ui64 0))
(stmt-return (ui64 ... | null | https://raw.githubusercontent.com/rjnw/sham/6e0524b1eb01bcda83ae7a5be6339da4257c6781/sham-test/sham/test/ir/function.rkt | racket | #lang racket
(require sham/ir
(prefix-in ll- sham/llvm/ir/simple))
(provide (all-defined-out))
(define identity-f (function (id [x : i64] : i64) (stmt-return x)))
(define pow-f
(function (pow [x : i64] [n : i64] : i64)
(stmt-if (op-icmp-ule n (ui64 0))
(stmt-return (ui64 ... | |
e568a70396c108efa445f0eb2b08001ce4cb6637fe65dd5391b5429062f92566 | danilkolikov/dfl | Utils.hs | |
Module : Frontend . Desugaring . Initial . Utils
Description : Utility functions for desugaring
Copyright : ( c ) , 2019
License : MIT
Utility functions for the initial step of desugaring
Module : Frontend.Desugaring.Initial.Utils
Description : Utility functions for desug... | null | https://raw.githubusercontent.com/danilkolikov/dfl/698a8f32e23b381afe803fc0e353293a3bf644ba/src/Frontend/Desugaring/Initial/Utils.hs | haskell | | Make custom ident
| Make custom type constructor
| Make custom pattern constructor
| Make custom expression
| Make custom constructor
| Wildcard pattern
| Pattern that matches True
| Pattern that matches False
| undefined | |
Module : Frontend . Desugaring . Initial . Utils
Description : Utility functions for desugaring
Copyright : ( c ) , 2019
License : MIT
Utility functions for the initial step of desugaring
Module : Frontend.Desugaring.Initial.Utils
Description : Utility functions for desug... |
8c6a88e03e577aeb7480211c9cb6c439b67757f74cf9618ab34d2408972813c8 | TerrorJack/ghc-alter | hGetBuffering001.hs | import System.IO
main =
sequence (map hIsOpen [stdin, stdout, stderr]) >>= \ opens ->
print opens >>
sequence (map hIsClosed [stdin, stdout, stderr]) >>= \ closeds ->
print closeds >>
sequence (map hIsReadable [stdin, stdout, stderr]) >>= \ readables ->
print readables >>
sequence (map hIs... | null | https://raw.githubusercontent.com/TerrorJack/ghc-alter/db736f34095eef416b7e077f9b26fc03aa78c311/ghc-alter/boot-lib/base/tests/IO/hGetBuffering001.hs | haskell | import System.IO
main =
sequence (map hIsOpen [stdin, stdout, stderr]) >>= \ opens ->
print opens >>
sequence (map hIsClosed [stdin, stdout, stderr]) >>= \ closeds ->
print closeds >>
sequence (map hIsReadable [stdin, stdout, stderr]) >>= \ readables ->
print readables >>
sequence (map hIs... | |
71bad12409975a66bcea1e30ddcad971536446ea68df11d86a5ddda4eb66daf7 | 2600hz/kazoo | kz_endpoints.erl | %%%-----------------------------------------------------------------------------
( C ) 2011 - 2020 , 2600Hz
%%% @doc
@author
@author
@author
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtai... | null | https://raw.githubusercontent.com/2600hz/kazoo/24519b9af9792caa67f7c09bbb9d27e2418f7ad6/core/kazoo_endpoint/src/kz_endpoints.erl | erlang | -----------------------------------------------------------------------------
@doc
@end
----------------------------------------------------------------------------- | ( C ) 2011 - 2020 , 2600Hz
@author
@author
@author
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
-module(kz_endpoints).
-export([by_owner_id/3
,ignore_early_media/1
... |
ae041230848d044e5f1d4b8389dc33e4961a20554fa20fce4921585fd19fedcc | typelead/etlas | Install.hs | # LANGUAGE CPP , TupleSections , FlexibleContexts #
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Install
Copyright : ( c ) 2005
2007
2007 - 2010
-- License : BSD-like
--
-- Maintainer... | null | https://raw.githubusercontent.com/typelead/etlas/bbd7c558169e1fda086e759e1a6f8c8ca2807583/etlas/Distribution/Client/Install.hs | haskell | ---------------------------------------------------------------------------
|
Module : Distribution.Client.Install
License : BSD-like
Maintainer :
Stability : provisional
Portability : portable
High level interface to package installation.
-----------------------------------------------------... | # LANGUAGE CPP , TupleSections , FlexibleContexts #
Copyright : ( c ) 2005
2007
2007 - 2010
module Distribution.Client.Install (
install,
makeInstallContext,
makeInstallPlan,
processInstallPlan,
InstallArgs,
InstallContext,
pruneInsta... |
af30d1e7d355ab4716ba068c0450955a607de7fdd16fffdb816201ba559b7f00 | imalooney/t3tr0s | repl.cljs | (ns client.repl
(:require
[weasel.repl :as repl]))
(defn connect!
"Connect to the websocket REPL to allow debugging."
[]
(repl/connect "ws:9001" :verbose true)) | null | https://raw.githubusercontent.com/imalooney/t3tr0s/2f9529e7138a0bc3a8578aa89c9661fc89e81cc0/src/client/repl.cljs | clojure | (ns client.repl
(:require
[weasel.repl :as repl]))
(defn connect!
"Connect to the websocket REPL to allow debugging."
[]
(repl/connect "ws:9001" :verbose true)) | |
4d24ea622afbd9e236769fcf6b03c782cb822348fc5ba771872b8b15ad23d2bb | cram-code/cram_core | fluent-net.lisp | ;;;
Copyright ( c ) 2009 , < >
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions are met:
;;;
;;; * Redistributions of source code must retain the above copyright
;;; notice, this list... | null | https://raw.githubusercontent.com/cram-code/cram_core/984046abe2ec9e25b63e52007ed3b857c3d9a13c/cram_language/src/fluents/fluent-net.lisp | lisp |
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redi... | Copyright ( c ) 2009 , < >
* Neither the name of Willow Garage , Inc. nor the names of its
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR ... |
cdd57a2fc055979aeb3f702f3d88138a8eb95ef7c304fc432666d796c57d31ac | processone/tsung | mochiweb_xpath.erl | %% mochiweb_html_xpath.erl
@author
created on < 2008 - 04 - 29 >
%%
XPath interpreter , navigate 's html structs
Only a subset of is implemented , see what is supported in test.erl
-module(mochiweb_xpath).
-export([execute/2,execute/3,compile_xpath/1]).
-export_type([xpath_return/0, html_node/0]).
-export... | null | https://raw.githubusercontent.com/processone/tsung/e9babe2acfb4298e3b51bd56886561b052979884/src/lib/mochiweb_xpath.erl | erlang | mochiweb_html_xpath.erl
internal!!!
HTML tree specs
-type html_doctype() :: {doctype, [binary()]}.
API
the default set of functions.
@type XPath = compiled_xpath() | string()
@type Doc = node()
@type Results = [node()] | binary() | boolean() | number()
using the default set of functions plus the use... | @author
created on < 2008 - 04 - 29 >
XPath interpreter , navigate 's html structs
Only a subset of is implemented , see what is supported in test.erl
-module(mochiweb_xpath).
-export([execute/2,execute/3,compile_xpath/1]).
-export_type([xpath_return/0, html_node/0]).
-export_type([xpath_fun_spec/0, xpath... |
a7ac7ed2475b4188687740baca318da4f848eff5cffead936401d3916b56522e | camfort/camfort | Synthesis.hs |
Copyright 2016 , , , , 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
-2.0
Unless required by applicable law or agreed to in writing , software
distribute... | null | https://raw.githubusercontent.com/camfort/camfort/59effca6e9656ddd8b071bc311738f52e40b071e/src/Camfort/Specification/Stencils/Synthesis.hs | haskell | # LANGUAGE GADTs #
Format inferred specifications
| Format inferred specifications, but do not format as a comment.
----------------------
Make indexing expression for variable 'v' from an offset.
essentially inverse to `ixToOffset` in StencilSpecification |
Copyright 2016 , , , , 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
-2.0
Unless required by applicable law or agreed to in writing , software
distribute... |
ebccaa54f57bad9a429bc3195a10f33798117915af46b10429fc34454b9e872d | NorfairKing/intray | InstanceSpec.hs | # LANGUAGE TypeApplications #
module Intray.API.InstanceSpec
( spec,
)
where
import Intray.API.Gen ()
import Intray.API.Types
import Test.Syd.Validity.Aeson
import TestImport
spec :: Spec
spec = do
genValidSpec @Registration
jsonSpec @Registration
genValidSpec @LoginForm
jsonSpec @LoginForm
genValidSpe... | null | https://raw.githubusercontent.com/NorfairKing/intray/0f272c63ff44fc7869964ca22f6195b855810543/intray-api-gen/test/Intray/API/InstanceSpec.hs | haskell | # LANGUAGE TypeApplications #
module Intray.API.InstanceSpec
( spec,
)
where
import Intray.API.Gen ()
import Intray.API.Types
import Test.Syd.Validity.Aeson
import TestImport
spec :: Spec
spec = do
genValidSpec @Registration
jsonSpec @Registration
genValidSpec @LoginForm
jsonSpec @LoginForm
genValidSpe... | |
e92debb127848f20936476b471bd33ad9a7924a238d4fae2d90c5667cb3191d5 | chrisdone/prana | Interpreter.hs | module Prana.Interpreter
(
-- * Setting up the environment
bindGlobal
-- * Evaluation functions
, evalExpr
, evalCon
, evalBox
-- * Data types
, Whnf(..)
, Thunk(..)
, Box(..)
) where
import Prana.Interpreter.Binding
import Prana.Interpreter.Eval
import Prana.Interpreter.Types
| null | https://raw.githubusercontent.com/chrisdone/prana/f2e45538937d326aff562b6d49296eaedd015662/prana-interpreter/src/Prana/Interpreter.hs | haskell | * Setting up the environment
* Evaluation functions
* Data types | module Prana.Interpreter
(
bindGlobal
, evalExpr
, evalCon
, evalBox
, Whnf(..)
, Thunk(..)
, Box(..)
) where
import Prana.Interpreter.Binding
import Prana.Interpreter.Eval
import Prana.Interpreter.Types
|
1296cfd090457ed00355073a3e7be6d496da96048728457ce6eb81156410ec69 | xclerc/ocamljava | condition.ml |
* This file is part of library .
* Copyright ( C ) 2007 - 2015 .
*
* library is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at yo... | null | https://raw.githubusercontent.com/xclerc/ocamljava/8330bfdfd01d0c348f2ba2f0f23d8f5a8f6015b1/library/concurrent/src/locks/condition.ml | ocaml | Null value
Miscellaneous |
* This file is part of library .
* Copyright ( C ) 2007 - 2015 .
*
* library is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at yo... |
91faaa447d7a7dde7ec091ec68444dd6613aeef3fe0b8e28f9293e7192eeec64 | r0man/oauth-clj | v2_test.clj | (ns oauth.v2-test
(:require [clj-http.client :as http]
[clojure.java.browse :refer [browse-url]]
[oauth.facebook :refer [*oauth-access-token-url* *oauth-authorization-url*]]
[oauth.facebook-test :refer [facebook-access-token facebook-access-token facebook-client-id facebook-code fa... | null | https://raw.githubusercontent.com/r0man/oauth-clj/9a67dc99756071c1865ba6e73566052643af4e5e/test/oauth/v2_test.clj | clojure | (deftest test-oauth-access-token
(let [access-token
(oauth-access-token
*oauth-access-token-url*
facebook-client-id
facebook-client-secret
facebook-code
facebook-redirect-uri)]
(is (string? (:access-token access-token)))
(is (string? (:expires acc... | (ns oauth.v2-test
(:require [clj-http.client :as http]
[clojure.java.browse :refer [browse-url]]
[oauth.facebook :refer [*oauth-access-token-url* *oauth-authorization-url*]]
[oauth.facebook-test :refer [facebook-access-token facebook-access-token facebook-client-id facebook-code fa... |
6a338e1eeb4ed91c354e020b89dcb14db27f12bdfd1e74d867ebb93147ad38ba | gogins/csound-extended-nudruz | dk-screamtest.lisp | (in-package :cm)
( load ( translate - logical - pathname " clocc : src;cllib;base " ) )
; (load (translate-logical-pathname "clocc:src;cllib;matrix"))
; (load (translate-logical-pathname "clocc:src;cllib;gnuplot"))
; (load (translate-logical-pathname "clocc:src;cllib;octave"))
; (load (translate-logical-pathname "clo... | null | https://raw.githubusercontent.com/gogins/csound-extended-nudruz/4551d54890f4adbadc5db8f46cc24af8e92fb9e9/sources/dk-screamtest.lisp | lisp | (load (translate-logical-pathname "clocc:src;cllib;matrix"))
(load (translate-logical-pathname "clocc:src;cllib;gnuplot"))
(load (translate-logical-pathname "clocc:src;cllib;octave"))
(load (translate-logical-pathname "clocc:src;cllib;iter"))
(load (translate-logical-pathname "clocc:src;cllib;stat"))
(use-package... | (in-package :cm)
( load ( translate - logical - pathname " clocc : src;cllib;base " ) )
FLATTEN -- removes all nesting in list
" thank you ! "
(defun flatten (x)
(labels ((rec (x acc)
(cond ((null x) acc)
((atom x) (cons x acc))
(t (rec (car x) (rec (cdr x... |
25ec212fe5e3ad54de04d9f2296659408b01fa4c61c033ecc33fe7ece14f10fd | reach-sh/reach-lang | Eval.hs | module Reach.Eval
( evalBundle
, CompileDLProg
, prepareDAppCompiles
, Evald
, evEnv
) where
import Control.Monad.Extra
import Control.Monad.Reader
import Data.IORef
import qualified Data.Map.Strict as M
import qualified Data.Set as S
import Language.JavaScript.Parser
import Reach.AST.Base
import Reach.AST... | null | https://raw.githubusercontent.com/reach-sh/reach-lang/6bc3778e837ce3d2089170a5a9e78aa92be858f2/hs/src/Reach/Eval.hs | haskell | XXX revise
Compiling a top level app
Log: Compiling `main`
Gen: index.main.mjs
Compiling a named app
Log: Compiling `child` for `main`
Gen: index.child.mjs
Compiling a default app
Log: Compiling `default`
Gen: index.default.mjs
Compiling an anonymous app
Gen: index.main2.mjs
However, we always compile apps... | module Reach.Eval
( evalBundle
, CompileDLProg
, prepareDAppCompiles
, Evald
, evEnv
) where
import Control.Monad.Extra
import Control.Monad.Reader
import Data.IORef
import qualified Data.Map.Strict as M
import qualified Data.Set as S
import Language.JavaScript.Parser
import Reach.AST.Base
import Reach.AST... |
b4d5229d12502f8b860e73873726a7b465f816284bce26bc816b0f7273654dbc | hellonico/origami-fun | seesawing.clj | (ns opencv4.seesawing
(:require
[opencv4.core :refer :all]
[opencv4.utils :as u])
(:use seesaw.core)
(:require [seesaw.bind :as b])
(:gen-class))
(def picts (into []
(map #(.getPath %)
(filter
#(let [name (.toLowerCase(.getName %))]
(or (.endsWith name "jpg") (.endsWith name "png")))
(file-seq (clojure.j... | null | https://raw.githubusercontent.com/hellonico/origami-fun/80117788530d942eaa9a80e2995b37409fa24889/test/opencv4/seesawing.clj | clojure | (remove-watch a :canny ) | (ns opencv4.seesawing
(:require
[opencv4.core :refer :all]
[opencv4.utils :as u])
(:use seesaw.core)
(:require [seesaw.bind :as b])
(:gen-class))
(def picts (into []
(map #(.getPath %)
(filter
#(let [name (.toLowerCase(.getName %))]
(or (.endsWith name "jpg") (.endsWith name "png")))
(file-seq (clojure.j... |
8545beac0f0bc130ecc089c5a5fbb2e3d5d227c090878fa4e79ea2c34221e43b | naoiwata/sicp | 3.5.5.scm | ;;
;; @author naoiwata
SICP Chapter3
3.5.5 Modularity of Functional Programs and Modularity of Objects
;;
(define rand
(let
((x random-init))
(lambda ()
(set! x (rand-update x))
x)))
(define random-numbers
(cons-stream
random-init
(stream-map rand-update random-numbers)))
(define ... | null | https://raw.githubusercontent.com/naoiwata/sicp/7314136c5892de402015acfe4b9148a3558b1211/chapter3/pages/3.5.5.scm | scheme |
@author naoiwata
| SICP Chapter3
3.5.5 Modularity of Functional Programs and Modularity of Objects
(define rand
(let
((x random-init))
(lambda ()
(set! x (rand-update x))
x)))
(define random-numbers
(cons-stream
random-init
(stream-map rand-update random-numbers)))
(define cesaro-stream
(map-succe... |
852114892ae414ec19069ab6097d306845f14c2f9aecceedcc34e88066e86cf0 | flodihn/NextGen | libsave_sup.erl | -module(libsave_sup).
-behaviour(supervisor).
-export([
start_link/0,
init/1
]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
RestartStrategy = one_for_one,
MaxRestarts = 10,
MaxSecondsBetweenRestarts = 30,
SupFlags = {RestartStrategy, MaxRestarts... | null | https://raw.githubusercontent.com/flodihn/NextGen/3da1c3ee0d8f658383bdf5fccbdd49ace3cdb323/AreaServer/src/libsave/libsave_sup.erl | erlang | -module(libsave_sup).
-behaviour(supervisor).
-export([
start_link/0,
init/1
]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
RestartStrategy = one_for_one,
MaxRestarts = 10,
MaxSecondsBetweenRestarts = 30,
SupFlags = {RestartStrategy, MaxRestarts... | |
0f3141d80438e819cfce469b494c30aeabb723e3dea88a7b40d3ac31ea199133 | jlouis/etorrent_core | etorrent_event.erl | @author < >
%% @doc Handle messaging events in etorrent.
%% <p>This module handles the processing of <em>event messages</em> in
%% etorrent. Whenever something important happens, a message is sent
%% to then `gen_event' process. It then hands the message on to any
%% handler which has been registered with it. Nor... | null | https://raw.githubusercontent.com/jlouis/etorrent_core/7db7f4ef36c1d055812504f00df92c6a67c2e4af/src/etorrent_event.erl | erlang | @doc Handle messaging events in etorrent.
<p>This module handles the processing of <em>event messages</em> in
etorrent. Whenever something important happens, a message is sent
to then `gen_event' process. It then hands the message on to any
handler which has been registered with it. Normally these are
@end
Insta... | @author < >
handlers for file logging and memory >
-module(etorrent_event).
-export([start_link/0,
add_handler/2,
delete_handler/2]).
-export([notify/1,
started_torrent/1,
stopped_torrent/1,
checking_torrent/1,
completed_torrent/1,
seeding_torrent/1]).
-... |
b20f25d91375a5397acca149eefece5df93bf9387d5971b10a682de0a5b49439 | janestreet/async | dns.ml | open! Core
open Async
let command () =
Command.async_spec
~summary:"test async getaddrinfo"
Command.Spec.(empty +> anon ("HOSTNAME" %: string))
(fun host () ->
Unix.Addr_info.get
~host
[ Unix.Addr_info.AI_SOCKTYPE Unix.SOCK_STREAM
; Unix.Addr_info.AI_FAMILY Unix.PF_INET
... | null | https://raw.githubusercontent.com/janestreet/async/118c0b4a39abd904e4a09bd3289c903058923e0a/example/dns.ml | ocaml | open! Core
open Async
let command () =
Command.async_spec
~summary:"test async getaddrinfo"
Command.Spec.(empty +> anon ("HOSTNAME" %: string))
(fun host () ->
Unix.Addr_info.get
~host
[ Unix.Addr_info.AI_SOCKTYPE Unix.SOCK_STREAM
; Unix.Addr_info.AI_FAMILY Unix.PF_INET
... | |
07961e5f80c5a9e697e693c6ae30866617c32be3d936d59da10d688eb596e457 | iskandr/parakeet-retired | BasePMap.ml | open BaseCommon
include PMap
let find_default elt m default =
if mem elt m then find elt m
else default
(* add each pair in a list to an existing map *)
let add_list lst map =
let rec aux acc = function
| [] -> acc
| (x,y)::rest -> aux (add x y acc) rest
in aux map lst
let... | null | https://raw.githubusercontent.com/iskandr/parakeet-retired/3d7e6e5b699f83ce8a1c01290beed0b78c0d0945/Base/BasePMap.ml | ocaml | add each pair in a list to an existing map
construct a map from a list of pairs
* returns pair of key array and value array
boolMap should contain all the same keys as map, providing
a boolean membership value for each
returns keys of map as a list
returns values of map as a list | open BaseCommon
include PMap
let find_default elt m default =
if mem elt m then find elt m
else default
let add_list lst map =
let rec aux acc = function
| [] -> acc
| (x,y)::rest -> aux (add x y acc) rest
in aux map lst
let remove_list lst map =
let rec aux acc = functi... |
2cf862dd75b9a5ebf6c5b9bb36e4e39a225b0dd3b07e29f1c301ccae2a577166 | seanomlor/programming-in-haskell | sum.hs | mysum :: Num a => [a] -> a
mysum ns = mysum' ns 0
mysum' :: Num a => [a] -> a -> a
mysum' [] s = s
mysum' (n:ns) s = mysum' ns (s + n)
| null | https://raw.githubusercontent.com/seanomlor/programming-in-haskell/e05142e6709eeba2e95cf86f376a32c9e629df88/01-introduction/sum.hs | haskell | mysum :: Num a => [a] -> a
mysum ns = mysum' ns 0
mysum' :: Num a => [a] -> a -> a
mysum' [] s = s
mysum' (n:ns) s = mysum' ns (s + n)
| |
ba3d92367a847bd42237c1199b8e8f06ba5642f60c8bbf530f954e0ff0cae394 | mbutterick/beautiful-racket | Nand.tst.rkt | #lang hdl-tst-demo
/* nand */
load Nand.hdl,
output-list a, b, out;
set a 0, set b 0,
eval, output;
set a 0, set b 1,
eval, output;
set a 1, set b 0,
eval, output;
set a 1, set b 1,
eval, output;
| null | https://raw.githubusercontent.com/mbutterick/beautiful-racket/f0e2cb5b325733b3f9cbd554cc7d2bb236af9ee9/beautiful-racket-demo/hdl-demo/Nand.tst.rkt | racket | #lang hdl-tst-demo
/* nand */
load Nand.hdl,
set a 0, set b 0,
set a 0, set b 1,
set a 1, set b 0,
set a 1, set b 1,
| |
212bac475ea73777ad182bbfbd8c07ac14069bde40c5625cec55ababff21ee74 | lspector/Clojush | environment.clj | (ns clojush.instructions.environment
(:use [clojush pushstate util]))
(define-registered
environment_new
^{:stack-types [:environment]
:parentheses 1}
;; Creates new environment using the top item on the exec stack
(fn [state]
(if (empty? (:exec state))
state
(let [new-exec (top-item :exe... | null | https://raw.githubusercontent.com/lspector/Clojush/685b991535607cf942ae1500557171a0739982c3/src/clojush/instructions/environment.clj | clojure | Creates new environment using the top item on the exec stack
Creates new environment using the entire exec stack
Ends current environment
Immediately copies the current tagspace to the environment on the top
of the :environment stack. | (ns clojush.instructions.environment
(:use [clojush pushstate util]))
(define-registered
environment_new
^{:stack-types [:environment]
:parentheses 1}
(fn [state]
(if (empty? (:exec state))
state
(let [new-exec (top-item :exec state)
parent-env (pop-item :exec state)]
(p... |
e48d4662daffbff00bef568e424daea24afb9a7f4ecfdcc1d718581126be4218 | lierdakil/pandoc-crossref | CodeBlock.hs |
pandoc - crossref is a pandoc filter for numbering figures ,
equations , tables and cross - references to them .
Copyright ( C ) 2015 < >
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 Foundat... | null | https://raw.githubusercontent.com/lierdakil/pandoc-crossref/0058f83de2bbb79148b44b1d5c2dd33774281a9b/lib-internal/Text/Pandoc/CrossRef/References/Blocks/CodeBlock.hs | haskell | if used with listings package,nothing should be done
if not using listings, however, wrap it in a codelisting environment |
pandoc - crossref is a pandoc filter for numbering figures ,
equations , tables and cross - references to them .
Copyright ( C ) 2015 < >
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 Foundat... |
2fbe18f4e3d7d73a4fcbb0e4ccff5541f3d8b58db91740ad4c029acb2ee8f011 | foreverbell/project-euler-solutions | 307.hs | import Text.Printf (printf)
import qualified Data.Vector.Unboxed as V
logs :: V.Vector Double
logs = V.fromList ps
where
xs = [ log (fromIntegral k) | k <- [1 .. 1000000] ]
ps = zipWith (+) xs (0:ps)
logSum :: Int -> Int -> Double
logSum a b | a > b = 0
| otherwise = ask b - ask (a-1)
where as... | null | https://raw.githubusercontent.com/foreverbell/project-euler-solutions/c0bf2746aafce9be510892814e2d03e20738bf2b/src/307.hs | haskell | import Text.Printf (printf)
import qualified Data.Vector.Unboxed as V
logs :: V.Vector Double
logs = V.fromList ps
where
xs = [ log (fromIntegral k) | k <- [1 .. 1000000] ]
ps = zipWith (+) xs (0:ps)
logSum :: Int -> Int -> Double
logSum a b | a > b = 0
| otherwise = ask b - ask (a-1)
where as... | |
be1e8748d2cc3c30e2c1b7e63c8bad2994c3cae6903fdf2f4c07b0ad8c375a44 | mentat-collective/Mafs.cljs | line.cljs | (ns mafs.line
(:require ["mafs" :as m]
[mafs.macros :refer [defcomponent]]))
(defcomponent Segment
"
- `:point1`
- `:point2`
- `:color`
- `:opacity`
- `:weight`
- `:style`
"
(.-Segment m/Line))
(defcomponent ThroughPoints
"
- `:point1`
- `:point2`
- `:color`
- `:opacity`
- ... | null | https://raw.githubusercontent.com/mentat-collective/Mafs.cljs/b4204ca3a33424caeba2c576a784d877eec7ecc4/src/mafs/line.cljs | clojure | (ns mafs.line
(:require ["mafs" :as m]
[mafs.macros :refer [defcomponent]]))
(defcomponent Segment
"
- `:point1`
- `:point2`
- `:color`
- `:opacity`
- `:weight`
- `:style`
"
(.-Segment m/Line))
(defcomponent ThroughPoints
"
- `:point1`
- `:point2`
- `:color`
- `:opacity`
- ... | |
23715c4297fc6b06c66a129dd5f00f4fe36b0e9f94e4596d6373325d26403294 | finnishtransportagency/harja | alpha.cljc | (ns harja.ui.kartta.varit.alpha
(:require [harja.ui.kartta.varit :refer [rgba]]
[harja.ui.kartta.varit.puhtaat :as core]))
(def punainen (rgba 255 0 0 0.7))
(def oranssi (rgba 255 128 0 0.7))
(def keltainen (rgba 255 255 0 0.7))
(def magenta (rgba 255 0 255 0.7))
(def vihrea (rgba 0 255 0 0.7))
(def turk... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/3f312284ff6956459c2bedf51d7dd104c0ee71f3/src/cljc/harja/ui/kartta/varit/alpha.cljc | clojure | (ns harja.ui.kartta.varit.alpha
(:require [harja.ui.kartta.varit :refer [rgba]]
[harja.ui.kartta.varit.puhtaat :as core]))
(def punainen (rgba 255 0 0 0.7))
(def oranssi (rgba 255 128 0 0.7))
(def keltainen (rgba 255 255 0 0.7))
(def magenta (rgba 255 0 255 0.7))
(def vihrea (rgba 0 255 0 0.7))
(def turk... | |
c5a33bd3fb010e2e8d536b090f5093a6edf1e75297d59ec5da9e7348000304ed | doo/process | sequential_process_execution.clj | (ns process.sequential-process-execution
(:use clojure.test
process.definition
process.execution.sequential))
;;see:
(def process-definition
{:result (fnc [gamma delta epsilon] (+ gamma delta epsilon))
:gamma (fnc [alpha beta] (+ alpha beta))
:delta (fnc [alpha gamma] (+ alpha gamma))
:ep... | null | https://raw.githubusercontent.com/doo/process/a88d56396c3474b7f54d5c7747f20d0b1148c4c5/test/process/sequential_process_execution.clj | clojure | see: | (ns process.sequential-process-execution
(:use clojure.test
process.definition
process.execution.sequential))
(def process-definition
{:result (fnc [gamma delta epsilon] (+ gamma delta epsilon))
:gamma (fnc [alpha beta] (+ alpha beta))
:delta (fnc [alpha gamma] (+ alpha gamma))
:epsilon (f... |
fc2a5a806cd42b2a75e6237da262d5cf83a6334c848dcb16e67ab266699cca58 | racket/htdp | TestEngineTest.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-advanced-reader.ss" "lang")((modname TestEngineTest) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-de... | null | https://raw.githubusercontent.com/racket/htdp/aa78794fa1788358d6abd11dad54b3c9f4f5a80b/htdp-test/tests/test-engine/TestEngineTest.rkt | racket | about the language level of this file in a form that our tools can easily process.
*****************************************************************************
*****************************************************************************
-----------------------------------------------------------------------------... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-advanced-reader.ss" "lang")((modname TestEngineTest) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #t #t none #f () #f)))
Expect 42 checks , 19 failures , the last one is final
... |
91306afca6fdaf9a64abc4f1d1fc091e272fb7f392119253b87f590d83bcd7ef | tonyrog/yang | yang_parser.erl | %%%---- BEGIN COPYRIGHT -------------------------------------------------------
%%%
Copyright ( C ) 2007 - 2012 , Rogvall Invest AB , < >
%%%
%%% This software is licensed as described in the file COPYRIGHT, which
%%% you should have received as part of this distribution. The terms
%%% are also available at .
%%%
%%... | null | https://raw.githubusercontent.com/tonyrog/yang/0bb357c5c4c2406355d35a110494265b8838a621/src/yang_parser.erl | erlang | ---- BEGIN COPYRIGHT -------------------------------------------------------
This software is licensed as described in the file COPYRIGHT, which
you should have received as part of this distribution. The terms
are also available at .
You may opt to use, copy, modify, merge, publish, distribute and/or sell
furni... | Copyright ( C ) 2007 - 2012 , Rogvall Invest AB , < >
copies of the Software , and permit persons to whom the Software is
This software is distributed on an " AS IS " basis , WITHOUT WARRANTY OF ANY
@author < >
Created : 3 Jan 2012 by < >
-module(yang_parser).
-export([parse/1, parse/2]).
-e... |
c5b62023a21fe8f2a1900071dc2e209af938e06737325cecca23ce18a280c0a0 | let-def/menhir | stringMap.ml | (**************************************************************************)
(* *)
Menhir
(* *)
, INRIA Ro... | null | https://raw.githubusercontent.com/let-def/menhir/e8ba7bef219acd355798072c42abbd11335ecf09/src/stringMap.ml | ocaml | ************************************************************************
et en Automatique. All rig... | Menhir
, INRIA Rocquencourt
, PPS , Université Paris Diderot
Copyright 2005 - 2008 Institut National de Recherche en Informatique
under the terms of the Q Public License versi... |
3f9d9d947f315cd40f4b257e036292aea55e49c4030ac831b7422f1c25ccc087 | bluelisp/hemlock | ioconnections.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
(in-package :hi)
#+sbcl (declaim (optimize (speed 2)))
(defmethod invoke-with-new-event-loop ((backend (eql :iolib)) fun)
the epoll muxer gives me segfaults and memory corruption .
;; Don't know why, but select works, so let's use it:
(iolib:with-event-base
(... | null | https://raw.githubusercontent.com/bluelisp/hemlock/47e16ba731a0cf4ffd7fb2110e17c764ae757170/src/ioconnections.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
Don't know why, but select works, so let's use it:
IOLIB-CONNECTION
fixme: with-pointer-to-vector-data isn't portable
fixme: with-pointer-to-vector-data isn't portable
PROCESS-CONNECTION/IOLIB
ccl gives an exception in foreign code without this:
TCP-CONNECTION/IOLI... |
(in-package :hi)
#+sbcl (declaim (optimize (speed 2)))
(defmethod invoke-with-new-event-loop ((backend (eql :iolib)) fun)
the epoll muxer gives me segfaults and memory corruption .
(iolib:with-event-base
(*event-base* :mux 'iolib.multiplex:select-multiplexer)
(funcall fun)))
(defmethod make-event-loop ... |
134f6325d557856190d953828a39beae3a184b82a221f7643c79f830b0c9a337 | elastic/eui-cljs | header_alert.cljs | (ns eui.header-alert
(:require ["@elastic/eui/lib/components/header/header_alert/header_alert.js" :as eui]))
(def EuiHeaderAlert eui/EuiHeaderAlert)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/header_alert.cljs | clojure | (ns eui.header-alert
(:require ["@elastic/eui/lib/components/header/header_alert/header_alert.js" :as eui]))
(def EuiHeaderAlert eui/EuiHeaderAlert)
| |
8a5eeb6a467f46a626f127bb166b46efa34ee4cbb041f6c046760bbe212ae224 | erlang/corba | CosTimerEvent_TimerEventHandler_impl.erl | %%--------------------------------------------------------------------
%%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2000 - 2016 . 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 ... | null | https://raw.githubusercontent.com/erlang/corba/396df81473a386d0315bbba830db6f9d4b12a04f/lib/cosTime/src/CosTimerEvent_TimerEventHandler_impl.erl | erlang | --------------------------------------------------------------------
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY... | Copyright Ericsson AB 2000 - 2016 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
File : CosTimerEvent_TimerEventHandler_impl.erl
-module('CosTimerEvent_TimerEventHandler_impl').
-include("co... |
a44b36e7d3ecc920dadc0a44c51434b7f6e2bd3a5b4213dbd97c2a104e7c0211 | serokell/blockchain-util | StateConfiguration.hs | {-# LANGUAGE Rank2Types #-}
module Snowdrop.Block.StateConfiguration
( BlkStateConfiguration (..)
) where
import Universum
import Snowdrop.Block.Configuration (BlkConfiguration (..))
import Snowdrop.Block.Types (BlockHeader, BlockRef, RawBlk)
import Snowdrop.Util... | null | https://raw.githubusercontent.com/serokell/blockchain-util/a6428c6841e7002605a115002f58eff78ff9f128/snowdrop-block/src/Snowdrop/Block/StateConfiguration.hs | haskell | # LANGUAGE Rank2Types #
| Block handling configuration.
Contains methods for to perform handling of block sequence (chain):
* load neccessary information from block storage,
* apply validated sequence of blocks to current state and block storage.
block storage and state.
Block storage is used to store info... |
module Snowdrop.Block.StateConfiguration
( BlkStateConfiguration (..)
) where
import Universum
import Snowdrop.Block.Configuration (BlkConfiguration (..))
import Snowdrop.Block.Types (BlockHeader, BlockRef, RawBlk)
import Snowdrop.Util (NewestFirst, OldestFirst)
... |
6924fad762b42eb45830ce2dcbeffebf0a8752020d04fbbf7aa79e8ee33eb630 | MastodonC/witan.ui | results.cljs | (ns witan.ui.components.secondary.results
(:require[reagent.core :as r]
[cljs.test :refer-macros [is async]]
[sablono.core :as sab :include-macros true]
[witan.ui.utils :as utils]
[witan.ui.time :as time]
[witan.ui.data :as data]
[witan.ui.controller :... | null | https://raw.githubusercontent.com/MastodonC/witan.ui/5ea6baaff52824ac61737911dd2c11b451157bad/src/cljs/witan/ui/components/secondary/results.cljs | clojure | (ns witan.ui.components.secondary.results
(:require[reagent.core :as r]
[cljs.test :refer-macros [is async]]
[sablono.core :as sab :include-macros true]
[witan.ui.utils :as utils]
[witan.ui.time :as time]
[witan.ui.data :as data]
[witan.ui.controller :... | |
de927d226156bca71c8f8b5885be0d43ab55696c223ca78ad6a7ca9e94f2a6bb | thi-ng/demos | shapes02.cljs | (ns ex02.shapes02
(:require
[thi.ng.geom.core :as g]
[thi.ng.geom.vector :refer [vec3]]
[thi.ng.geom.matrix :as mat]
[thi.ng.geom.circle :as c]
[thi.ng.geom.polygon :as p]
[thi.ng.geom.gmesh :as gm]
[thi.ng.geom.mesh.subdivision :as sd]
[thi.ng.geom.svg.core :as svg]
[thi.ng.geom.svg.shader... | null | https://raw.githubusercontent.com/thi-ng/demos/048cd131099a7db29be56b965c053908acad4166/ws-ldn-8/day1/ex02/src/ex02/shapes02.cljs | clojure | 2d text label w/ projected anchor point
(main) | (ns ex02.shapes02
(:require
[thi.ng.geom.core :as g]
[thi.ng.geom.vector :refer [vec3]]
[thi.ng.geom.matrix :as mat]
[thi.ng.geom.circle :as c]
[thi.ng.geom.polygon :as p]
[thi.ng.geom.gmesh :as gm]
[thi.ng.geom.mesh.subdivision :as sd]
[thi.ng.geom.svg.core :as svg]
[thi.ng.geom.svg.shader... |
455f55f910e44a7a4d15dffa95e635efc751aeee9c9f357c743dac64932ab1eb | nasa/Common-Metadata-Repository | variable_association.clj | (ns cmr.metadata-db.data.oracle.concepts.variable-association
"Implements multi-method variations for variables"
(:require
[cmr.metadata-db.data.oracle.concepts :as c]))
(defmethod c/db-result->concept-map :variable-association
[concept-type db provider-id result]
(some-> (c/db-result->concept-map :default ... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/ca49654cd7d9e62c176a9c07f99a7bb172943ca2/metadata-db-app/src/cmr/metadata_db/data/oracle/concepts/variable_association.clj | clojure | (ns cmr.metadata-db.data.oracle.concepts.variable-association
"Implements multi-method variations for variables"
(:require
[cmr.metadata-db.data.oracle.concepts :as c]))
(defmethod c/db-result->concept-map :variable-association
[concept-type db provider-id result]
(some-> (c/db-result->concept-map :default ... | |
d5ee8bccd2bd768165ebfbf65e8a27f17ae8b42ea50ffd7e4ad9c1a5684e8c67 | rcherrueau/APE | ast.rkt | #lang typed/racket/base
(require "define-datatype.rkt"
racket/match
)
(provide (all-defined-out))
(define-datatype Primitive1
Add1
Sub1)
(define-datatype (Exp a) ;; `a` is a labeling tag.
[Num Number a] ;; Number
[Id Symb... | null | https://raw.githubusercontent.com/rcherrueau/APE/8b5302709000bd043b64d46d55642acb34ce5ba7/racket/pan/conditional%2Btag/ast.rkt | racket | `a` is a labeling tag.
Number
Identifier
Let* binding
if Test Then Else | #lang typed/racket/base
(require "define-datatype.rkt"
racket/match
)
(provide (all-defined-out))
(define-datatype Primitive1
Add1
Sub1)
Primitive arity 1
)
(: tag-exp (All (a) ((Exp a) -> (Exp Number))))
(define (tag-exp exp)
(: help (All (a) ((Exp a) Number -> (Values (Exp Number) Num... |
54d8e4dfb9d6906a11ec64234739da6f77a71d7aa3deb46cfc4ae636e208afac | ozataman/csv-conduit | Conversion.hs | # LANGUAGE BangPatterns , CPP , FlexibleInstances , OverloadedStrings ,
Rank2Types #
Rank2Types #-}
#ifdef GENERICS
# LANGUAGE DefaultSignatures , TypeOperators , KindSignatures , FlexibleContexts ,
MultiParamTypeClasses , UndecidableInstances , ScopedTypeVariables ,
... | null | https://raw.githubusercontent.com/ozataman/csv-conduit/ea6e51d37fc35744c2f46cae00d4147fa8edb536/src/Data/CSV/Conduit/Conversion.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.CSV.Conduit.Conversion
License : BSD3
Stability : experimental
put together cassava package, which itself borrows the approach
We make the necessary adjustments and some simplifications here to
bolt this ... | # LANGUAGE BangPatterns , CPP , FlexibleInstances , OverloadedStrings ,
Rank2Types #
Rank2Types #-}
#ifdef GENERICS
# LANGUAGE DefaultSignatures , TypeOperators , KindSignatures , FlexibleContexts ,
MultiParamTypeClasses , UndecidableInstances , ScopedTypeVariables ,
... |
0ae83003ad1d010f07677a6285c93412297faa7d0d49fb03fb36e65b2605129f | Tim-ats-d/Postem-markup | checker.ml | open Common
module type S = sig
val check : Syntax.Parsed_ast.t -> (Ast.Types.doc, Err.checker_err) result
end
module Make (Expsn : Ast.Expansion.S) : S = struct
open Result
type state =
| Expr of Ast.Types.expr
| Expand of Ast.Types.expr * Ast.Types.expr
let rec check parsed_ast =
List.fold_lef... | null | https://raw.githubusercontent.com/Tim-ats-d/Postem-markup/0af4b265474d970662bbd14d2ee9c0bd4ecef1cd/src/checker/checker.ml | ocaml | open Common
module type S = sig
val check : Syntax.Parsed_ast.t -> (Ast.Types.doc, Err.checker_err) result
end
module Make (Expsn : Ast.Expansion.S) : S = struct
open Result
type state =
| Expr of Ast.Types.expr
| Expand of Ast.Types.expr * Ast.Types.expr
let rec check parsed_ast =
List.fold_lef... | |
dbe083e70c7fd0063343ceab8d584152315027980aa8003ed860f8af8b79fce5 | mtravers/goddinpotty | graph.clj | (ns goddinpotty.graph
(:require [oz.core :as oz]
[goddinpotty.batadase :as bd]
[goddinpotty.config :as config]
[goddinpotty.utils :as utils]
[clojure.data.json :as json]
[org.parkerici.multitool.core :as u]
))
;;; Based on -directed-layout/
;;;... | null | https://raw.githubusercontent.com/mtravers/goddinpotty/d1abee0b2c06b0d5f264ce08b18ba7d14ad92c1c/src/goddinpotty/graph.clj | clojure | Based on -directed-layout/
Status: makes a graph
TODO better link highlighting
TODO maybe color for recency?
Starting to require a legend though
TODO max-degree is a hack and I don't like it – without it, if you hit a high-degree node you'll get too much in the graph
some kind of smart filter would be better
ma... | (ns goddinpotty.graph
(:require [oz.core :as oz]
[goddinpotty.batadase :as bd]
[goddinpotty.config :as config]
[goddinpotty.utils :as utils]
[clojure.data.json :as json]
[org.parkerici.multitool.core :as u]
))
TODO on side map in private mode... |
3ae97b53ab7fe7ee67e1ba35a15b3a0467fce61361f65173528f522307fc7351 | 4clojure/4clojure | core.clj | (ns foreclojure.core
(:require [compojure.route :as route]
[compojure.handler :as handler]
[foreclojure.config :as config]
[noir.session :as session])
(:import [java.lang OutOfMemoryError])
(:use [compojure... | null | https://raw.githubusercontent.com/4clojure/4clojure/25dec057d9d6871ce52aee9e2c3de7efdab14373/src/foreclojure/core.clj | clojure | (ns foreclojure.core
(:require [compojure.route :as route]
[compojure.handler :as handler]
[foreclojure.config :as config]
[noir.session :as session])
(:import [java.lang OutOfMemoryError])
(:use [compojure... | |
000eff89414bbffa3b069b618d45f6b0423d8d94cfc08b5cdfdd7813e0dc4685 | letmaik/monadiccp | IdT.hs | module Control.Monatron.IdT where
import Control.Monatron.Monatron
newtype IdT m a = IdT { runIdT :: m a }
instance MonadT IdT where
lift = IdT
tbind m f = IdT $ runIdT m >>= runIdT . f
instance FMonadT IdT where
tmap' d1 _d2 g f = IdT . f . fmapD d1 g . runIdT
| null | https://raw.githubusercontent.com/letmaik/monadiccp/fe4498e46a7b9d9e387fd5e4ed5d0749a89d0188/src/Control/Monatron/IdT.hs | haskell | module Control.Monatron.IdT where
import Control.Monatron.Monatron
newtype IdT m a = IdT { runIdT :: m a }
instance MonadT IdT where
lift = IdT
tbind m f = IdT $ runIdT m >>= runIdT . f
instance FMonadT IdT where
tmap' d1 _d2 g f = IdT . f . fmapD d1 g . runIdT
| |
f7e4a8e2bcf69c1fe1f1478412eeef10266544c3bd25e2e88373de4d33fc822e | khibino/haskell-relational-record | Literal.hs | -- |
-- Module : Database.Relational.Internal.Literal
Copyright : 2019
-- License : BSD3
--
-- Maintainer :
-- Stability : experimental
-- Portability : unknown
--
-- This module provides definitions to lift haskell expressions
-- into SQL expressions.
module Database.Relational.Internal.Literal (
... | null | https://raw.githubusercontent.com/khibino/haskell-relational-record/759b3d7cea207e64d2bd1cf195125182f73d2a52/relational-query/src/Database/Relational/Internal/Literal.hs | haskell | |
Module : Database.Relational.Internal.Literal
License : BSD3
Maintainer :
Stability : experimental
Portability : unknown
This module provides definitions to lift haskell expressions
into SQL expressions.
| Escape 'String' for constant SQL string expression.
| From 'String' into constant SQL s... | Copyright : 2019
module Database.Relational.Internal.Literal (
stringExpr,
bool, integral, timestamp,
) where
import Data.Monoid ((<>))
import Data.Time (FormatTime, formatTime)
import Data.Time.Locale.Compat (defaultTimeLocale)
import Language.SQL.Keyword (Keyword)
import Database.Relational.Internal.S... |
dd28878c032020d17f999e9dc1f45fc65cd22da77e0e005ea17fba882a72b0d4 | reanimate/reanimate | doc_drawBox.hs | #!/usr/bin/env stack
-- stack runghc --package reanimate
module Main(main) where
import Reanimate
import Reanimate.Builtin.Documentation
main :: IO ()
main = reanimate $ docEnv drawBox
| null | https://raw.githubusercontent.com/reanimate/reanimate/5ea023980ff7f488934d40593cc5069f5fd038b0/examples/doc_drawBox.hs | haskell | stack runghc --package reanimate | #!/usr/bin/env stack
module Main(main) where
import Reanimate
import Reanimate.Builtin.Documentation
main :: IO ()
main = reanimate $ docEnv drawBox
|
f463b4105b3a0f5f1d3e0541b34b9e7686847e4780bc8b57f8be45a63afa336d | ghcjs/ghcjs-dom | AbstractWorker.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
module GHCJS.DOM.JSFFI.Generated.AbstractWorker
(error, AbstractWorker(..), gTypeAbstractWorker, IsAbstractWorker,
... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/AbstractWorker.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/AbstractWorker.onerror Mozilla AbstractWorker.onerror documentation> | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
module GHCJS.DOM.JSFFI.Generated.AbstractWorker
(error, AbstractWorker(..), gTypeAbstractWorker, IsAbstractWorker,
toAbstractWorker)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double,... |
47c9b478ecccd3b09e52bdac440ae60d8e8d0ea615882b3e3586bb1f48785043 | stchang/macrotypes | stlc+reco+var-tests.rkt | #lang s-exp turnstile/examples/stlc+reco+var
(require "rackunit-typechecking.rkt")
;; define-type-alias
(define-type-alias Integer Int)
(define-type-alias ArithBinOp (→ Int Int Int))
( define - type - alias C Complex ) ; error , Complex undefined
(check-type ((λ ([x : Int]) (+ x 2)) 3) : Integer)
(check-type ((λ ([x ... | null | https://raw.githubusercontent.com/stchang/macrotypes/05ec31f2e1fe0ddd653211e041e06c6c8071ffa6/turnstile-test/tests/turnstile/stlc%2Breco%2Bvar-tests.rkt | racket | define-type-alias
error , Complex undefined
records (ie labeled tuples)
record errors
variants
variant errors
previous tuple tests: ------------------------------------------------------------
wont work anymore
(check-type (tup 1 2 3) : (× Int Int Int))
(check-type (tup 1 "1" #f +) : (× Int String Bool (→ Int I... | #lang s-exp turnstile/examples/stlc+reco+var
(require "rackunit-typechecking.rkt")
(define-type-alias Integer Int)
(define-type-alias ArithBinOp (→ Int Int Int))
(check-type ((λ ([x : Int]) (+ x 2)) 3) : Integer)
(check-type ((λ ([x : Integer]) (+ x 2)) 3) : Int)
(check-type ((λ ([x : Integer]) (+ x 2)) 3) : Integer)... |
f6c55a6218f8c87ab1fc90f0bc5ddae6bd0bcee55ac92c0d150525f0c4c2056f | micahcantor/comp-to-assembly-from-scratch-hs | Emit.hs | # LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE DoAndIfThenElse #-}
# LANGUAGE NamedFieldPuns #
module Emit where
import Control.Monad.Except (Except, MonadError (..), runExcept)
import Control.Monad.State (MonadState (..), StateT (..), execStateT, gets, modify)
import Control.Monad.Writer (MonadWriter (..), Wri... | null | https://raw.githubusercontent.com/micahcantor/comp-to-assembly-from-scratch-hs/20de9c98caa7c44eb1a7ade211a4676fa8fab6a6/src/Emit.hs | haskell | # LANGUAGE DoAndIfThenElse #
compare left to right
otherwise store 0
compare left to right
call malloc
save the current val of r4
store malloc pointer in r4
prepare to store length
return pointer to r0
restore r4
put array pointer in r0
save array pointer
put array index in r0
put array pointer in r1
load... | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE NamedFieldPuns #
module Emit where
import Control.Monad.Except (Except, MonadError (..), runExcept)
import Control.Monad.State (MonadState (..), StateT (..), execStateT, gets, modify)
import Control.Monad.Writer (MonadWriter (..), WriterT, execWriterT)
import Data.Fo... |
78e4892b8e548a87b42118ca79b0be46df9512ed5b2d8e7818c30cfab9f9fd2e | falsetru/htdp | 31.3.1.scm | (define (sum alon)
(cond
[(empty? alon) 0]
[else (+ (first alon) (sum (rest alon)))]))
(define (sum-acc alon0)
(local ((define (sum-a alon accumulator)
(cond
[(empty? alon) accumulator]
[else (sum-a (rest alon) (+ (first alon) accumulator))])))
(sum-a alon0 0)))
(define (g-series ... | null | https://raw.githubusercontent.com/falsetru/htdp/4cdad3b999f19b89ff4fa7561839cbcbaad274df/31/31.3.1.scm | scheme | -0.49746596003269394
-0.4974659600326953
-4974659600326939.0
-4974659600326953.0 | (define (sum alon)
(cond
[(empty? alon) 0]
[else (+ (first alon) (sum (rest alon)))]))
(define (sum-acc alon0)
(local ((define (sum-a alon accumulator)
(cond
[(empty? alon) accumulator]
[else (sum-a (rest alon) (+ (first alon) accumulator))])))
(sum-a alon0 0)))
(define (g-series ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.