_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 |
|---|---|---|---|---|---|---|---|---|
5bcd9fe4b50c5278e8d15734fee644a518d5372165238e31f0ac87179d551bb2 | KavehYousefi/Esoteric-programming-languages | main.lisp | Author :
Date : 2022 - 03 - 07
;;
;; Sources:
;; -> ""
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; -- Declaration of types. -- ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(deftype hash-table-of (&optio... | null | https://raw.githubusercontent.com/KavehYousefi/Esoteric-programming-languages/96aebaacd499610c47bedfa698fb3613638fc0d0/trueclone/trueclone_001/main.lisp | lisp |
Sources:
-> ""
-- Declaration of types. -- ;;
-------------------------------------------------------
-------------------------------------------------------
-------------------------------------------------------
-- Definition of global variables and constants. ... | Author :
Date : 2022 - 03 - 07
(deftype hash-table-of (&optional (key-type T) (value-type T))
"The ``hash-table-of'' type defines a hash table of zero or more
entries, each key of which conforms to the KEY-TYPE, associated with
a value of the VALUE-TYPE."
(let ((predicate (gensym)))
(declare ... |
cd748797704096dd6b4895a83b79c7502c62e4ceff64a0a170c805bf22113ceb | unclebob/more-speech | files.clj | (ns more-speech.util.files
(:require [clojure.java.io :as io]))
(defn file-exists? [fname]
(.exists (io/file fname)))
(defn is-directory? [fname]
(.isDirectory (io/file fname)))
(defn delete-file [fname]
(when (file-exists? fname)
(io/delete-file fname)))
(defn rename-file [fname to-fname]
(when (file... | null | https://raw.githubusercontent.com/unclebob/more-speech/124e5a335ae34428206593e2f0d8b6bfa7121547/src/more_speech/util/files.clj | clojure | (ns more-speech.util.files
(:require [clojure.java.io :as io]))
(defn file-exists? [fname]
(.exists (io/file fname)))
(defn is-directory? [fname]
(.isDirectory (io/file fname)))
(defn delete-file [fname]
(when (file-exists? fname)
(io/delete-file fname)))
(defn rename-file [fname to-fname]
(when (file... | |
ff471bc77d78b94492ba76ddc221ee3f22cd406c109a996c263ed555568d584f | Leptune/erlang_email | email.erl | -module(email).
-include("email.hrl").
-export([send/1]).
-compile(export_all).
-define(MAX_SIZE, 1024).
-define(DE, io:format("~p:~p~n", [?FILE, ?LINE])).
%% send email by email record
send(Email) when
undefined =/= Email#email.server_ip,
undefined =/= Email#email.account,
undefined =/= Emai... | null | https://raw.githubusercontent.com/Leptune/erlang_email/0690ccb02b1ac6288372e36044510eba643a7d6c/email.erl | erlang | send email by email record
connect your email
send email head
send email info
send email data
send email text
send email other type
send file
her email address
send socket
recv socket
send data to server via tcp or ssl
recv data to server via tcp or ssl | -module(email).
-include("email.hrl").
-export([send/1]).
-compile(export_all).
-define(MAX_SIZE, 1024).
-define(DE, io:format("~p:~p~n", [?FILE, ?LINE])).
send(Email) when
undefined =/= Email#email.server_ip,
undefined =/= Email#email.account,
undefined =/= Email#email.to_emails,
und... |
f9cfa579dfc48de24218ebaa8b2b927d3cb6578af74687360b432c7b1c8c41be | JacquesCarette/Drasil | IMods.hs | # LANGUAGE PostfixOperators #
module Drasil.SglPendulum.IMods (iMods, angularDisplacementIM) where
import Prelude hiding (cos, sin)
import Language.Drasil
import Theory.Drasil
import Utils.Drasil (weave)
import Language.Drasil.Chunk.Concept.NamedCombinators
import qualified Language.Drasil.Sentence.Combinators as S
i... | null | https://raw.githubusercontent.com/JacquesCarette/Drasil/a1c22b739c958ae169e8fe4fb2ea2b0a670dc7df/code/drasil-example/sglpendulum/lib/Drasil/SglPendulum/IMods.hs | haskell | Angular Displacement | # LANGUAGE PostfixOperators #
module Drasil.SglPendulum.IMods (iMods, angularDisplacementIM) where
import Prelude hiding (cos, sin)
import Language.Drasil
import Theory.Drasil
import Utils.Drasil (weave)
import Language.Drasil.Chunk.Concept.NamedCombinators
import qualified Language.Drasil.Sentence.Combinators as S
i... |
c1a254dbdbbbb3f93a31de4c83993634ef578e39d8e0faa6dfca9c6e7c296ac9 | ha-mo-we/Racer | lracer-reader-macros.lisp | ;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: racer -*-
(in-package racer)
;;;
;;;
;;;
(defstruct (racer-boolean
(:predicate racer-boolean-p)
(:conc-name boolean-))
value)
(defmethod print-object ((object racer-boolean) stream)
(declare (ignorable stream))
(if (string= (boolean-va... | null | https://raw.githubusercontent.com/ha-mo-we/Racer/d690841d10015c7a75b1ded393fcf0a33092c4de/clients/lracer/lracer-reader-macros.lisp | lisp | -*- Mode: Lisp; Syntax: Common-Lisp; Package: racer -*-
(find char SB-FORMAT::*FORMAT-WHITESPACE-CHARS*) |
(in-package racer)
(defstruct (racer-boolean
(:predicate racer-boolean-p)
(:conc-name boolean-))
value)
(defmethod print-object ((object racer-boolean) stream)
(declare (ignorable stream))
(if (string= (boolean-value object) "false")
(write-string "#F" stream)
(write-string ... |
162b47881b91dbc34cf9c4fa1834987c40104b0dcad4afa172aadd86299724d9 | rpearce/slugger | Main.hs | module Main where
import qualified Data.String.Slugger as Slugger
import qualified System.Environment as Env
help :: String
help =
"slugger: Clean URI slugs\n" ++
"usage: slugger \"<text>\"\n" ++
" -h, --help Read this help info\n"
parse :: [String] -> String
parse ["-h"] = help
parse ["--help"... | null | https://raw.githubusercontent.com/rpearce/slugger/f09215c3053e4eadd9cc784dce35ba6cc38d5913/app/Main.hs | haskell | module Main where
import qualified Data.String.Slugger as Slugger
import qualified System.Environment as Env
help :: String
help =
"slugger: Clean URI slugs\n" ++
"usage: slugger \"<text>\"\n" ++
" -h, --help Read this help info\n"
parse :: [String] -> String
parse ["-h"] = help
parse ["--help"... | |
2f2b147ab4abea25fa5128bc025475639b1825a8d6d3cbab4116815d5538a239 | SonarQubeCommunity/sonar-erlang | complexity.erl | -module(statements).
sayHello(A) -> %+1 complexity (function clause)
lists:foreach(fun(Name) -> call(Name, stop) end, %+1 complexity fun expression --> do we need it?
checkpoints()),
Name = Cp#checkpoint_args.name,
if
LocalWriter == true -> %+1 complexity branch expression
{ok, node()}... | null | https://raw.githubusercontent.com/SonarQubeCommunity/sonar-erlang/279eb7ccd84787c1c0cfd34b9a07981eb20183e3/erlang-checks/src/test/resources/checks/complexity.erl | erlang | +1 complexity (function clause)
+1 complexity fun expression --> do we need it?
+1 complexity branch expression
+1 complexity branch expression
+1 complexity branch expression
+1 complexity pattern statement
+1 complexity pattern statement
+1 complexity pattern statement
+1 complexity pattern statement
+1 complexity pa... | -module(statements).
checkpoints()),
Name = Cp#checkpoint_args.name,
if
{ok, node()};
{ok, node()};
{ok, hd(Writers)}
end,
case R#retainer.really_retain of
PendingTab = Cp#checkpoint_args.pending_tab,
case catch ?ets_lookup_element(PendingTab, Tid, 1) of
Store... |
ed8b5a0d3bcc749e750ce6bcc65872f4cd87f1b9356b6d18d25fab2a568fcf47 | nasa/Common-Metadata-Repository | bulk_index.clj | (ns cmr.access-control.data.bulk-index
"Performs bulk indexing of access control data."
(:require
[clj-time.format :as f]
[cmr.access-control.data.elasticsearch :as es]
[cmr.common.concepts :as cs]
[cmr.common.log :refer [info]]
[cmr.common.util :as util]))
(defmulti prepare-batch
"Returns the bat... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/6fc7d3dce8060e5b569ae0b576e19fb355ce37e4/access-control-app/src/cmr/access_control/data/bulk_index.clj | clojure | Get the revision date of each item
Add on the last date
Remove nil because previous-max-revision-date could be nil | (ns cmr.access-control.data.bulk-index
"Performs bulk indexing of access control data."
(:require
[clj-time.format :as f]
[cmr.access-control.data.elasticsearch :as es]
[cmr.common.concepts :as cs]
[cmr.common.log :refer [info]]
[cmr.common.util :as util]))
(defmulti prepare-batch
"Returns the bat... |
d4c5ed7d8498fa032796e24894cbf027c7eeb016b9d7ee2f7254b728067f73c7 | zenspider/schemers | exercise.1.01.scm | #lang racket/base
* Exercise 1.1 :*
;; Below is a sequence of expressions. What is the result printed by
;; the interpreter in response to each expression? Assume that the
;; sequence is to be evaluated in the order in which it is presented.
10
12
8
3
6
(define a 3)
(define b (+ a 1))
19
(= a b) ... | null | https://raw.githubusercontent.com/zenspider/schemers/2939ca553ac79013a4c3aaaec812c1bad3933b16/sicp/ch_1/exercise.1.01.scm | scheme | Below is a sequence of expressions. What is the result printed by
the interpreter in response to each expression? Assume that the
sequence is to be evaluated in the order in which it is presented.
#f | #lang racket/base
* Exercise 1.1 :*
10
12
8
3
6
(define a 3)
(define b (+ a 1))
19
(if (and (> b a) (< b (* a b)))
b
4
(cond ((= a 4) 6)
((= b 4) (+ 6 7 a))
16
6
(* (cond ((> a b) a)
((< a b) b)
(else -1))
16
|
e309cb21513d85710bb5cef111b5034ffff0bee0d38c91f2098866db6aac253e | PJK/haskell-pattern-matching | LibSpec.hs | module LibSpec (spec) where
import Control.Monad (forM_)
import Control.Monad.Reader (runReaderT)
import Data.Aeson (eitherDecode)
import qualified Data.ByteString.Lazy as LB
import Lib
import OptParse
import System.Directory (doesFileExi... | null | https://raw.githubusercontent.com/PJK/haskell-pattern-matching/7ef4a45731beba92ee01614ae563df65be36e8ba/test/LibSpec.hs | haskell | This implicitly checks that decoding succeeds. | module LibSpec (spec) where
import Control.Monad (forM_)
import Control.Monad.Reader (runReaderT)
import Data.Aeson (eitherDecode)
import qualified Data.ByteString.Lazy as LB
import Lib
import OptParse
import System.Directory (doesFileExi... |
1de8798aff919c46961090b1dbef7accd04a9b90365b98ae4b9c1b5d26ecfd18 | awakesecurity/language-ninja | Lexer.hs | -*- coding : utf-8 ; mode : ; -*-
-- File: library/Language/Ninja/Lexer.hs
--
-- License:
Copyright 2011 - 2017 .
Copyright Awake Networks 2017 .
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that ... | null | https://raw.githubusercontent.com/awakesecurity/language-ninja/e7badf49b45d9c28b558376be3152d51f5d2d437/library/Language/Ninja/Lexer.hs | haskell | File: library/Language/Ninja/Lexer.hs
License:
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
... | -*- coding : utf-8 ; mode : ; -*-
Copyright 2011 - 2017 .
Copyright Awake Networks 2017 .
* Neither the name of nor the names of other
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT
... |
6480a3d786e26c82a319bf38fb0a077bc25b00956624adf45ef0b710b67031e1 | linuxsoares/artigos-clojure | import-java-clojure.clj | (ns import-java-clojure.import-java-clojure
(:import
java.util.Date
java.text.SimpleDateFormat))
(def date (Date.))
(def sdf (SimpleDateFormat. "MM/dd/yyyy"))
(println (.toUpperCase "clojure with java"))
(.format (SimpleDateFormat. "MM/dd/yyyy") (Date.))
(.format sdf (Date.))
(.format (SimpleDateForma... | null | https://raw.githubusercontent.com/linuxsoares/artigos-clojure/6c4183e767e71168c778973dd5831e7c9edfaf4a/import-java-clojure/import-java-clojure.clj | clojure | (ns import-java-clojure.import-java-clojure
(:import
java.util.Date
java.text.SimpleDateFormat))
(def date (Date.))
(def sdf (SimpleDateFormat. "MM/dd/yyyy"))
(println (.toUpperCase "clojure with java"))
(.format (SimpleDateFormat. "MM/dd/yyyy") (Date.))
(.format sdf (Date.))
(.format (SimpleDateForma... | |
ad689faf524dbd848e753e369cf2bbbfbb9ef6a807223bfcc94ddd9751b085b4 | binaryage/chromex | identity.clj | (ns chromex.ext.identity
"Use the chrome.identity API to get OAuth2 access tokens.
* available since Chrome 36
* "
(:refer-clojure :only [defmacro defn apply declare meta let partial])
(:require [chromex.wrapgen :refer [gen-wrap-helper]]
[chromex.callgen :refer [gen-call-helper gen-tap-all... | null | https://raw.githubusercontent.com/binaryage/chromex/33834ba5dd4f4238a3c51f99caa0416f30c308c5/src/exts/chromex/ext/identity.clj | clojure | app-id>.chromiumapp.org/*, the window will close, and the final redirect URL will be passed to the
app-id>.chromiumapp.org/*.
-- events -----------------------------------------------------------------------------------------------------------------
docs: /#tapping-events
-- convenience ----------------------... | (ns chromex.ext.identity
"Use the chrome.identity API to get OAuth2 access tokens.
* available since Chrome 36
* "
(:refer-clojure :only [defmacro defn apply declare meta let partial])
(:require [chromex.wrapgen :refer [gen-wrap-helper]]
[chromex.callgen :refer [gen-call-helper gen-tap-all... |
431abdb69eaf9d4dbd094b4cec03e360782d511b644b4bf3d80e13cc43780039 | logicmoo/wam_common_lisp | pcl-env-internal.lisp | (DEFINE-FILE-INFO PACKAGE "XCL" READTABLE "XCL")
1 8356
il:|changes| il:|to:| (il:vars il:pcl-env-internalcoms)
(il:props (il:pcl-env-internal il:makefile-environment))
(il:functions stack-eql stack-pointer-frame stack-frame-valid-p
... | null | https://raw.githubusercontent.com/logicmoo/wam_common_lisp/4396d9e26b050f68182d65c9a2d5a939557616dd/prolog/wam_cl/src/pcl/pcl-env-internal.lisp | lisp | | "***************************************")
| "")
| " ")
| " ")
| "Any person obtaining a copy of this software is requested to send their name and post office or electronic mail address to:")
| "")
| " Suggestions, comments and requests for improvements are also welcome.")
| " ****************************************... | (DEFINE-FILE-INFO PACKAGE "XCL" READTABLE "XCL")
1 8356
il:|changes| il:|to:| (il:vars il:pcl-env-internalcoms)
(il:props (il:pcl-env-internal il:makefile-environment))
(il:functions stack-eql stack-pointer-frame stack-frame-valid-p
... |
e67bf5ce6d3d618fe8a4a0fc767ecced7a1e6b187ec59dd11e01a68bb778ecaa | webyrd/mediKanren | string-search-build-spec.rkt | #lang racket
;(require racket)
;(require racket/match)
(require chk)
(require "../../string-search-config.rkt")
(require "../../string-search-impl.rkt")
(require "../../string-search.rkt")
(require racket/pretty)
(require "../../db/yeast-micro-sri-reference-kg-0.3.0.rkt")
(require "../../base.rkt")
(chk
(#:do
... | null | https://raw.githubusercontent.com/webyrd/mediKanren/d10fea912bc2bc7eba08212e8cb77d021e28d288/medikanren2/test/10GB-CI/string-search-build-spec.rkt | racket | (require racket)
(require racket/match) | #lang racket
(require chk)
(require "../../string-search-config.rkt")
(require "../../string-search-impl.rkt")
(require "../../string-search.rkt")
(require racket/pretty)
(require "../../db/yeast-micro-sri-reference-kg-0.3.0.rkt")
(require "../../base.rkt")
(chk
(#:do
(let* (
(relp-index (... |
0814ca04c1529ce56123dc80dfa68dd1f21c3c63ddca1f51a65a17bd0f7a9f2e | racket/unix-socket | common.rkt | #lang racket/base
(require racket/file
rackunit)
(provide
call-in-custodian
make-temp-file-name
test-case*)
(define (call-in-custodian proc)
(parameterize ((current-subprocess-custodian-mode 'kill))
(parameterize ((current-custodian (make-custodian)))
(call-with-continuation-barrier
(l... | null | https://raw.githubusercontent.com/racket/unix-socket/89007b9b5f2188a06ed656e0f2e4fa8d3472a085/unix-socket-test/tests/unix-socket/common.rkt | racket | #lang racket/base
(require racket/file
rackunit)
(provide
call-in-custodian
make-temp-file-name
test-case*)
(define (call-in-custodian proc)
(parameterize ((current-subprocess-custodian-mode 'kill))
(parameterize ((current-custodian (make-custodian)))
(call-with-continuation-barrier
(l... | |
9dc0c80870be365868b72966ba5d63e271d1987b0d94f7f0ce8fa93cc79c6909 | Ptival/yugioh | DuelHelpers.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE TypeFamilies #
| Helpers that can be used within a ` Duel ` , using ` GameEffects `
module YuGiOh.DuelHelpers
( opponentOf,
overMonster,
)
where
import Control.Lens (ALens')
import Polysemy
import Polysemy.State
impo... | null | https://raw.githubusercontent.com/Ptival/yugioh/855e8f22c3ff322c7ca1d0a1fa96c50a54724aeb/lib/YuGiOh/DuelHelpers.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE RankNTypes # | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
| Helpers that can be used within a ` Duel ` , using ` GameEffects `
module YuGiOh.DuelHelpers
( opponentOf,
overMonster,
)
where
import Control.Lens (ALens')
import Polysemy
import Polysemy.State
import YuGiOh.Duel
import qualified YuGiOh.Lenses as L
... |
114a2c690cf7a9e3a692dc6a4238d604abe4a29a26ea06103497a776332e33f2 | evincarofautumn/kitten | Word.hs | |
Module : Kitten . Entry . Word
Description : Word definition entries
Copyright : ( c ) , 2016
License : MIT
Maintainer :
Stability : experimental
Portability : GHC
Module : Kitten.Entry.Word
Description : Word definition entries
Copyright : (c) Jon Purdy, 2016
License ... | null | https://raw.githubusercontent.com/evincarofautumn/kitten/a5301fe24dbb9ea91974abee73ad544156ee4722/lib/Kitten/Entry/Word.hs | haskell | If present, the associativity (leftward or rightward) of this operator; if
not, defaults to non-associative.
Whether this is a word/instance, trait, or permission.
If present, the definition of the word; if not, this is a declaration.
Whether this word is visible outside its vocabulary.
User-defined metadata.
So... | |
Module : Kitten . Entry . Word
Description : Word definition entries
Copyright : ( c ) , 2016
License : MIT
Maintainer :
Stability : experimental
Portability : GHC
Module : Kitten.Entry.Word
Description : Word definition entries
Copyright : (c) Jon Purdy, 2016
License ... |
231d494b4690f08c3ab807c6033633c0ff2f8db82d32153649c85b02a4d3eeb3 | pascal-knodel/haskell-craft | E18.hs | module E18 where
sum :: [Int] -> Int
sum [] = 0
sum (i : is)
= i + (sum is)
import Prelude hiding ( sum )
sum : : [ Int ] - > Int
sum [ ] = 0
sum ( i : is )
= i + ( sum is )
import Prelude hiding (sum)
sum :: [Int] -> Int
sum [] = 0
sum (i : is)
= i + (sum is)
-} | null | https://raw.githubusercontent.com/pascal-knodel/haskell-craft/c03d6eb857abd8b4785b6de075b094ec3653c968/Examples/%C2%B7%C2%A0Errors/E18.hs | haskell | module E18 where
sum :: [Int] -> Int
sum [] = 0
sum (i : is)
= i + (sum is)
import Prelude hiding ( sum )
sum : : [ Int ] - > Int
sum [ ] = 0
sum ( i : is )
= i + ( sum is )
import Prelude hiding (sum)
sum :: [Int] -> Int
sum [] = 0
sum (i : is)
= i + (sum is)
-} | |
7b45af0db2bd233956e75d2930969c74b8af456c112fc28b5a04cc79261e57aa | cdepillabout/termonad | ExampleColourExtension.hs | -- | This is an example Termonad configuration that shows how to use the
-- 'ColourExtension' to set colours for your terminal. See the project-wide
README.md for how to use configuration scripts .
module Main where
import Data.Maybe (fromMaybe)
import Termonad
( CursorBlinkMode(CursorBlinkModeOff), Option(Se... | null | https://raw.githubusercontent.com/cdepillabout/termonad/d0f8c9a1dc082aa3c2a56ed668914a2abeea86d3/example-config/ExampleColourExtension.hs | haskell | | This is an example Termonad configuration that shows how to use the
'ColourExtension' to set colours for your terminal. See the project-wide
for Termonad.
This shows how a few settings can be changed.
Set the cursor background colour. This is the normal colour of the
cursor.
purple
Set the default foregrou... | README.md for how to use configuration scripts .
module Main where
import Data.Maybe (fromMaybe)
import Termonad
( CursorBlinkMode(CursorBlinkModeOff), Option(Set)
, ShowScrollbar(ShowScrollbarNever), TMConfig, confirmExit, cursorBlinkMode
, defaultConfigOptions, defaultTMConfig, options, showMenu, showScr... |
6934d7ae9e973d714a9e618f1e79e1524fa0d5dad6ea80bb0ca50650848f577c | glutamate/bugpan | Parse.hs | module Parse where
import qualified BNFC.AbsBugpan as B
import Expr
import Numbers
import EvalM
import Data.List
import BNFC.LexBugpan
import BNFC.ParBugpan
import BNFC.SkelBugpan
import BNFC.PrintBugpan
import BNFC.LayoutBugpan
import BNFC.ErrM
import Data.List.HT (partitionMaybe)
import HaskSyntaxUntyped --(split... | null | https://raw.githubusercontent.com/glutamate/bugpan/d0983152f5afce306049262cba296df00e52264b/Parse.hs | haskell | (splitBySpaces )
convDecl b = error $"convDecl: "++show b
make substitutions
"-(1+1)" `parsesTo` (-2)), | module Parse where
import qualified BNFC.AbsBugpan as B
import Expr
import Numbers
import EvalM
import Data.List
import BNFC.LexBugpan
import BNFC.ParBugpan
import BNFC.SkelBugpan
import BNFC.PrintBugpan
import BNFC.LayoutBugpan
import BNFC.ErrM
import Data.List.HT (partitionMaybe)
import UnitTesting
import PrettyP... |
29051f472e6556d1a14ac2026087136f39d07b34666bcd66fc8b29df43a3cdc4 | racket/racket7 | place-primitive.rkt | #lang racket/base
;; When places are implemented by plain old threads,
;; place channels need to be shared across namespaces,
so ` # % place - struct ' is included in builtins .
(provide place-struct-primitives)
(define-values (struct:TH-place-channel TH-place-channel TH-place-channel?
... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/expander/boot/place-primitive.rkt | racket | When places are implemented by plain old threads,
place channels need to be shared across namespaces, | #lang racket/base
so ` # % place - struct ' is included in builtins .
(provide place-struct-primitives)
(define-values (struct:TH-place-channel TH-place-channel TH-place-channel?
TH-place-channel-ref TH-place-channel-set!)
(make-struct-type 'TH-place-channel #f 2 0 #f (li... |
438f0f8eb82d5f27d8d077595501ee89eb6ee9859eb0df05545c893d8b185e82 | sneeuwballen/zipperposition | LLProof.mli |
This file is free software , part of Zipperposition . See file " license " for more details .
* { 1 Low Level Proofs }
(** Low level proofs, intended for mechanical proof checking.
Instantiations (substitutions) are explicit because that should make
the job of the checker easier.
NOTE: this is still ... | null | https://raw.githubusercontent.com/sneeuwballen/zipperposition/7f1455fbe2e7509907f927649c288141b1a3a247/src/proofs/LLProof.mli | ocaml | * Low level proofs, intended for mechanical proof checking.
Instantiations (substitutions) are explicit because that should make
the job of the checker easier.
NOTE: this is still uncooked, and will probably change.
* Instantiate some binder with the following terms. Order matters.
local renaming for t... |
This file is free software , part of Zipperposition . See file " license " for more details .
* { 1 Low Level Proofs }
open Logtk
val section : Util.Section.t
type term = TypedSTerm.t
type ty = term
type form = term
type tag = Proof.tag
type name = string
type t
type step =
| Goal
| Assert
| Negated_g... |
62f4b5ace0fd567c2597d2f827b30b93b703198104637d8299269863e1c418d1 | vikram/lisplibraries | address.lisp |
(in-package :employer-employee)
;;; Address
(defclass address ()
((street :initform nil
:accessor address-street
:initarg :street)
(city :initform nil
:accessor address-city
:initarg :city)
(state :initform nil
:accessor address-state
:type (or us-state null)
:initarg :state)))
;;; Form ... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/weblocks-stable/contrib/yarek/examples/employer-employee/src/model/address.lisp | lisp | Address
Form View |
(in-package :employer-employee)
(defclass address ()
((street :initform nil
:accessor address-street
:initarg :street)
(city :initform nil
:accessor address-city
:initarg :city)
(state :initform nil
:accessor address-state
:type (or us-state null)
:initarg :state)))
(defview address-form... |
11f33f1cc9c3468c96a8f7d984a225e27806853d954d6abc0eb0b48072e4e066 | clj-kondo/clj-kondo | pod_test.clj | (ns clj-kondo.pod-test
(:require [babashka.pods :as pods]
[clojure.string :as str]
[clojure.test :refer [deftest is]]))
(def pod-spec (if (= "native" (System/getenv "CLJ_KONDO_TEST_ENV"))
["./clj-kondo"]
["clojure" "-M:clj-kondo/dev"]))
(pods/load-pod pod-spec... | null | https://raw.githubusercontent.com/clj-kondo/clj-kondo/738b7bc4467052c8a4573fd2240888553ccd413c/pod-test/clj_kondo/pod_test.clj | clojure | (ns clj-kondo.pod-test
(:require [babashka.pods :as pods]
[clojure.string :as str]
[clojure.test :refer [deftest is]]))
(def pod-spec (if (= "native" (System/getenv "CLJ_KONDO_TEST_ENV"))
["./clj-kondo"]
["clojure" "-M:clj-kondo/dev"]))
(pods/load-pod pod-spec... | |
c83c34a1354eb36add00daefb08dcdba5e2b8ca4c3754020983881c07ea8c529 | nomeata/haskell-rec-def | spaceleak.hs | # LANGUAGE LambdaCase #
# LANGUAGE NumericUnderscores #
{-# OPTIONS_GHC -Wno-name-shadowing #-}
|
This test checks that resolved cells do no longer hold on to references to
dependent cells , to avoid space leaks , especially with the “ constant global ”
cells like ' RS.empty ' .
This test checks that resolved ... | null | https://raw.githubusercontent.com/nomeata/haskell-rec-def/6ec1b0bb9e449ca2f06050da08edc1a4651aa928/tests/spaceleak.hs | haskell | # OPTIONS_GHC -Wno-name-shadowing # | # LANGUAGE LambdaCase #
# LANGUAGE NumericUnderscores #
|
This test checks that resolved cells do no longer hold on to references to
dependent cells , to avoid space leaks , especially with the “ constant global ”
cells like ' RS.empty ' .
This test checks that resolved cells do no longer hold on to references... |
bd421731183e077e993558b9467113df952f3b6a86b2e3c1d58e9e7d09184bd6 | cdornan/keystore | Crypto.hs | # LANGUAGE RecordWildCards #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE NamedFieldPuns #
# LANGUAGE BangPatterns #
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE PackageImports #-}
# LANGUAGE ScopedTypeVari... | null | https://raw.githubusercontent.com/cdornan/keystore/5c8a9272537bc880c055c0a6b44327386a16b52f/src/Data/KeyStore/KS/Crypto.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
# LANGUAGE PackageImports #
testing
smoke tests
defaultEncryptedCopy
saving and restoring secret copies
encrypting & decrypting
signing & verifying
hashing
Generating a private/public key pair
Enc... | # LANGUAGE RecordWildCards #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE NamedFieldPuns #
# LANGUAGE BangPatterns #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Data.KeyStore.KS.Crypto
( sizeAesIV
, sizeOAE
, defaultEncryp... |
876d7a42bbf5b9ca7875e83d35fd600670a9e286c07c879e9bd1b95b9c311388 | EwenG/badigeon | pom.clj | (ns badigeon.pom
(:require [clojure.data.xml :as xml]
[clojure.java.io :as io]
[clojure.zip :as zip]
[clojure.data.xml.tree :as tree]
[clojure.data.xml.event :as event]
[clojure.tools.deps.alpha.util.maven :as maven]
[badigeon.utils :as utils])
... | null | https://raw.githubusercontent.com/EwenG/badigeon/5b020cbd2f0867ccdc98d6394c512337d927bd9e/src/badigeon/pom.clj | clojure | (ns badigeon.pom
(:require [clojure.data.xml :as xml]
[clojure.java.io :as io]
[clojure.zip :as zip]
[clojure.data.xml.tree :as tree]
[clojure.data.xml.event :as event]
[clojure.tools.deps.alpha.util.maven :as maven]
[badigeon.utils :as utils])
... | |
81406b9f369cb380de21087790c105259b9f823d0d81d83185ed636dc9466c01 | coq/coq | section.ml | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/86b4fc3f8464253bc908db37de39b7ec533bec23/kernel/section.ml | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
9796b0dab1ee2abf8695d51b49f1828054f507f5eb66091b6f8b8e1b712845cb | jellelicht/guix | gnu-maintenance.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2010 , 2011 , 2012 , 2013 , 2014 , 2015 < >
Copyright © 2012 , 2013 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as publis... | null | https://raw.githubusercontent.com/jellelicht/guix/83cfc9414fca3ab57c949e18c1ceb375a179b59c/guix/gnu-maintenance.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2010 , 2011 , 2012 , 2013 , 2014 , 2015 < >
Copyright © 2012 , 2013 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (guix gnu-maintenance)
#:use-... |
78eb1422a27d3ff95d2909223c02cc1e35d51d4188d53d6a3cade5ea02db3eef | fdopen/depext-cygwinports | config_file.ml | (*********************************************************************************)
(* Config_file *)
(* *)
Copyright ( C ) 2011 Institut National de Recherche en Informat... | null | https://raw.githubusercontent.com/fdopen/depext-cygwinports/4caeb558598e2b62515909e98d95c70f0af5f420/config_file.ml | ocaml | *******************************************************************************
Config_file
et en Automatique. All rights reserved.
... | Copyright ( C ) 2011 Institut National de Recherche en Informatique
it under the terms of the GNU Library General Public License as
published by the Free Software Foundation ; either version 2 of the
GNU Library General Public License for more details . ... |
1a8ac868e0a4b0da4b121b5ddc3dcf62ba5112f7e5e280608c756b7e07d7c68f | dym/movitz | load.lisp | ;;;;------------------------------------------------------------------
;;;;
Copyright ( C ) 2003 - 2004 ,
Department of Computer Science , University of Tromso , Norway .
;;;;
;;;; For distribution policy, see the accompanying file COPYING.
;;;;
;;;; Filename: load.lisp
Description : Load the ... | null | https://raw.githubusercontent.com/dym/movitz/56176e1ebe3eabc15c768df92eca7df3c197cb3d/load.lisp | lisp | ------------------------------------------------------------------
For distribution policy, see the accompanying file COPYING.
Filename: load.lisp
------------------------------------------------------------------
these are here for now, because
ia-x86 needs them whil... | Copyright ( C ) 2003 - 2004 ,
Department of Computer Science , University of Tromso , Norway .
Description : Load the Movitz development system .
Author : < >
Created at : Thu Jan 15 18:40:58 2004
$ I d : load.lisp , v 1.14 2008 - 03 - 15 20:46:17 Exp $
(in-package :cl-user)
#+li... |
ee26303fa0a8e5baff045d9f8cee54e43d72092ccea22e2a5801333bb1520efe | haskell-game/brainstorming | collect.hs | import Control.Arrow (first)
import Control.Monad (forM_)
import Data.Char (isAlphaNum)
import Data.List (isPrefixOf, sortBy)
import Data.Tuple (swap)
import System.Environment (getArgs)
import qualified Data.Map as M
import qualified Data.Set as S
main :: IO ()
main = do
(opti... | null | https://raw.githubusercontent.com/haskell-game/brainstorming/3a12ae4e6b4d954da69a4282658c37c3b920b37f/glxinfos/collect.hs | haskell | import Control.Arrow (first)
import Control.Monad (forM_)
import Data.Char (isAlphaNum)
import Data.List (isPrefixOf, sortBy)
import Data.Tuple (swap)
import System.Environment (getArgs)
import qualified Data.Map as M
import qualified Data.Set as S
main :: IO ()
main = do
(opti... | |
b73a7285bb6c618b824462133ffe77d346aa6d55c4aee709f12af0ba2b802234 | tlehman/sicp-exercises | ex-2.05.scm | Exercise 2.05 : Show that we can represent pairs of non - negative
; integers using only numbers and arithmetic operations if we
represent the pair a and b as the integer ( 2^a)(3^b )
;
; Give the corresponding definitions of the procedures cons, car and
; cdr.
(load "helpers.scm")
(load "ex-1.16.scm")
(define (e... | null | https://raw.githubusercontent.com/tlehman/sicp-exercises/57151ec07d09a98318e91c83b6eacaa49361d156/ex-2.05.scm | scheme | integers using only numbers and arithmetic operations if we
Give the corresponding definitions of the procedures cons, car and
cdr. | Exercise 2.05 : Show that we can represent pairs of non - negative
represent the pair a and b as the integer ( 2^a)(3^b )
(load "helpers.scm")
(load "ex-1.16.scm")
(define (expt b n) (fast-expt b n))
(define (cons a b)
(* (expt 2 a)
(expt 3 b)))
(define (car c)
(define (multiple-of-2? n) (= (remainder ... |
27cb44ec6ecf6ac4b2b05fa8ee820ee9b361fe3045c010b867009cb97b83483e | haduart/flycouchdb | parse_migration_names.clj | (ns flycouchdb.parser.parse-migration-names
(:use clojure.pprint
[slingshot.slingshot :only [throw+ try+]]))
(defn- edn-file?
"Checks if it's an edn file"
[file-name]
(let [total-file (count file-name)]
(= (subs file-name (- total-file 4) total-file) ".edn")))
(defn- remove-file-extension
"Remov... | null | https://raw.githubusercontent.com/haduart/flycouchdb/ecbd0ebb97cfc4aed116cfe43dea61076a51cf54/src/flycouchdb/parser/parse_migration_names.clj | clojure | (ns flycouchdb.parser.parse-migration-names
(:use clojure.pprint
[slingshot.slingshot :only [throw+ try+]]))
(defn- edn-file?
"Checks if it's an edn file"
[file-name]
(let [total-file (count file-name)]
(= (subs file-name (- total-file 4) total-file) ".edn")))
(defn- remove-file-extension
"Remov... | |
7b7f7e9685a820c72228cfcd3b4f6fb939c507c0764174a7e3eed3fbf0608700 | pirapira/coq2rust | decl_proof_instr.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/pirapira/coq2rust/22e8aaefc723bfb324ca2001b2b8e51fcc923543/plugins/decl_mode/decl_proof_instr.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
********************************************************************** | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Term
open Tac... |
3af3467f5f6dd2148f1847f9a4d8731878fc478c8f9e9fb4c8a923211bd27f0b | marick/fp-oo | t_embedded_functions.clj | (ns sources.t-embedded-functions
(:use midje.sweet))
(load-file "sources/embedded-functions.clj")
(fact
(let [point (send-to (make Point 1 2) :shift 1 2)]
(:x point) => 2
(:y point) => 4)
(send-to (make Point 1 2) :class) => 'Point)
| null | https://raw.githubusercontent.com/marick/fp-oo/434937826d794d6fe02b3e9a62cf5b4fbc314412/test/sources/t_embedded_functions.clj | clojure | (ns sources.t-embedded-functions
(:use midje.sweet))
(load-file "sources/embedded-functions.clj")
(fact
(let [point (send-to (make Point 1 2) :shift 1 2)]
(:x point) => 2
(:y point) => 4)
(send-to (make Point 1 2) :class) => 'Point)
| |
a2bd37599174de7c59999fb12fc050f22f52e55e660c884f2d60dd0e1680c782 | orchid-hybrid/microKanren-sagittarius | t7.scm | (import (scheme base)
(test-check)
(miruKanren mk-basic)
(miruKanren copy-term))
(test-check "copy-termo #1"
(run* (lambda (q)
(fresh (t1 t2 x y z)
(== q (list t1 t2))
(== t1 (list x y x))
(copy-termo t1 t2))))
'((((_.0 _.1 _.0) (_.2 _.3 _.2)) where)))
| null | https://raw.githubusercontent.com/orchid-hybrid/microKanren-sagittarius/9e740bbf94ed2930f88bbcf32636d3480934cfbb/t/t7.scm | scheme | (import (scheme base)
(test-check)
(miruKanren mk-basic)
(miruKanren copy-term))
(test-check "copy-termo #1"
(run* (lambda (q)
(fresh (t1 t2 x y z)
(== q (list t1 t2))
(== t1 (list x y x))
(copy-termo t1 t2))))
'((((_.0 _.1 _.0) (_.2 _.3 _.2)) where)))
| |
7262ab4182d62dad4d06cbeee7b8cbc87189006df070840a518d0989cbd2e97c | janestreet/email_message | test_headers.ml | open! Core
open Email_message
module Expect_test_config = Core.Expect_test_config
let%expect_test "whitespace" =
let headers =
Email_headers.of_list
~normalize:`None
[ "header1", "1"
; "header2", " 2"
; "header3", "=?ISO-8859-1?Q?a?="
; "header4", " =?ISO-8859-1?Q?a?="
; "head... | null | https://raw.githubusercontent.com/janestreet/email_message/5ed0c387900b27cbf90e0058b17c7ada5e710be9/test/test_headers.ml | ocaml | open! Core
open Email_message
module Expect_test_config = Core.Expect_test_config
let%expect_test "whitespace" =
let headers =
Email_headers.of_list
~normalize:`None
[ "header1", "1"
; "header2", " 2"
; "header3", "=?ISO-8859-1?Q?a?="
; "header4", " =?ISO-8859-1?Q?a?="
; "head... | |
64346c3245f901e36a2841392ef5c2bcd900a1efc44e6ba086a85c36958bc025 | racketscript/racketscript | list.rkt | #lang racket/base
(define (list-sq)
(define lst '(1 2 3 4 5))
(map (lambda (x) (* x x)) lst))
(displayln (list-sq))
(displayln (length (list-sq)))
(equal? '(1 2 3) '(1 2 3))
(equal? (list 1 2 3) '(1 2 3))
(eq? '() null)
(null? '())
(list? '())
(list? (cons 1 2))
(list? (cons 1 '()))
(list? (cons 1 (cons 2 '()))... | null | https://raw.githubusercontent.com/racketscript/racketscript/f94006d11338a674ae10f6bd83fc53e6806d07d8/tests/basic/list.rkt | racket | anything larger will blow the stack | #lang racket/base
(define (list-sq)
(define lst '(1 2 3 4 5))
(map (lambda (x) (* x x)) lst))
(displayln (list-sq))
(displayln (length (list-sq)))
(equal? '(1 2 3) '(1 2 3))
(equal? (list 1 2 3) '(1 2 3))
(eq? '() null)
(null? '())
(list? '())
(list? (cons 1 2))
(list? (cons 1 '()))
(list? (cons 1 (cons 2 '()))... |
c3858bfa67efae05056f336565df109da318c959d5d899a944d80b738c059fcc | dyoo/ragg | stx.rkt | #lang racket/base
(require "rule-structs.rkt"
parser-tools/lex
racket/match
syntax/strip-context)
(provide rules->stx)
;; Given a sequence of rules, we translate these to syntax objects.
rules->stx : ( listof rule ) - > syntax
(define (rules->stx source rules #:original-stx [original-st... | null | https://raw.githubusercontent.com/dyoo/ragg/9cc648e045f7195702599b88e6b8db9364f88302/ragg/rules/stx.rkt | racket | Given a sequence of rules, we translate these to syntax objects. | #lang racket/base
(require "rule-structs.rkt"
parser-tools/lex
racket/match
syntax/strip-context)
(provide rules->stx)
rules->stx : ( listof rule ) - > syntax
(define (rules->stx source rules #:original-stx [original-stx #f])
(define rule-stxs
(map (lambda (stx) (rule->stx source ... |
5e7278ecea75a553dc427c0f1100f59d223be48d1809dcf0690773d14eed6d31 | bollu/koans | ft4.hs | data Seq a = Nil | Unit a | More (Some a) (Seq (Tuple a)) (Some a)
data Some a = One a | Two a a
data Tuple a = Pair a a | Triple a a a
-- head/cons is trivial.
tail :: Seq a -> Seq a
tail (Unit _) = Nil
tail (More (One _) q u) = more0 q u
tail (More (Two _ x) q u) = More (One x) q u
more0 :: Seq (a, a) -> Some a -... | null | https://raw.githubusercontent.com/bollu/koans/0204e9bb5ef9c541fe161523acac3cacae5d07fe/finger-tree/ft4.hs | haskell | head/cons is trivial.
? More (x y) (cons z (tail q)) u
(++)
expensive !
cheap !
cheap !
expensive !
We can add a case that is cheap for *both* of these operators. Then we have
a chance at getting constant time amortized complexity.
expensive !
cheap !
cheap !
cheap !
cheap !
expensive !
so thes... | data Seq a = Nil | Unit a | More (Some a) (Seq (Tuple a)) (Some a)
data Some a = One a | Two a a
data Tuple a = Pair a a | Triple a a a
tail :: Seq a -> Seq a
tail (Unit _) = Nil
tail (More (One _) q u) = more0 q u
tail (More (Two _ x) q u) = More (One x) q u
more0 :: Seq (a, a) -> Some a -> Seq a
more0 Nil (One y)... |
4e9152e1ebfa5957543d0b7b1f5dc5bdaf5dd22ece81d6f33bf05f832b545e1d | melange-re/melange | ounit_util_tests.ml | let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: ))
let ( =~ ) = OUnit.assert_equal ~printer:Ounit_test_util.dump
let add_int_3 buf (x : int) =
Buffer.add_int8 buf (x land 0xff);
Buffer.add_int16_le buf (x lsr 8)
let suites =
__FILE__
>::: [
( __LOC__ >:: fun _ ->
Ext_pervasives.nat_of_strin... | null | https://raw.githubusercontent.com/melange-re/melange/a8f6ddf9f46d51ffd1dde6095f655a8ca9fb6aa5/jscomp/ounit_tests/ounit_util_tests.ml | ocaml | let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: ))
let ( =~ ) = OUnit.assert_equal ~printer:Ounit_test_util.dump
let add_int_3 buf (x : int) =
Buffer.add_int8 buf (x land 0xff);
Buffer.add_int16_le buf (x lsr 8)
let suites =
__FILE__
>::: [
( __LOC__ >:: fun _ ->
Ext_pervasives.nat_of_strin... | |
f7bc5cb53be6fcc71dbf85bac374cf267a2d977e1c08a71c4962a105efdcb181 | BillHallahan/G2 | CEx2.hs | {-@ LIQUID "--short-names" @-}
{-@ LIQUID "--no-termination" @-}
{-@ LIQUID "--prune-unsorted" @-}
module CEx2 where
import Prelude hiding (length, replicate, foldr, foldr1, map, concat, zipWith, repeat)
import qualified Data.Map as M
infixr 9 :+:
map :: (a -> b) -> List a -> List b
concat :: List (List a... | null | https://raw.githubusercontent.com/BillHallahan/G2/21c648d38c380041a9036d0e375ec1d54120f6b4/tests_lh/test_files/CEx/CEx2.hs | haskell | @ LIQUID "--short-names" @
@ LIQUID "--no-termination" @
@ LIQUID "--prune-unsorted" @
@ die :: {v:String | false} -> a @
@ invariant {v:List a | 0 <= size v} @
@ collapse :: (v -> v -> v) -> m:(M.Map k {l : (List v) | false}) -> (M.Map k v) @ |
module CEx2 where
import Prelude hiding (length, replicate, foldr, foldr1, map, concat, zipWith, repeat)
import qualified Data.Map as M
infixr 9 :+:
map :: (a -> b) -> List a -> List b
concat :: List (List a) -> List a
die str = error ("Oops, I died!" ++ str)
data List a = Emp
| (:+:) a (Lis... |
66a790c9ea65b375ec1d786b7c9b6a3f4bc27cee2e061c2ff007b0885d2e7387 | dharmatech/abstracting | source.scm |
(define (gro-obj underlying-size)
(let ((underlying (vec-of-len underlying-size))
(size 0))
(let ((message-handler
(lambda (msg)
(case msg
((len) size)
;; ((ref)
;; (lambda (i)
;; (cond
;; ((>= i size)
;; (assertion-violation #f "Insid... | null | https://raw.githubusercontent.com/dharmatech/abstracting/9dc5d9f45a9de03c6ee379f1928ebb393dfafc52/src/gro/source.scm | scheme | ((ref)
(lambda (i)
(cond
((>= i size)
(assertion-violation #f "Inside gro object: (>= i size)"))
(else
((-> underlying 'ref) i))))) |
(define (gro-obj underlying-size)
(let ((underlying (vec-of-len underlying-size))
(size 0))
(let ((message-handler
(lambda (msg)
(case msg
((len) size)
((ref)
(lambda (i)
(cond
((>= i size)
(error "Inside gro object: (>= i size)"))
(else
((-> u... |
540ef1630964c01fe8220a7a453f4cb151fe50c38d0989a54c5106d951a4dceb | mattgreen/hython | Module.hs | module Hython.Module
( load
, lookup
, LoadError (..)
)
where
import Prelude hiding (lookup)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.Loops (firstM)
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
import System.Directory (canoni... | null | https://raw.githubusercontent.com/mattgreen/hython/fcbde98e9b5a033f0d4bea73ac9914bc5e12b746/src/Hython/Module.hs | haskell | module Hython.Module
( load
, lookup
, LoadError (..)
)
where
import Prelude hiding (lookup)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.Loops (firstM)
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
import System.Directory (canoni... | |
df3d9c784eac6deeb9db5a519d43f0a4aa8d74c9d04a02d3bbda56786b062592 | iu-parfunc/lvars | Monotonic.hs | # LANGUAGE GeneralizedNewtypeDeriving #
-- | EXPERIMENTAL
-- | A restricted sub-language for writing ONLY monotonic computations.
module Monotonic
Control . . Monotonic
where
import Control.DeepSeq
import qualified Control.LVish as L
import qualified Data.LVar.IVar as I
import qualified Data.LVar.PureSet... | null | https://raw.githubusercontent.com/iu-parfunc/lvars/78e73c96a929aa75aa4f991d42b2f677849e433a/src/lvish-extra/Experimental/Monotonic.hs | haskell | | EXPERIMENTAL
| A restricted sub-language for writing ONLY monotonic computations.
------------------------------------------------------------------------------
| A value used in a monotonic computation.
| A monotonic, parallel computation with side effects.
-------------------------------------------------------... | # LANGUAGE GeneralizedNewtypeDeriving #
module Monotonic
Control . . Monotonic
where
import Control.DeepSeq
import qualified Control.LVish as L
import qualified Data.LVar.IVar as I
import qualified Data.LVar.PureSet as S
import Classes
import Data.Word
import Data.IORef
import qualified Data.Set as Se... |
555b17d5c55fa4c66a43ca9529b12f1d73550af80c06badd59323c18132a26bd | stelcodes/nuzzle | util_test.clj | (ns nuzzle.util-test
(:require
[clojure.test :refer [deftest testing is]]
[nuzzle.util :as util]))
(deftest vectorize-url
(is (= (list [:about] [] [:blog-posts :foo])
(map util/vectorize-url ["/about/" "/" "/blog-posts/foo/"]))))
(deftest stringify-url
(is (= "/blog-posts/my-hobbies/" (util/strin... | null | https://raw.githubusercontent.com/stelcodes/nuzzle/da374b035f85dfafa193f343574155566a4aed97/test/nuzzle/util_test.clj | clojure | (ns nuzzle.util-test
(:require
[clojure.test :refer [deftest testing is]]
[nuzzle.util :as util]))
(deftest vectorize-url
(is (= (list [:about] [] [:blog-posts :foo])
(map util/vectorize-url ["/about/" "/" "/blog-posts/foo/"]))))
(deftest stringify-url
(is (= "/blog-posts/my-hobbies/" (util/strin... | |
53ac4c7488b24d21fa1890c25317d552ae97af8ac26ac3367a212bf99d341e6e | ashinn/chibi-scheme | flonum.scm |
(define fl=? =)
(define fl<? <)
(define fl>? >)
(define fl<=? <=)
(define fl>=? >=)
(define flodd? odd?)
(define fleven? even?)
(define (flunordered? x y) (or (flnan? x) (flnan? y)))
(define flinteger? integer?)
(define flzero? zero?)
(define flpositive? positive?)
(define flnegative? negative?)
(define flonum exact->... | null | https://raw.githubusercontent.com/ashinn/chibi-scheme/bf225edc8e1b0e5f813aab85628d989db021e7a5/lib/srfi/144/flonum.scm | scheme |
(define fl=? =)
(define fl<? <)
(define fl>? >)
(define fl<=? <=)
(define fl>=? >=)
(define flodd? odd?)
(define fleven? even?)
(define (flunordered? x y) (or (flnan? x) (flnan? y)))
(define flinteger? integer?)
(define flzero? zero?)
(define flpositive? positive?)
(define flnegative? negative?)
(define flonum exact->... | |
fe5e75f25caf4ae4f710f3b76bf18f6eb7f14656ebe6e0024400ced719c37e67 | mirage/mirage-tcpip | sequence.mli |
* Copyright ( c ) 2010 < >
*
* 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/mirage-tcpip/edb9e7d20f53d1b54ba97ee36d793b334d5a31e4/src/tcp/sequence.mli | ocaml | a < b
a <= b
a > b
a >= b
b <= a <= c
a + b
a - b
a + 1
a - 1
the value produced by of_int 0 |
* Copyright ( c ) 2010 < >
*
* 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... |
f8d3813752658ac1a80ee0ac1942f08994682cbe524ea9613cca5e6af2639e8d | rd--/hosc | Arbitrary.hs | module Sound.Osc.Arbitrary () where
import qualified Data.ByteString.Char8 as C {- bytestring -}
import qualified Data.ByteString.Lazy as B {- bytestring -}
import Test.QuickCheck {- QuickCheck -}
import Sound.Osc {- hosc -}
import Sound.Osc.Coding.Convert {- hosc -}
-- | Avoid floating point representation/convers... | null | https://raw.githubusercontent.com/rd--/hosc/b96b0044546228efb08dd53a11c3f109edb88e6a/contrib/tests/Sound/Osc/Arbitrary.hs | haskell | bytestring
bytestring
QuickCheck
hosc
hosc
| Avoid floating point representation/conversion errors
| Geneate only ASCII strings | module Sound.Osc.Arbitrary () where
genTime :: Gen Time
genTime = ntpi_to_ntpr <$> arbitrary
genString :: Gen String
genString = map (toEnum . word8_to_int) <$> resize 128 (listOf (arbitrary `suchThat` (/= 0)))
genAscii :: Gen Ascii
genAscii = fmap C.pack genString
genMidiData :: Gen MidiData
genMidiData = do
... |
b8874fe35641c900ee96207c1261b6c312e6be79cc7e8334c318760a06bbd179 | carl-eastlund/dracula | test-library.rkt | #lang racket
(require
rackunit
racket/sandbox
racket/require
(path-up "self/require.rkt")
(path-up "self/module-path.rkt")
(cce-in sandbox))
(provide test-library)
(define dracula
(make-trusted-evaluator module-path:acl2))
(define-syntax (test-dracula stx)
(syntax-case stx ()
[(_ expr result)
... | null | https://raw.githubusercontent.com/carl-eastlund/dracula/a937f4b40463779246e3544e4021c53744a33847/test/test-library.rkt | racket | #lang racket
(require
rackunit
racket/sandbox
racket/require
(path-up "self/require.rkt")
(path-up "self/module-path.rkt")
(cce-in sandbox))
(provide test-library)
(define dracula
(make-trusted-evaluator module-path:acl2))
(define-syntax (test-dracula stx)
(syntax-case stx ()
[(_ expr result)
... | |
8a78b0231d413e47e62ebebe81e8481cfe4c7ad6b0e7b03990295852349de477 | feeley/define-library | eval.scm | (define-library (scheme eval)
(namespace "")
(export
environment
eval
))
| null | https://raw.githubusercontent.com/feeley/define-library/56a6eda7ef9248751f4cada832edf98f5c6bb469/scheme/eval/eval.scm | scheme | (define-library (scheme eval)
(namespace "")
(export
environment
eval
))
| |
43f3e10ad0f8b5605b4a9e14d9fcf932cb9d19928ef7c66402d428079e374e8a | donut/OCamURL-server | ext_option.ml |
include Core.Option
let ( =?: ) maybe fallback = match maybe with
| None -> Lazy.force fallback
| Some value -> value
let ( =!?: ) (maybe, transform) fallback = match maybe with
| None -> Lazy.force fallback
| Some value -> transform value | null | https://raw.githubusercontent.com/donut/OCamURL-server/87738c1a0bbfc2c848f9f4e2052cacc81a176489/lib/common/ext_option.ml | ocaml |
include Core.Option
let ( =?: ) maybe fallback = match maybe with
| None -> Lazy.force fallback
| Some value -> value
let ( =!?: ) (maybe, transform) fallback = match maybe with
| None -> Lazy.force fallback
| Some value -> transform value | |
9877e5b86ab572839c18b1bcf002d223459c3705244217f9d956271f95d485f7 | erlangonrails/devdb | rm_beh.erl | 2008 - 2010 fuer Informationstechnik Berlin
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 to in writing,... | null | https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/scalaris/src/rm_beh.erl | erlang | 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 gov... | 2008 - 2010 fuer Informationstechnik Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
@version $ I d : rm_beh.erl 953 2010 - 08 - 03 13:52:39Z $
-module(rm_beh).
-author('').
-vsn('$Id... |
4f04f45f0e651800b7044de79a4e0ea539150dc20101d5127fbc796c446da064 | pflanze/chj-schemelib | cj-c-errno_Cpart.scm | Copyright 2013 - 2017 by < >
;;; This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
;;; (at your option) any later version.
(require)
(... | null | https://raw.githubusercontent.com/pflanze/chj-schemelib/59ff8476e39f207c2f1d807cfc9670581c8cedd3/posix/cj-c-errno_Cpart.scm | scheme | This file is free software; you can redistribute it and/or modify
(at your option) any later version.
(declare (fixnum)
(not safe))
| Copyright 2013 - 2017 by < >
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
(require)
(include "../cj-standarddeclares.scm")
(c-declare "
#include <unistd.h>
#include <errno.h>
#include <string.h>
#in... |
d0cf9fb6a337c4f89904eae526b9eb170ef7247d08e4378629b5c06662705961 | jeaye/orchestra | test.cljs | (ns orchestra-cljs.test
(:require [doo.runner :refer-macros [doo-tests]]
orchestra.core-test
orchestra.expound-test
orchestra.many-fns))
(doo-tests 'orchestra.core-test
'orchestra.expound-test
'orchestra.many-fns)
| null | https://raw.githubusercontent.com/jeaye/orchestra/81e5181f7b42e5e2763a2b37db17954f3be0314e/test/cljs/orchestra_cljs/test.cljs | clojure | (ns orchestra-cljs.test
(:require [doo.runner :refer-macros [doo-tests]]
orchestra.core-test
orchestra.expound-test
orchestra.many-fns))
(doo-tests 'orchestra.core-test
'orchestra.expound-test
'orchestra.many-fns)
| |
0019114bd157959286dd3e10ebdcbf0147bf96753f5e32eb245edc4c37687d6a | ilevd/ns-sort | project.clj | (defproject ns-sort "1.0.3"
:description "Sort :require block in Clojure namespaces"
:url "-sort"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "-2.0/"}
:eval-in-leiningen true)
| null | https://raw.githubusercontent.com/ilevd/ns-sort/f17cd948655bce4bbaaefb39785ff6b953ee8108/project.clj | clojure | (defproject ns-sort "1.0.3"
:description "Sort :require block in Clojure namespaces"
:url "-sort"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "-2.0/"}
:eval-in-leiningen true)
| |
befbf7390db292cdd008947082cb39d0d7db754e22a9f30a4ee535206d83f799 | thephoeron/bit-smasher | packages.lisp | ;;;; src/packages.lisp
Copyright ( c ) 2014 - -2022 , " the Phoeron " < >
;;;; See LICENSE for additional information.
(in-package :cl-user)
(defpackage #:bit-smasher
(:nicknames #:bitsmash)
(:use :cl :cl-user)
(:shadowing-import-from :cl-user #:null)
(:export #:hex<- #:hex->bits #:hex->octets #:hex->i... | null | https://raw.githubusercontent.com/thephoeron/bit-smasher/803f3f570e2116d70e4ec47b662d983dddfbc7ea/src/packages.lisp | lisp | src/packages.lisp
See LICENSE for additional information. |
Copyright ( c ) 2014 - -2022 , " the Phoeron " < >
(in-package :cl-user)
(defpackage #:bit-smasher
(:nicknames #:bitsmash)
(:use :cl :cl-user)
(:shadowing-import-from :cl-user #:null)
(:export #:hex<- #:hex->bits #:hex->octets #:hex->int
#:octets<- #:octets->hex #:octets->bits #:octets->int
... |
a771b0b22dbb717f30a9831f8c6630a730c29010828193e2838c475b10b0e2cf | yetanalytics/flint | protocol.cljc | (ns com.yetanalytics.flint.axiom.protocol)
We want to keep IRI and PrefixedIRI as seprate protocols since we want
them to be distinguished with different tags in the AST , for the sake
;; of prefix validation.
(defprotocol IRI
"A SPARQL full IRI (e.g. `<>`)."
(-valid-iri? [this]
"Return `true` if `this` i... | null | https://raw.githubusercontent.com/yetanalytics/flint/b0a2530582e04f5592869b0152b846864c283d77/src/main/com/yetanalytics/flint/axiom/protocol.cljc | clojure | of prefix validation. | (ns com.yetanalytics.flint.axiom.protocol)
We want to keep IRI and PrefixedIRI as seprate protocols since we want
them to be distinguished with different tags in the AST , for the sake
(defprotocol IRI
"A SPARQL full IRI (e.g. `<>`)."
(-valid-iri? [this]
"Return `true` if `this` is a valid full IRI of its... |
2f6af8eebfeb407eb1b8f8963fe192d66442823ed7a0849492520ca8673a8ea5 | Dasudian/DSDIN | dsdcore_sup.erl | %%% -*- erlang-indent-level:4; indent-tabs-mode: nil -*-
%%%=============================================================================
2018 , Dasudian Technologies
%%% @doc
%%% Supervisor for the core application
%%%
%%% Full supervision tree is
%%%```
%%% dsdcore_sup (one_for_one)
%%% |
%%% ... | null | https://raw.githubusercontent.com/Dasudian/DSDIN/b27a437d8deecae68613604fffcbb9804a6f1729/apps/dsdcore/src/dsdcore_sup.erl | erlang | -*- erlang-indent-level:4; indent-tabs-mode: nil -*-
=============================================================================
@doc
Supervisor for the core application
Full supervision tree is
```
dsdcore_sup (one_for_one)
|
--------------------------------------------------
... | 2018 , Dasudian Technologies
dsdc_peer_connection_sup dsdc_peers dsdc_sync dsdc_connection_listener
-module(dsdcore_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-include("blocks.hrl").
-define(SERVER, ?MODULE).
-define(CHILD(Mod,N,Type), {Mod,{Mod,start_link,[]},permanen... |
7d1626ee52cd65dab0f247a7931bd36211dd9649f4327634e364995c6f326347 | expipiplus1/vulkan | Preserve.hs | module Render.Type.Preserve where
import Language.Haskell.TH ( Name
, Type
)
data Preserve
= DoNotPreserve
-- ^ Use more idiomatic haskell types
| DoPreserve
^ Use the types from Foreign . C.T... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/b1e33d1031779b4740c279c68879d05aee371659/generate-new/src/Render/Type/Preserve.hs | haskell | ^ Use more idiomatic haskell types
^ A variable is applied to the extensible struct
Inheriting types are represented just by a var
^ A hole is applied to extensible structs
Inheriting structs are just left as holes | module Render.Type.Preserve where
import Language.Haskell.TH ( Name
, Type
)
data Preserve
= DoNotPreserve
| DoPreserve
^ Use the types from Foreign . C.Types
| DoLower
^ Use the types from Fo... |
50141623b60857a74b4a48b47baec2f0f8f464d21401e3333e1ed8b8cbf7dc81 | alaricsp/chicken-scheme | ec.scm | (module ec (do-ec do-ec:do :do :let :parallel
:parallel-1 :while :while-1 :while-2
:until :until-1 :list :string
(:vector ec-:vector-filter)
:integers :range
:real-range :char-range :port :dispatched
:generator-proc dispatch-union
make-initial-:-dispatch
(: :-di... | null | https://raw.githubusercontent.com/alaricsp/chicken-scheme/1eb14684c26b7c2250ca9b944c6b671cb62cafbc/tests/ec.scm | scheme | <PLAINTEXT>
Eager Comprehensions in [outer..inner|expr]-Convention
======================================================
Scheme R5RS (incl. macros), SRFI-23 (error).
,open srfi-23
,load ec.scm
; File > Open ... "ec.scm", click Execute
(require 'macro) (require 'record)
(load "ec.scm")
Implem... | (module ec (do-ec do-ec:do :do :let :parallel
:parallel-1 :while :while-1 :while-2
:until :until-1 :list :string
(:vector ec-:vector-filter)
:integers :range
:real-range :char-range :port :dispatched
:generator-proc dispatch-union
make-initial-:-dispatch
(: :-di... |
140b5173113bbf5292b578f0759c8a38f47cc8b70751ed8d4c13892346fa48e4 | srfoster/codespells | demo-aether.rkt | #lang at-exp racket
(provide demo-aether
setup-demo-aether
demo-aether-lang
teleport)
(require codespells-server/lang
codespells-server/unreal-js/unreal-client
)
(define (teleport)
(unreal-eval-js @~a{functions.teleport({X: @(current-x),Y:@(current-z),Z:@(current-y)})})... | null | https://raw.githubusercontent.com/srfoster/codespells/82c99d81611288b9ae92e5e290951e2a69bec869/demo-aether.rkt | racket |
(if (running-as-multiplayer-server?)
Start the server with the appropriate Runes -- Just the teleport rune for now | #lang at-exp racket
(provide demo-aether
setup-demo-aether
demo-aether-lang
teleport)
(require codespells-server/lang
codespells-server/unreal-js/unreal-client
)
(define (teleport)
(unreal-eval-js @~a{functions.teleport({X: @(current-x),Y:@(current-z),Z:@(current-y)})})... |
535969f6b9d4210760bcead2fb2441befe47b475851c7a43426d7372893e439c | valerauko/kitsune-alpha | user.clj | (ns kitsune.federators.user
(:require [kitsune.federators.core :as fed]
[kitsune.db.core :refer [conn]]
[kitsune.db.user :as db]
[clojure.tools.logging :as log]
[jsonista.core :as json]))
(defn refetch-profile
"Goes out to fetch a remote user's data based on their ur... | null | https://raw.githubusercontent.com/valerauko/kitsune-alpha/34ca08e4013541aeaf1a5a5786f3189ff17c1a58/src/kitsune/federators/user.clj | clojure | if the user is local don't update
if refetching failed return the current known data | (ns kitsune.federators.user
(:require [kitsune.federators.core :as fed]
[kitsune.db.core :refer [conn]]
[kitsune.db.user :as db]
[clojure.tools.logging :as log]
[jsonista.core :as json]))
(defn refetch-profile
"Goes out to fetch a remote user's data based on their ur... |
efb4895c0a263a3032fa4337cf0cdadeef99fa0295a24ab38c686ba2da241ca7 | 8c6794b6/haskell-sc-scratch | Additive01.hs | ------------------------------------------------------------------------------
Etude of additive synthesis .
--
module Etude.Additive01 where
import Control.Applicative
import Control.Concurrent
import Control.Monad
import Data.List
(sort,
zipWith4,
zipWith5)
import System.Random
import Sound.OpenS... | null | https://raw.githubusercontent.com/8c6794b6/haskell-sc-scratch/22de2199359fa56f256b544609cd6513b5e40f43/Etude/old/Additive01.hs | haskell | ----------------------------------------------------------------------------
Note of pitches.
[35,47,52,56,59,64]
[36,48,52,55,60,64]
x-x-xxx- x-xxx- | Etude of additive synthesis .
module Etude.Additive01 where
import Control.Applicative
import Control.Concurrent
import Control.Monad
import Data.List
(sort,
zipWith4,
zipWith5)
import System.Random
import Sound.OpenSoundControl
import Sound.SC3
import SCQuery
import SCTree
import SCSched
import R... |
4d8dd1b373fd12a18229c0feb9174ef8bdd5fdd794eb3c8f8e358691d07a9b3c | zotonic/zotonic | filter_urlize.erl | @author < >
2010
%% @doc 'urlize' filter, find urls and make them clickable.
Copyright 2010
%%
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
%%
%% ... | null | https://raw.githubusercontent.com/zotonic/zotonic/852f627c28adf6e5212e8ad5383d4af3a2f25e3f/apps/zotonic_mod_base/src/filters/filter_urlize.erl | erlang | @doc 'urlize' filter, find urls and make them clickable.
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.... | @author < >
2010
Copyright 2010
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(filter_urlize).
-export([urlize/2]).
urlize(undefined, _Context) ->
undefined;
urlize({trans, _} = Tr, Contex... |
a3977c1a88ebc7253a16f3a01dd908d6f4ecca4e9fcdc0f735bf2af10f34cc04 | pink-gorilla/notebook | events_nrepl.cljs |
(ns pinkgorilla.notebook-ui.datafy.events-nrepl
(:require
[taoensso.timbre :refer-macros [info]]
[cljs.core.async :as async :refer [<!] :refer-macros [go]]
[re-frame.core :refer [reg-event-db dispatch]]
[cljs.tools.reader.edn :as edn]
[cljs.tagged-literals]
[pinkgorilla.nrepl.client.core :refer [op... | null | https://raw.githubusercontent.com/pink-gorilla/notebook/b01c806535f204c1c6e24c75a6619d747aba5655/src/pinkgorilla/notebook_ui/datafy/events_nrepl.cljs | clojure | 'js (with-meta identity {:punk/literal-tag 'js})
_ (info "nrepl run-op result: " r)
tap
nav |
(ns pinkgorilla.notebook-ui.datafy.events-nrepl
(:require
[taoensso.timbre :refer-macros [info]]
[cljs.core.async :as async :refer [<!] :refer-macros [go]]
[re-frame.core :refer [reg-event-db dispatch]]
[cljs.tools.reader.edn :as edn]
[cljs.tagged-literals]
[pinkgorilla.nrepl.client.core :refer [op... |
053882403e3a9405abfe4ef6828b0b5a757e40fc7530caa6ef7a037227c85b2f | axelarge/advent-of-code | day04.clj | (ns advent-of-code.y2018.day04
(:require [advent-of-code.support :refer :all]
[clojure.string :as str]))
(def test-input
(str "[1518-11-01 00:00] Guard #10 begins shift\n"
"[1518-11-01 00:05] falls asleep\n"
"[1518-11-01 00:25] wakes up\n"
"[1518-11-01 00:30] falls asleep\n"
... | null | https://raw.githubusercontent.com/axelarge/advent-of-code/4c62a53ef71605780a22cf8219029453d8e1b977/src/advent_of_code/y2018/day04.clj | clojure | (ns advent-of-code.y2018.day04
(:require [advent-of-code.support :refer :all]
[clojure.string :as str]))
(def test-input
(str "[1518-11-01 00:00] Guard #10 begins shift\n"
"[1518-11-01 00:05] falls asleep\n"
"[1518-11-01 00:25] wakes up\n"
"[1518-11-01 00:30] falls asleep\n"
... | |
bfe012c0963d2c4a2b9441e9e168938cf8ffeb2e553f3e3a3cd3677c70906a58 | soegaard/remacs | canvas.rkt | #lang racket/base
(provide canvas-dimensions)
;;;
CANVAS
;;;
(require racket/class)
(define (canvas-dimensions c)
(define dc (send c get-dc))
(define xmin 0)
(define xmax (send c get-width))
(define ymin 0)
(define ymax (send c get-height))
(values xmin xmax ymin ymax))
| null | https://raw.githubusercontent.com/soegaard/remacs/8681b3acfe93335e2bc2133c6f144af9e0a1289e/canvas.rkt | racket | #lang racket/base
(provide canvas-dimensions)
CANVAS
(require racket/class)
(define (canvas-dimensions c)
(define dc (send c get-dc))
(define xmin 0)
(define xmax (send c get-width))
(define ymin 0)
(define ymax (send c get-height))
(values xmin xmax ymin ymax))
| |
03be823197bce1773425ae640b3a3c69aa7e162b7490abbcd362b333cb2e39a7 | mzp/scheme-abc | lispTest.ml | open Base
open OUnit
open Lisp
open Ast
open AstUtil
open Node
let expr xs =
[`Expr xs]
let parse_string str =
let stream =
Node.of_string str in
let stream' =
Stream.from (fun _ -> try
Some (Node.ghost @@ Node.value @@ Stream.next stream)
with Stream.Failure ->
None) in
Lisp.pars... | null | https://raw.githubusercontent.com/mzp/scheme-abc/2cb541159bcc32ae4d033793dea6e6828566d503/scm/parser/lispTest.ml | ocaml | open Base
open OUnit
open Lisp
open Ast
open AstUtil
open Node
let expr xs =
[`Expr xs]
let parse_string str =
let stream =
Node.of_string str in
let stream' =
Stream.from (fun _ -> try
Some (Node.ghost @@ Node.value @@ Stream.next stream)
with Stream.Failure ->
None) in
Lisp.pars... | |
c13bb9bc61334a8f2fc4d2d89ee1a966b85ac768622669358690f01419dd79be | maybevoid/casimir | Free.hs | # LANGUAGE DerivingStrategies #
# LANGUAGE StandaloneDeriving #
module Casimir.Free.Monad.Free
( FreeMonad (..)
)
where
import Control.Monad.Trans.Free
import Control.Monad.Trans.Class (lift)
import Casimir.Base
import Casimir.Free.CoOp
import Casimir.Free.FreeOps
import Casimir.Free.FreeEff
newtype FreeMonad o... | null | https://raw.githubusercontent.com/maybevoid/casimir/ebbfa403739d6f258e6ac6793549006a0e8bff42/casimir/src/lib/Casimir/Free/Monad/Free.hs | haskell | # LANGUAGE DerivingStrategies #
# LANGUAGE StandaloneDeriving #
module Casimir.Free.Monad.Free
( FreeMonad (..)
)
where
import Control.Monad.Trans.Free
import Control.Monad.Trans.Class (lift)
import Casimir.Base
import Casimir.Free.CoOp
import Casimir.Free.FreeOps
import Casimir.Free.FreeEff
newtype FreeMonad o... | |
75882e83796cff5dc1d94df5c80862a1961f1817bff82b99d72dc6e395dbc8b9 | fold-lang/fold | test_pratt_peg.ml |
module C = Colors
open Pure
open Base
open Fold
open Fold.Lex
module Pratt = Pratt.Make(Syntax)
module Grammar = Pratt.Grammar
open Pratt
let grammar =
Grammar.init
~atom:(fun x -> singleton (x :> Syntax.t))
~form:(fun x -> Lang.default_operator x or lazy (Lang.juxtaposition x))
()
|> between "(... | null | https://raw.githubusercontent.com/fold-lang/fold/78720f6295aa1fc99e18d853f8f1576b974e707f/tests/test_pratt_peg.ml | ocaml | Grammar.dump grammar; |
module C = Colors
open Pure
open Base
open Fold
open Fold.Lex
module Pratt = Pratt.Make(Syntax)
module Grammar = Pratt.Grammar
open Pratt
let grammar =
Grammar.init
~atom:(fun x -> singleton (x :> Syntax.t))
~form:(fun x -> Lang.default_operator x or lazy (Lang.juxtaposition x))
()
|> between "(... |
a517ed9e64a00f76c9777f7caeb3b85f39fcc2d8cf6dcbe7f4e72334803a223c | shirok/Gauche-makiki | post.scm | #!/usr/bin/env gosh
;;
;; Sample web server to handle post request.
Run it in the top source directory of Gauche - makiki .
;;
(add-load-path ".." :relative)
(use gauche.threads)
(use gauche.parseopt)
(use srfi-1)
(use makiki)
(define (main args)
(let-args (cdr args) ([port "p|port=i" 8012])
(start-http-ser... | null | https://raw.githubusercontent.com/shirok/Gauche-makiki/b982cf2846d04b7eb68eecc8d84ab2ac4fdf19fe/examples/post.scm | scheme |
Sample web server to handle post request.
Local variables:
mode: scheme
end: | #!/usr/bin/env gosh
Run it in the top source directory of Gauche - makiki .
(add-load-path ".." :relative)
(use gauche.threads)
(use gauche.parseopt)
(use srfi-1)
(use makiki)
(define (main args)
(let-args (cdr args) ([port "p|port=i" 8012])
(start-http-server :access-log #t :error-log #t :port port))
0)
... |
2d92b52642ee37cd69314727a9b62234dca65a4011f87c10a65613f09f0bcf97 | Chattered/ocaml-monad | lazyList.ml | Lazy lists do not have the same support in Ocaml as in Haskell . The folds
are eager , as are functions implemented in terms of folds . The concat
function is documented as lazy but the outer list is eagerly evaluated ,
meaning that
concat ( from ( fun ( ) - > singleton 1 ) )
will not term... | null | https://raw.githubusercontent.com/Chattered/ocaml-monad/2d6d1f2d443ddd517aef51d40e5cd068f456c235/src/lazyList.ml | ocaml | Lazy lists do not have the same support in Ocaml as in Haskell . The folds
are eager , as are functions implemented in terms of folds . The concat
function is documented as lazy but the outer list is eagerly evaluated ,
meaning that
concat ( from ( fun ( ) - > singleton 1 ) )
will not term... | |
f917467100e605d4f50d1da9b81d9fd1a7ab0e542be64a43df32c5073ea59ebc | aryx/xix | wm.mli |
(* main wm actions *)
val new_win:
Image.t -> string -> string array -> Common.filename option ->
(Mouse.ctl * Fileserver.t * Font.t) ->
unit
val close_win:
Window.t -> unit
(* (those actions used to have a mouse parameter to also update the cursor) *)
val hide_win:
Window.t -> unit
val show_win:
Window... | null | https://raw.githubusercontent.com/aryx/xix/60ce1bd9a3f923e0e8bb2192f8938a9aa49c739c/windows/wm.mli | ocaml | main wm actions
(those actions used to have a mouse parameter to also update the cursor)
helpers for borders
this also used to have a mouse parameter (should be renamed then
* set_current_and_repaint_borders_content_and_cursor)
helpers for cursors |
val new_win:
Image.t -> string -> string array -> Common.filename option ->
(Mouse.ctl * Fileserver.t * Font.t) ->
unit
val close_win:
Window.t -> unit
val hide_win:
Window.t -> unit
val show_win:
Window.t -> Baselayer.t -> unit
val top_win:
Window.t -> unit
val resize_win:
Window.t -> Image.t -> ... |
043ea449d90454d929a6ed3f0b5ad8ca2a3a874141bd8695f368ac99b41e816f | imandra-ai/iex-auction-model | fill.ml | (* @meta[imandra_ignore] on @end *)
open Prelude;;
open Order;;
(* @meta[imandra_ignore] off @end *)
type fill = {
buy_id : int;
sell_id : int;
fill_qty : int;
};;
let create_fill(buy, sell) = {
buy_id = buy.order_id;
sell_id = sell.order_id;
fill_qty = min(buy.quantity, sell.quantity);
};;
| null | https://raw.githubusercontent.com/imandra-ai/iex-auction-model/41436bd1506992c69188179a330cee1e5244222b/model/fill.ml | ocaml | @meta[imandra_ignore] on @end
@meta[imandra_ignore] off @end | open Prelude;;
open Order;;
type fill = {
buy_id : int;
sell_id : int;
fill_qty : int;
};;
let create_fill(buy, sell) = {
buy_id = buy.order_id;
sell_id = sell.order_id;
fill_qty = min(buy.quantity, sell.quantity);
};;
|
ec9de3b8ec59784ce3659ac690b1e26aabcb62716f27318471a34f7d3027d38f | alvatar/spheres | markup-html.scm | ;;; The HtmlPrag test suite can be enabled by editing the source code file and
;;; loading [Testeez]; the test suite is disabled by default.
(define (%htmlprag:test)
(%htmlprag:testeez
"HtmlPrag"
(test-define "" lf (string (%htmlprag:a2c 10)))
(test/equal "" (html->shtml "<a>>") `(,shtml-top-symbol (a ">"... | null | https://raw.githubusercontent.com/alvatar/spheres/568836f234a469ef70c69f4a2d9b56d41c3fc5bd/test/markup-html.scm | scheme | The HtmlPrag test suite can be enabled by editing the source code file and
loading [Testeez]; the test suite is disabled by default.
TODO: Add verbatim-pair cases with attributes in the end tag.
TODO: Maybe lose this test.
ccc'ddd\" />")
TODO: Write more test cases for HTML encoding.
TODO: Write test cases for fo... |
(define (%htmlprag:test)
(%htmlprag:testeez
"HtmlPrag"
(test-define "" lf (string (%htmlprag:a2c 10)))
(test/equal "" (html->shtml "<a>>") `(,shtml-top-symbol (a ">")))
(test/equal "" (html->shtml "<a<>") `(,shtml-top-symbol (a "<" ">")))
(test/equal "" (html->shtml "<>") `(,shtml-top-symbol "... |
3f4cee8d16667d3ae961f959f8e53795e984447b7d2177695300e4c390c54913 | monadfix/ormolu-live | Digraph.hs | ( c ) The University of Glasgow 2006
# LANGUAGE CPP , ScopedTypeVariables , ViewPatterns #
# LANGUAGE GeneralizedNewtypeDeriving #
module Digraph(
Graph, graphFromEdgedVerticesOrd, graphFromEdgedVerticesUniq,
SCC(..), Node(..), flattenSCC, flattenSCCs,
stronglyConnCompG,
topological... | null | https://raw.githubusercontent.com/monadfix/ormolu-live/d8ae72ef168b98a8d179d642f70352c88b3ac226/ghc-lib-parser-8.10.1.20200412/compiler/utils/Digraph.hs | haskell | Simple way to classify edges
----------------------------------------------------------------------------
A version of the graph algorithms described in:
Also included is some additional code for printing tree structures ...
If you ever find yourself in need of algorithms for classifying edges,
-----------------... | ( c ) The University of Glasgow 2006
# LANGUAGE CPP , ScopedTypeVariables , ViewPatterns #
# LANGUAGE GeneralizedNewtypeDeriving #
module Digraph(
Graph, graphFromEdgedVerticesOrd, graphFromEdgedVerticesUniq,
SCC(..), Node(..), flattenSCC, flattenSCCs,
stronglyConnCompG,
topological... |
2b8d939661b7ae2381befda7067f909de39210798ccdb1c9a9755646b052a0e4 | DaMSL/K3 | Common.hs | {-# LANGUAGE GADTs #-}
module Language.K3.TypeSystem.Simplification.Common
( SimplificationConfig(..)
, SimplificationResult(..)
, VariableSubstitution
, substitutionLookup
, substitutionLookupAny
, prettySubstitution
, Simplifier
, SimplifyM
, tellSubstitution
, runSimplifyM
, runConfigSimplifyM
) where
import Contr... | null | https://raw.githubusercontent.com/DaMSL/K3/51749157844e76ae79dba619116fc5ad9d685643/src/Language/K3/TypeSystem/Simplification/Common.hs | haskell | # LANGUAGE GADTs #
|The record used to configure common properties of the simplification
present by the completion of the simplification process.
|The data type used to describe the result of simplification.
TODO: consider moving this to somewhere more general
|A type for the description of variable substitution.... |
module Language.K3.TypeSystem.Simplification.Common
( SimplificationConfig(..)
, SimplificationResult(..)
, VariableSubstitution
, substitutionLookup
, substitutionLookupAny
, prettySubstitution
, Simplifier
, SimplifyM
, tellSubstitution
, runSimplifyM
, runConfigSimplifyM
) where
import Control.Monad.Reader
import ... |
dfc2492babb9e47faecf0ffba3a8870d960c0d1b90382e06851186790aa71264 | scarvalhojr/haskellbook | section28.4-3.hs |
incdInts :: [Integer] -> [Integer]
incdInts = map (+1)
-- Compile with:
ghc -prof -fprof - auto -rtsopts -O2 section28.4-3.hs
-- Run with:
-- ./section28.4-3 +RTS -hc -p
-- Produce heap usage graph with:
-- hp2ps section28.4-3.hp
main :: IO ()
main = do
print (incdInts [1..] !! 1000)
print (incdInts [1..... | null | https://raw.githubusercontent.com/scarvalhojr/haskellbook/6016a5a78da3fc4a29f5ea68b239563895c448d5/chapter28/section28.4-3.hs | haskell | Compile with:
Run with:
./section28.4-3 +RTS -hc -p
Produce heap usage graph with:
hp2ps section28.4-3.hp |
incdInts :: [Integer] -> [Integer]
incdInts = map (+1)
ghc -prof -fprof - auto -rtsopts -O2 section28.4-3.hs
main :: IO ()
main = do
print (incdInts [1..] !! 1000)
print (incdInts [1..] !! 9001)
print (incdInts [1..] !! 90010)
print (incdInts [1..] !! 9001000)
print (incdInts [1..] !! 9501000)
print ... |
a3016a6e224d171b6e38145578cba137ef6ec5c404971ef68638c3db12844c55 | herbelin/coq-hh | pretype_errors.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/herbelin/coq-hh/296d03d5049fea661e8bdbaf305ed4bf6d2001d2/pretyping/pretype_errors.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
Old Case
Pretyping
This simplif... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Compat
open Util
open Na... |
f5a9e6546527c139159e3811b08da433b66c40663fba8933a42546dc7d0d27e8 | cabol/dberl | multilayer_sup.erl | -module(multilayer_sup).
-behaviour(supervisor).
%% API
-export([start_link/0]).
%% Supervisor callbacks
-export([init/1]).
%% Helper macro for declaring children of supervisor
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
%%%========================================================... | null | https://raw.githubusercontent.com/cabol/dberl/8de9a9ee81a8fa5454fe961237b619563c91bf5d/examples/multilayer/src/multilayer_sup.erl | erlang | API
Supervisor callbacks
Helper macro for declaring children of supervisor
===================================================================
API
===================================================================
===================================================================
Supervisor callbacks
===========... | -module(multilayer_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
-spec start_link() -> supervisor:startlink_ret().
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
@private
init([]... |
3b3e7d222aeee18362d5235bd2206be628fc25a08270dc4f1d49cd17510ceac5 | typelead/eta | tcfail093.hs | # LANGUAGE MultiParamTypeClasses , FunctionalDependencies ,
FlexibleInstances , UndecidableInstances , FlexibleContexts #
FlexibleInstances, UndecidableInstances, FlexibleContexts #-}
UndecidableInstances now needed because the Coverage Condition fails
module ShouldFail where
-- A stripp... | null | https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/tests/suite/typecheck/compile/tcfail093.hs | haskell | A stripped down functional-dependency
See Note [Important subtlety in oclose] in FunDeps
call :: Call c h => c -> h
call primDup :: {Call (Int -> IO Int) h} => h with
call primDup :: {Call (IO Int) h'} => Int -> h'
The functional dependency means that h must be constant
Hence program is reject... | # LANGUAGE MultiParamTypeClasses , FunctionalDependencies ,
FlexibleInstances , UndecidableInstances , FlexibleContexts #
FlexibleInstances, UndecidableInstances, FlexibleContexts #-}
UndecidableInstances now needed because the Coverage Condition fails
module ShouldFail where
example t... |
e36dec9af8b26dfdab710e7c3f4da09d7985b03a5ff35a877f27304a07a27a77 | triffon/fp-2021-22 | ex00-20211008-solutions.rkt | #lang racket
(+ (/ (+ 3 5) 2)
(sqrt (- (expt 4 3) (* 7 (expt 2 2)))))
(/ (+ 5 (/ 1 4) (- 2 (- 3 (+ 6 (/ 1 5)))))
(* 3 (- 6 2) (- 2 7)))
(/ (+ 15 21 (/ 3 15) (- 7 (* 2 2)))
16)
(define (less-than-5? x)
(< x 5))
(define (f1 x y)
(if (< y 0)
(and (>= y -2) (<= (abs x) 1))
(<= (sqrt (+ (* x x)... | null | https://raw.githubusercontent.com/triffon/fp-2021-22/33cfdb918812aeb1dddc6a9c6d67857fa86ca532/exercises/5/ex00-20211008-solutions.rkt | racket | #lang racket
(+ (/ (+ 3 5) 2)
(sqrt (- (expt 4 3) (* 7 (expt 2 2)))))
(/ (+ 5 (/ 1 4) (- 2 (- 3 (+ 6 (/ 1 5)))))
(* 3 (- 6 2) (- 2 7)))
(/ (+ 15 21 (/ 3 15) (- 7 (* 2 2)))
16)
(define (less-than-5? x)
(< x 5))
(define (f1 x y)
(if (< y 0)
(and (>= y -2) (<= (abs x) 1))
(<= (sqrt (+ (* x x)... | |
d2a7b65d64caf8b19e8dbc185becbde2e614a692665910ae3ade6939483523bc | dQuadrant/kuber | ChainInfoUtil.hs | # LANGUAGE ScopedTypeVariables #
module Cardano.Kuber.Utility.ChainInfoUtil where
import Cardano.Kuber.Core.ChainInfo ( ChainConnectInfo(..) )
import Cardano.Api (NetworkId(Mainnet, Testnet), NetworkMagic (NetworkMagic), LocalNodeConnectInfo (LocalNodeConnectInfo), CardanoMode, ConsensusModeParams (CardanoModeParams), ... | null | https://raw.githubusercontent.com/dQuadrant/kuber/d542807f5338e42f256d7c74851364398d7e9eac/src/Cardano/Kuber/Utility/ChainInfoUtil.hs | haskell | type wrapper for EnvironmentVariable String
If CARDANO_NODE_SOCKET_PATH environment variable is set, the socket path is set to it's value
If CARDANO_NODE_SOCKET_PATH environment variable is set, the socket path is set to it's value
If CARDANO_NODE_SOCKET_PATH environment variable is set, the socket path is set t... | # LANGUAGE ScopedTypeVariables #
module Cardano.Kuber.Utility.ChainInfoUtil where
import Cardano.Kuber.Core.ChainInfo ( ChainConnectInfo(..) )
import Cardano.Api (NetworkId(Mainnet, Testnet), NetworkMagic (NetworkMagic), LocalNodeConnectInfo (LocalNodeConnectInfo), CardanoMode, ConsensusModeParams (CardanoModeParams), ... |
421903250042d5a04ca5bafcc1011c61f5f46cba074c012f41ed41d682a5f174 | zadean/xqerl | prod_ConstructionDecl_schema_SUITE.erl | -module('prod_ConstructionDecl_schema_SUITE').
-include_lib("common_test/include/ct.hrl").
-export([
all/0,
groups/0,
suite/0
]).
-export([
init_per_suite/1,
init_per_group/2,
end_per_group/2,
end_per_suite/1
]).
-export(['Constr-compelem-constrmod-1'/1]).
-export(['Constr-compelem-const... | null | https://raw.githubusercontent.com/zadean/xqerl/1a94833e996435495922346010ce918b4b0717f2/test/prod/prod_ConstructionDecl_schema_SUITE.erl | erlang | -module('prod_ConstructionDecl_schema_SUITE').
-include_lib("common_test/include/ct.hrl").
-export([
all/0,
groups/0,
suite/0
]).
-export([
init_per_suite/1,
init_per_group/2,
end_per_group/2,
end_per_suite/1
]).
-export(['Constr-compelem-constrmod-1'/1]).
-export(['Constr-compelem-const... | |
4bce309f89ef0a9c902bbbcb190dada70ea1ae155a22a20708c134d45e7ddf44 | ucsd-progsys/nate | ezyDynload.ml | module type S = sig
val kind : string
val meta_file : string
val module_name : string
val find : string -> string
val reset : unit -> unit
type result
val get : unit -> result option
end
module LangLevel = struct
type result = (EzyFeatures.program_feats * (string * bool) list * string list)
let confi... | null | https://raw.githubusercontent.com/ucsd-progsys/nate/8b1267cd8b10283d8bc239d16a28c654a4cb8942/eval/sherrloc/easyocaml%2B%2B/easyocaml/ezyDynload.ml | ocaml | module type S = sig
val kind : string
val meta_file : string
val module_name : string
val find : string -> string
val reset : unit -> unit
type result
val get : unit -> result option
end
module LangLevel = struct
type result = (EzyFeatures.program_feats * (string * bool) list * string list)
let confi... | |
407efd952318e6ab761df80fb902b1748054d5b7388979db38963fc9e136283f | ocamllabs/ocaml-modular-implicits | t164-apply3.ml | open Lib;;
let f _ _ _ = 0 in f 0 0 0;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9 BRANCH 17
11 RESTART
12 GRAB 2
14 CONST0
15 RETURN 3
17 CLOSURE 0 , 12
20 PUSHCONST0
21 PUSHCONST0
22 PUS... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/tool-ocaml/t164-apply3.ml | ocaml | open Lib;;
let f _ _ _ = 0 in f 0 0 0;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9 BRANCH 17
11 RESTART
12 GRAB 2
14 CONST0
15 RETURN 3
17 CLOSURE 0 , 12
20 PUSHCONST0
21 PUSHCONST0
22 PUS... | |
d2fa104027f25caab5e8fd3d25b8765578445b65c218243f3b79e545157f2596 | heraldry/heraldicon | component.cljs | (ns heraldicon.heraldry.component
(:require
[clojure.string :as str]))
(defn effective-type [raw-type]
(when (some-> raw-type
str
(str/starts-with? ":heraldry.charge.type/"))
(derive raw-type :heraldry.charge/type))
TODO : need to limit this to heraldry . * and heraldicon .... | null | https://raw.githubusercontent.com/heraldry/heraldicon/54e003614cf2c14cda496ef36358059ba78275b0/src/heraldicon/heraldry/component.cljs | clojure | as there are types that aren't option roots or components, e.g. lines, but there
might be a better way | (ns heraldicon.heraldry.component
(:require
[clojure.string :as str]))
(defn effective-type [raw-type]
(when (some-> raw-type
str
(str/starts-with? ":heraldry.charge.type/"))
(derive raw-type :heraldry.charge/type))
TODO : need to limit this to heraldry . * and heraldicon .... |
5097214e947d667708ceb895fdf6f5bd167e8935df03b47934b3a0751794c276 | tolysz/prepare-ghcjs | Dates.hs | module Main (main) where
import Prelude ()
import Prelude.Compat
import Criterion.Main
import Data.Aeson (decode, encode)
import Data.Time.Clock (UTCTime)
import Data.Time.LocalTime (ZonedTime)
import qualified Data.ByteString.Lazy as BL
utcTime :: BL.ByteString -> Maybe [UTCTime]
utcTime = decode
zTime :: BL.ByteS... | null | https://raw.githubusercontent.com/tolysz/prepare-ghcjs/8499e14e27854a366e98f89fab0af355056cf055/spec-lts8/aeson/benchmarks/Dates.hs | haskell | module Main (main) where
import Prelude ()
import Prelude.Compat
import Criterion.Main
import Data.Aeson (decode, encode)
import Data.Time.Clock (UTCTime)
import Data.Time.LocalTime (ZonedTime)
import qualified Data.ByteString.Lazy as BL
utcTime :: BL.ByteString -> Maybe [UTCTime]
utcTime = decode
zTime :: BL.ByteS... | |
5e1e707626667d9fc8c4a52447185008a58a71030331a47115f9a3cfdbfce32e | inzva/DOH | DigitalOcean.hs | |
Module : DigitalOcean
Description : Complete API bindings for DigitalOcean API V2
Copyright : ( c ) , 2017
License : MIT
Maintainer :
Stability : beta
Portability : POSIX
Every computation within this module should be assessed via ` DO ` monad .
An example usage :
@
{ &... | null | https://raw.githubusercontent.com/inzva/DOH/2b25572e1bc33a7a79f5d7df739b269e83bb32fb/src/Network/DigitalOcean.hs | haskell | Read a public key from a key pair and create ssh keys on DigitalOcean with it
Create 2 droplets with our newly uploaded ssh keys
Take snapshot of our newly created droplets
Read a public key from a key pair and create ssh keys on DigitalOcean with it
Create 2 droplets with our newly uploaded ssh keys
Take snap... | |
Module : DigitalOcean
Description : Complete API bindings for DigitalOcean API V2
Copyright : ( c ) , 2017
License : MIT
Maintainer :
Stability : beta
Portability : POSIX
Every computation within this module should be assessed via ` DO ` monad .
An example usage :
@
{ &... |
b23d8f9dbf15e01d2d846eb724df3e27cb8ebe32fcbd7bd6e1989bd34a30a622 | miner/herbert | canonical.clj | (ns miner.herbert.canonical
(:require [miner.herbert.util :refer :all]
[miner.herbert.private :as internal]))
;; canonical form eliminates convenience syntax such as the optional keys (:kw?)
and quantifier suffixes ( str ? * )
;; :kw? ==> (? :kw)
;; int+ ==> (+ int)
;; Only empty collections use the... | null | https://raw.githubusercontent.com/miner/herbert/d09e949d0316f693bc1404a5d3b1d48d1a9a8e15/src/miner/herbert/canonical.clj | clojure | canonical form eliminates convenience syntax such as the optional keys (:kw?)
:kw? ==> (? :kw)
int+ ==> (+ int)
Only empty collections use the literal forms [] () {}.
x is symbol or keyword, typically used to strip \?
more complex than util/quantified?
test for single separately
-------------------
SEM FIXME: ... | (ns miner.herbert.canonical
(:require [miner.herbert.util :refer :all]
[miner.herbert.private :as internal]))
and quantifier suffixes ( str ? * )
Everything else is written in the list form . [ 1 2 ] = = > ( seq 1 2 )
(declare rewrite)
(defn symbol-quantifier [sym]
(let [ch (last-char sym)... |
8ae7ee98fa74d379d4233b8ddbf669ab4891fd6db4ab1064189f94391ad5cf49 | savonet/ocaml-posix | gen_types_c.ml | module Types = Posix_base.Generators.Types (struct
module Types = Posix_socket_types.Def
let c_headers =
{|
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#endif
|}
end)
let () = Types.gen ()... | null | https://raw.githubusercontent.com/savonet/ocaml-posix/d46d011de16154b34324eae6ee6e7010138cf4af/posix-socket/src/generator/gen_types_c.ml | ocaml | module Types = Posix_base.Generators.Types (struct
module Types = Posix_socket_types.Def
let c_headers =
{|
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#endif
|}
end)
let () = Types.gen ()... | |
38e2f847f3e3b057e5d99601f7dbfff18838282c59935fd1aee37129cbe13135 | gebi/jungerl | ex11_xauth.erl | -module(ex11_xauth).
-author('').
%%%---------------------------------------------------------------------
Created : 15 Feb 1999 by
%%% Function: Read all entries of the .Xauthority file.
%%% ====================================================================
The contents of this file are subject to the Erlang Pu... | null | https://raw.githubusercontent.com/gebi/jungerl/8f5c102295dbe903f47d79fd64714b7de17026ec/lib/ex11/src/ex11_xauth.erl | erlang | ---------------------------------------------------------------------
Function: Read all entries of the .Xauthority file.
====================================================================
except in compliance with the License. You may obtain a copy of the
License at
basis, WITHOUT WARRANTY OF ANY KIND, either... | -module(ex11_xauth).
-author('').
Created : 15 Feb 1999 by
The contents of this file are subject to the Erlang Public License
License , Version 1.0 , ( the " License " ) ; you may not use this file
Software distributed under the License is distributed on an " AS IS "
The Original Code is x11 - 0 - 1
The In... |
5ca6c0d92eb6e92144937b32cbc77f3d7a0706cc6560faf78c119cedcb5b1759 | soulomoon/SICP | Exercise4.18.scm | Exercise 4.18 : Consider an alternative strategy for scanning out definitions that translates the example in the text to
; (lambda ⟨vars⟩
; (let ((u '*unassigned*)
; (v '*unassigned*))
; (let ((a ⟨e1⟩)
; (b ⟨e2⟩))
; (set! u a)
; (set! v b))
; ⟨e3⟩))
Here a and b are meant to... | null | https://raw.githubusercontent.com/soulomoon/SICP/1c6cbf5ecf6397eaeb990738a938d48c193af1bb/Chapter4/Exercise4.18.scm | scheme | (lambda ⟨vars⟩
(let ((u '*unassigned*)
(v '*unassigned*))
(let ((a ⟨e1⟩)
(b ⟨e2⟩))
(set! u a)
(set! v b))
⟨e3⟩))
(define (solve f y0 dt)
(define y (integral (delay dy) y0 dt))
(define dy (stream-map f y))
y)
Will this procedure work if internal definitions are ... | Exercise 4.18 : Consider an alternative strategy for scanning out definitions that translates the example in the text to
Here a and b are meant to represent new variable names , created by the interpreter , that do not appear in the user ’s program . Consider the solve procedure from 3.5.4 :
1
as text in this ... |
14ed1ae9180dc286ee23640ebace1934352db72a7c8f87867b947ce704ee7069 | GaloisInc/argo | Main.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PartialTypeSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Main ( main ) where
import Data.ByteString (ByteString)
import qualified Options.Applicative as Opt
import qualified Argo as Argo
import qualified Argo.Doc as Doc
import Argo.Def... | null | https://raw.githubusercontent.com/GaloisInc/argo/6ca9206191197c938b9e63e4d06a65ef00092751/file-echo-api/mutable-file-echo-api/Main.hs | haskell | # LANGUAGE OverloadedStrings #
This function parses additional options used by this particular
are appended. | # LANGUAGE PartialTypeSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Main ( main ) where
import Data.ByteString (ByteString)
import qualified Options.Applicative as Opt
import qualified Argo as Argo
import qualified Argo.Doc as Doc
import Argo.DefaultMain ( customMain, userOptions ... |
720f3253ffe00dd3c2d4467a2c1ef5331a02f37a7259d094a24ca8e4d7ef5598 | norvig/paip-lisp | prologc2.lisp | ;;;; -*- Mode: Lisp; Syntax: Common-Lisp -*-
Code from Paradigms of AI Programming
Copyright ( c ) 1991
File prologc2.lisp : Version 2 of the prolog compiler ,
fixing the first set of bugs .
(requires "prolog")
(defconstant unbound "Unbound")
(defstruct var name (binding unbound))
(defun bound-p (var) (n... | null | https://raw.githubusercontent.com/norvig/paip-lisp/9d3b83bdae923299aac3132dc4d8540fd57e347f/lisp/prologc2.lisp | lisp | -*- Mode: Lisp; Syntax: Common-Lisp -*-
Compile the clauses with this arity
Compile all the clauses with any other arity
Note NAME is the raw name, not the name/arity
***
***
*** | Code from Paradigms of AI Programming
Copyright ( c ) 1991
File prologc2.lisp : Version 2 of the prolog compiler ,
fixing the first set of bugs .
(requires "prolog")
(defconstant unbound "Unbound")
(defstruct var name (binding unbound))
(defun bound-p (var) (not (eq (var-binding var) unbound)))
(defmacr... |
b4306fd613840e043e772410d65a6af0b85bb5dbd5b67c4a3e18dc54353fe4d5 | ryanpbrewster/haskell | P042.hs | module TestData.P042 (txt) where
txt =
unlines
[ "A"
, "ABILITY"
, "ABLE"
, "ABOUT"
, "ABOVE"
, "ABSENCE"
, "ABSOLUTELY"
, "ACADEMIC"
, "ACCEPT"
, "ACCESS"
, "ACCIDENT"
, "ACCOMPANY"
, "ACCORDING"
, "ACCOUNT"
, "ACHIEVE"
, "ACHIEVEMENT"
, "ACID"
, "ACQUIRE"
, "ACROSS"
, "ACT"
... | null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/project-euler/tests/TestData/P042.hs | haskell | module TestData.P042 (txt) where
txt =
unlines
[ "A"
, "ABILITY"
, "ABLE"
, "ABOUT"
, "ABOVE"
, "ABSENCE"
, "ABSOLUTELY"
, "ACADEMIC"
, "ACCEPT"
, "ACCESS"
, "ACCIDENT"
, "ACCOMPANY"
, "ACCORDING"
, "ACCOUNT"
, "ACHIEVE"
, "ACHIEVEMENT"
, "ACID"
, "ACQUIRE"
, "ACROSS"
, "ACT"
... | |
91d7181ef39c0a1b09b9a01d23af7a55180052f04a96ad72f9b67ea595392734 | TyOverby/mono | main.ml | open! Core
open! Bonsai_web
open Bonsai.Let_syntax
module Extendy = Bonsai_web_ui_extendy
let component =
let wrap_remove view remove_event =
Vdom.Node.div
[ Vdom.Node.button
~attr:(Vdom.Attr.on_click (fun _ -> remove_event))
[ Vdom.Node.text "X" ]
; view
]
in
let%sub { ... | null | https://raw.githubusercontent.com/TyOverby/mono/9f361de248f67441dd1486419ba19044b6fa4fad/app/bonsai-examples/extensible_list/main.ml | ocaml | open! Core
open! Bonsai_web
open Bonsai.Let_syntax
module Extendy = Bonsai_web_ui_extendy
let component =
let wrap_remove view remove_event =
Vdom.Node.div
[ Vdom.Node.button
~attr:(Vdom.Attr.on_click (fun _ -> remove_event))
[ Vdom.Node.text "X" ]
; view
]
in
let%sub { ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.