_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 |
|---|---|---|---|---|---|---|---|---|
0c277075e1a5e3284ff55e557afda66d080233946b5bca8c0f1d36e8fdc8c616 | lexi-lambda/racket-2htdp-typed | big-bang-wrapper.rkt | #lang racket/base
(provide big-bang*)
(require (for-syntax racket/base
racket/list
racket/function
unstable/list
racket/syntax
syntax/parse)
2htdp/universe)
;; big-bang changes behavior based on whether ... | null | https://raw.githubusercontent.com/lexi-lambda/racket-2htdp-typed/b46c957f0ad7490bc7b0f01da0e80380f34cac2d/typed/2htdp/private/big-bang-wrapper.rkt | racket | big-bang changes behavior based on whether or not clauses are present, which is inconvenient when
attempting to create a function wrapper. This automatically generates a cond form to handle all
possible cases.
wrap each condition with its true case and false case
all the possible cases (each clause-condition can b... | #lang racket/base
(provide big-bang*)
(require (for-syntax racket/base
racket/list
racket/function
unstable/list
racket/syntax
syntax/parse)
2htdp/universe)
(define-syntax (big-bang-cross-product stx)
... |
cb778cb44bb640c6fa9d51b7bacd0c2a669eeadd684e680e887ad7c54bd62099 | duncanatt/detecter | cow_qs.erl | Copyright ( c ) 2013 - 2018 , < >
%%
%% Permission to use, copy, modify, and/or 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 AUTHOR DISC... | null | https://raw.githubusercontent.com/duncanatt/detecter/95b6a758ce6c60f3b7377c07607f24d126cbdacf/experiments/coordination_2022/src/cowlib/cow_qs.erl | erlang |
Permission to use, copy, modify, and/or 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.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVE... | Copyright ( c ) 2013 - 2018 , < >
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
-module(cow_qs).
-export([parse_qs/1]).
-export([qs/... |
d714f6641849b36d3be573ad8041f070d9ca1681bda3a4f8f47c9ee56763edc2 | urbanslug/wai-devel | DevelSpec.hs | Tests for Devel.hs
module DevelSpec where
import Test.Hspec
import Devel
import Control.Concurrent
main :: IO ()
main = hspec spec
spec :: Spec
How does one test that a bottom effectful computation has done what is expected ?
describe "buildAndRun is able to successfully call build." $ do
it "Able to apply... | null | https://raw.githubusercontent.com/urbanslug/wai-devel/6d1c5dc7fe59f8aa3b88b91201e859af9f8a92a4/tests/DevelSpec.hs | haskell | Tests for Devel.hs
module DevelSpec where
import Test.Hspec
import Devel
import Control.Concurrent
main :: IO ()
main = hspec spec
spec :: Spec
How does one test that a bottom effectful computation has done what is expected ?
describe "buildAndRun is able to successfully call build." $ do
it "Able to apply... | |
689088c39a498029f021c18fcdc202d64bb55ec90cc78e7c034635aa35629582 | digikar99/polymorphic-functions | benchmark.lisp | (in-package :polymorphic-functions)
(5am:in-suite :polymorphic-functions)
(defmacro time-it (&body body)
(with-gensyms (start end body-result)
`(let (,start ,end ,body-result)
(setq ,start (get-internal-real-time))
(setq ,body-result (progn ,@body))
(setq ,end (get-internal-real-time))
... | null | https://raw.githubusercontent.com/digikar99/polymorphic-functions/ae5f5f4071aa1bd641a6fd8618d1445a96222193/src/benchmark.lisp | lisp | too slow | (in-package :polymorphic-functions)
(5am:in-suite :polymorphic-functions)
(defmacro time-it (&body body)
(with-gensyms (start end body-result)
`(let (,start ,end ,body-result)
(setq ,start (get-internal-real-time))
(setq ,body-result (progn ,@body))
(setq ,end (get-internal-real-time))
... |
41f172e5caaf9848a31ba0c6df163b528633e9a985e404deaae6da0d2873d317 | danelahman/haskell-coop | IntState.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
# LANGUAGE KindSignatures #
# LANGUAGE TypeFamilies #
|
Module : Control . Runner . IntState
Description : Runner for integer - valued global state , using effect typing to ensure that only a given footprint is accessed
Copyright ... | null | https://raw.githubusercontent.com/danelahman/haskell-coop/95ddb0f340313a25f2e006c75dab8e2c93add8f8/src/Control/Runner/IntState.hs | haskell | # LANGUAGE GADTs #
| Type of natural numbers that we use for the size of the memory.
| Type of memory addresses of a given size.
| An memory size indexed effect for reading the value stored at
a given memory address, and writing a value to a given memory address.
| Algebraic operation for reading the value stored ... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE KindSignatures #
# LANGUAGE TypeFamilies #
|
Module : Control . Runner . IntState
Description : Runner for integer - valued global state , using effect typing to ensure that only a given footprint is accessed
Copyright : ( c ) , 2019
Li... |
bd6a0c316578ab58648c697831041a6eaf716f583ad887f1fa3c4e35350d1fe4 | gsakkas/rite | 0126.ml | AppG [TupleG [EmptyG,EmptyG],AppG [EmptyG]]
(3 , 3) :: (List.rev (List.combine l1
l2))
| null | https://raw.githubusercontent.com/gsakkas/rite/958a0ad2460e15734447bc07bd181f5d35956d3b/data/sp14/clusters/0126.ml | ocaml | AppG [TupleG [EmptyG,EmptyG],AppG [EmptyG]]
(3 , 3) :: (List.rev (List.combine l1
l2))
| |
f84365892a63a6afcf1b8cbf2eee243a82337d70ab6a1701934a2064c0a72ad2 | dgiot/dgiot | prop_emqx_base62.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 2021 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/dgiot/dgiot/c9f2f78af71692ba532e4806621b611db2afe0c9/test/props/prop_emqx_base62.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 ... | Copyright ( c ) 2020 - 2021 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(prop_emqx_base62).
-include_lib("proper/include/proper.hrl").
prop_symmetric() ->
... |
be32d5b80e06ff22b6dc99db1842e148e4f4f68906463ef8ddbd4fe247ba8261 | kana/sicp | ex-3.19.scm | Exercise 3.19 . Redo exercise 3.18 using an algorithm that takes only
;;; a constant amount of space. (This requires a very clever idea.)
Circular lists like z in Exercise 3.13 have loops .
; Taking successive CDRs of circular lists never ends.
; Likewise, taking successive CDDRs of circular lists never ends too... | null | https://raw.githubusercontent.com/kana/sicp/912bda4276995492ffc2ec971618316701e196f6/ex-3.19.scm | scheme | a constant amount of space. (This requires a very clever idea.)
Taking successive CDRs of circular lists never ends.
Likewise, taking successive CDDRs of circular lists never ends too.
Once the former goes around a loop, the latter goes around the loop twice.
These "visitors" eventually visit the same pair if a li... | Exercise 3.19 . Redo exercise 3.18 using an algorithm that takes only
Circular lists like z in Exercise 3.13 have loops .
The two visitors are enought to detect cycles .
(define (circular? x)
(define (next x)
(if (pair? x)
(cdr x)
#f))
(let go ([x1 x]
[x2 (next x)])
(if (and... |
7a0132d1119d6f3d0dea883a89100ae678ae893c039d9f9335811ba3b814993e | namachan10777/scad-ml | quat_cube.ml | open Scad_ml
let quat_cube =
(* NOTE: These cubes should be equivalent if quaternion is working correctly. *)
let box = Scad.cube ~center:true (10., 10., 10.)
and angle = Float.pi /. 4.
and ax = 1., 1., 0. in
let a = Scad.vector_rotate ax angle box
and b = Scad.multmatrix Quaternion.(to_multmatrix (make ax... | null | https://raw.githubusercontent.com/namachan10777/scad-ml/5ab12e515bcb596f2e47d31d46eedd453f47cc62/test/quat_cube.ml | ocaml | NOTE: These cubes should be equivalent if quaternion is working correctly. | open Scad_ml
let quat_cube =
let box = Scad.cube ~center:true (10., 10., 10.)
and angle = Float.pi /. 4.
and ax = 1., 1., 0. in
let a = Scad.vector_rotate ax angle box
and b = Scad.multmatrix Quaternion.(to_multmatrix (make ax angle)) box in
Scad.union_3d [ a; b ]
let () = print_string (Scad.to_string qua... |
a7bd3e88b355da85865c59baa31a05a04fa59723f7d7fa29c97aff66fca9dde3 | sameerlal/OMakeMeAMarket | test.ml | (********************************************************************
TESTING SUITE
Individual Tests are organized as follows
- Normal Tests
- Smoke Tests
- Edge Cases
********************************************************************)
open OUnit2
open Yojson.Basic.Util
open Trader
open Marketmaker
... | null | https://raw.githubusercontent.com/sameerlal/OMakeMeAMarket/3bc5dcb8e58607ac199920243ea2564ad7f9b5f2/test.ml | ocaml | *******************************************************************
TESTING SUITE
Individual Tests are organized as follows
- Normal Tests
- Smoke Tests
- Edge Cases
*******************************************************************
stop printing long list
make tests plz
make tests plz
Trader's... | open OUnit2
open Yojson.Basic.Util
open Trader
open Marketmaker
open Command
open Parse
open Stats
let suite = "CamlCoin Test suite" >::: []
* Tests for stats ,
let pp_float x = string_of_float x
* [ pp_list pp_elt lst ] pretty - prints list [ lst ] , using [ pp_elt ]
to pretty - print each element of [ ls... |
9cc5de3456a56aa962cb998d649eaf2bff948a12e9458bdf8d7bfc2d82b54cf1 | roman/Haskell-Reactive-Extensions | SyncPublishSubject.hs | {-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Rx.Subject.SyncPublishSubject (
IObservable (..)
, IObserver (..)
, Subject
, create
) where
import Control.Concurrent.Async (async)
import Control.Concurrent.STM (atomically)
import Control... | null | https://raw.githubusercontent.com/roman/Haskell-Reactive-Extensions/0faddbb671be7f169eeadbe6163e8d0b2be229fb/rx-core/src/Rx/Subject/SyncPublishSubject.hs | haskell | # LANGUAGE FlexibleContexts #
------------------------------------------------------------------------------ | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Rx.Subject.SyncPublishSubject (
IObservable (..)
, IObserver (..)
, Subject
, create
) where
import Control.Concurrent.Async (async)
import Control.Concurrent.STM (atomically)
import Control.Concurrent.STM.TChan (newTChanIO, read... |
a0a5fff8a8d8b036b7b4c31c499002d77b0d6909f337299aeddde5e663d7ac3c | exercism/clojurescript | reverse_string.cljs | (ns reverse-string)
(defn reverse-string [s] ;; arguments vector...
;; your code goes here...
)
| null | https://raw.githubusercontent.com/exercism/clojurescript/7700a33e17a798f6320aad01fb59a637bd21e12b/exercises/practice/reverse-string/src/reverse_string.cljs | clojure | arguments vector...
your code goes here... | (ns reverse-string)
)
|
fa1ab17587d4c7a0c848e54a27ac1ecdcdd5bc53ace7e8ce85c7c5d816923a85 | monadbobo/ocaml-core | ordered_collection_common.ml | let invalid_argf = Core_printf.invalid_argf
let normalize ~length_fun t i =
if i < 0 then length_fun t + i else i
let slice ~length_fun ~sub_fun t start stop =
let stop = if stop = 0 then length_fun t else stop in
let pos = normalize ~length_fun t start in
let len = (normalize ~length_fun t stop) - pos in
s... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/lib/ordered_collection_common.ml | ocaml | let invalid_argf = Core_printf.invalid_argf
let normalize ~length_fun t i =
if i < 0 then length_fun t + i else i
let slice ~length_fun ~sub_fun t start stop =
let stop = if stop = 0 then length_fun t else stop in
let pos = normalize ~length_fun t start in
let len = (normalize ~length_fun t stop) - pos in
s... | |
0e11d34786e27809c754310498cdb104a261842d523bb409b0e01fa2ffd4ae09 | OtpChatBot/Ybot | ybot_parser.erl | %%%-----------------------------------------------------------------------------
%%% @author 0xAX <>
%%% @doc
%%% Ybot incoming message parser.
%%% @end
%%%-----------------------------------------------------------------------------
-module(ybot_parser).
-behaviour(gen_server).
-export([start_link/0]).
%% gen_serve... | null | https://raw.githubusercontent.com/OtpChatBot/Ybot/5ce05fea0eb9001d1c0ff89702729f4c80743872/src/ybot_parser.erl | erlang | -----------------------------------------------------------------------------
@author 0xAX <>
@doc
Ybot incoming message parser.
@end
-----------------------------------------------------------------------------
gen_server callbacks
Internal state
==================================================================... | -module(ybot_parser).
-behaviour(gen_server).
-export([start_link/0]).
-export([init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
terminate/2,
code_change/3]).
-record(state, {}).
start_link() ->
gen_server:start_link(?MODULE, [], []).
init([]) ->
{ok, #... |
d4a6ad734e76b1c711781c907a38dc1739008952d5fa02d1a22976149e29dd45 | ocaml-multicore/ocaml-tsan | test_caml_counters.ml | (* TEST
include runtime_events
*)
open Runtime_events
let counters_tbl = Hashtbl.create 50
let runtime_counter _domain_id ts name value =
Hashtbl.add counters_tbl name value
let () =
start ();
let cursor = create_cursor None in
let callbacks = Callbacks.create ~runtime_counter () in
Gc.set { (Gc.... | null | https://raw.githubusercontent.com/ocaml-multicore/ocaml-tsan/f54002470cc6ab780963cc81b11a85a820a40819/testsuite/tests/lib-runtime-events/test_caml_counters.ml | ocaml | TEST
include runtime_events
| open Runtime_events
let counters_tbl = Hashtbl.create 50
let runtime_counter _domain_id ts name value =
Hashtbl.add counters_tbl name value
let () =
start ();
let cursor = create_cursor None in
let callbacks = Callbacks.create ~runtime_counter () in
Gc.set { (Gc.get()) with Gc.minor_heap_size = 5... |
52d62e18b6e398bff00641cb3001640bcc7603d839e02e6ca3786cb8247e42c7 | jayrbolton/coursework | CheckerBoard.hs | # # # # # # # # # # # # # # # # # # #
J Bolton
Homework 1 for chapter 2
Part 2 - checkerboard definitions
# # # # # # # # # # # # # # # # # # # #
J Bolton
Homework 1 for chapter 2
Part 2 - checkerboard definitions
####################-}
module CheckerBoard where
import Pictures
import UsePictures
Exe... | null | https://raw.githubusercontent.com/jayrbolton/coursework/f0da276527d42a6751fb8d29c76de35ce358fe65/computer_science_foundations/programming/Q1/hws/hw1/CheckerBoard.hs | haskell | -------------
Alternative way to get result: | # # # # # # # # # # # # # # # # # # #
J Bolton
Homework 1 for chapter 2
Part 2 - checkerboard definitions
# # # # # # # # # # # # # # # # # # # #
J Bolton
Homework 1 for chapter 2
Part 2 - checkerboard definitions
####################-}
module CheckerBoard where
import Pictures
import UsePictures
Exe... |
9043fba2dbcead80e9e3bca0e7bb1dd4ecdc46106167b8e2e504b714dc8d3b39 | ppaml-op3/insomnia | ParsingStage.hs | {-# LANGUAGE OverloadedStrings #-}
module Insomnia.Main.ParsingStage where
import Control.Monad.Trans
import qualified System.IO as IO
import qualified System.IO.Error as IOE
import qualified Data.Format as F
import Insomnia.Main.Monad
import Insomnia.Main.Stage
import qualified Pipes
import qualified Insomnia.Sur... | null | https://raw.githubusercontent.com/ppaml-op3/insomnia/5fc6eb1d554e8853d2fc929a957c7edce9e8867d/src/Insomnia/Main/ParsingStage.hs | haskell | # LANGUAGE OverloadedStrings # | module Insomnia.Main.ParsingStage where
import Control.Monad.Trans
import qualified System.IO as IO
import qualified System.IO.Error as IOE
import qualified Data.Format as F
import Insomnia.Main.Monad
import Insomnia.Main.Stage
import qualified Pipes
import qualified Insomnia.SurfaceSyntax.Syntax as Surface
import... |
4721381a7bc8e45843f758e44c4c61bf5952dba59d426c6d92165a9db29ef569 | remodoy/clj-postgresql | protocol.clj | (ns clj-postgresql.protocol
(:import [java.net Socket]
[java.io InputStream OutputStream ObjectInputStream ObjectOutputStream]
[java.nio ByteBuffer]
[java.nio.charset Charset]
[java.nio.channels SocketChannel]
[java.net InetSocketAddress]
[java.securit... | null | https://raw.githubusercontent.com/remodoy/clj-postgresql/38eec16386e43504addcae4601fa36f595c81f1a/src/clj_postgresql/protocol.clj | clojure | startup
ReadyForQuery
dostuff
ReadyForQuery
...
Simple query:
(Query_Q query-string) ->|
(CommandComplete_C command-tag)
(RowDescription_T fields)
(EmptyQueryResponse_I) -- partner for command-complete
(ErrorReponse_E error-fields)
(ReadyForQuery_Z backend-status)
(RowDescription [{name "foo"... | (ns clj-postgresql.protocol
(:import [java.net Socket]
[java.io InputStream OutputStream ObjectInputStream ObjectOutputStream]
[java.nio ByteBuffer]
[java.nio.charset Charset]
[java.nio.channels SocketChannel]
[java.net InetSocketAddress]
[java.securit... |
4c94ec70e3a868a0b2798c5bc84eebb6f86a063801b3c6fc21df1f4d2bc86aa6 | wireless-net/erlang-nommu | wxListItem.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2013 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Publi... | null | https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/wx/src/gen/wxListItem.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitatio... | Copyright Ericsson AB 2008 - 2013 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
@doc See external documentation : < a hr... |
18c4f2707bbe5e8a837f7616950468149bfd89f42d0dcc9271bb0ee72fe5dcf8 | squirrel-prover/squirrel-prover | parserbuf.mli | (** Module instantiating parsing from buffers. *)
(*------------------------------------------------------------------*)
(** Generic exception for user errors, that should be reported
* with the given explanation. *)
exception Error of string
(*------------------------------------------------------------------*)
va... | null | https://raw.githubusercontent.com/squirrel-prover/squirrel-prover/d25b6dab570ea0e99915059a67599fd3a38caa8b/src/parserbuf.mli | ocaml | * Module instantiating parsing from buffers.
------------------------------------------------------------------
* Generic exception for user errors, that should be reported
* with the given explanation.
------------------------------------------------------------------ |
exception Error of string
val parse_from_buf :
?test:bool ->
?interactive:bool ->
((Lexing.lexbuf -> Parser.token) -> Lexing.lexbuf -> 'a) ->
Lexing.lexbuf -> filename:string ->
'a
|
6d6bbb01691ea87e8677e60a6751d451b19700f543928f19a12c83deadb61657 | spurious/sagittarius-scheme-mirror | control.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;; This file is a part of Sagittarius Scheme system.
#!core
(library (sagittarius control)
(export define-macro
define-optional
define-values
define-inline ;; experimental but useful i guess
let-optionals*
get-optional
define-with-key ;; for c... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/sitelib/sagittarius/control.scm | scheme | coding : utf-8 ; -*-
This file is a part of Sagittarius Scheme system.
experimental but useful i guess
for compatibility
for convenient
for compatibility
most likely (with-library (lib) var)
and it must return identifier bounded in the given
library otherwise breaks cache. | #!core
(library (sagittarius control)
(export define-macro
define-optional
define-values
let-optionals*
get-optional
let-keywords
let-keywords*
begin0
let1
rlet1
dotimes
dolist
push!
pop!
check-arg
with-library
unwind-protect
datum... |
df25992e4e95519dc05ba22919f23f2b5a045e22709a9cf0c938fd3af096e043 | CorticalComputer/Book_NeuroevolutionThroughErlang | scape.erl | This source code and work is provided and developed by DXNN Research Group WWW.DXNNResearch . COM
%%
Copyright ( C ) 2012 by , DXNN Research Group ,
%All rights reserved.
%
This code is licensed under the version 3 of the GNU General Public License . Please see the LICENSE file that accompanies this project for th... | null | https://raw.githubusercontent.com/CorticalComputer/Book_NeuroevolutionThroughErlang/81b96e3d7985624a6183cb313a7f9bff0a7e14c5/Ch_18/scape.erl | erlang |
All rights reserved.
io:format("Sense request received:~p~n",[From_PId]),
Fitness goal reached.
Pole1 mass
Pole2 mass
Cart-Track Friction Coefficient
Gravity
io:format("Starting pb_sim:~p~n",[self()]),
io:format("Switch event:~p~n",[S#dtm_state.switch_event]),
io:format("Sense:~p~n",[Parameters]),
io:format("Move:~p ... | This source code and work is provided and developed by DXNN Research Group WWW.DXNNResearch . COM
Copyright ( C ) 2012 by , DXNN Research Group ,
This code is licensed under the version 3 of the GNU General Public License . Please see the LICENSE file that accompanies this project for the terms of use .
-module(s... |
1b2649d74670a337d325bf96935dc6847826822fa3806900862fa81fb6606e79 | JiaeK/dream-dashboard | import.ml | module Result = struct
include Stdlib.Result
module Syntax = struct
let ( let+ ) f t = map t f
let ( let* ) = bind
end
end
module Option = struct
include Stdlib.Option
module Syntax = struct
let ( let+ ) f t = map t f
let ( let* ) = bind
end
end
let ( let@ ) f x = f x
let handle_sys_err... | null | https://raw.githubusercontent.com/JiaeK/dream-dashboard/ab28db52122503e713a0cd2b6390737f873a9b48/src/import.ml | ocaml | module Result = struct
include Stdlib.Result
module Syntax = struct
let ( let+ ) f t = map t f
let ( let* ) = bind
end
end
module Option = struct
include Stdlib.Option
module Syntax = struct
let ( let+ ) f t = map t f
let ( let* ) = bind
end
end
let ( let@ ) f x = f x
let handle_sys_err... | |
1b98d8280d0211b786485ef6ad9a5df0cc14e062b8f5a77e285547db09d62fbf | rpav/ninja-sphere | map-hud.lisp | (in-package :ninja-sphere)
(defclass map-hud ()
((text-cmds :initform nil)
(text-style :initform nil)
(text-fg :initform nil)
(text-drop :initform nil)
(score-text :initform nil)
(lives-text :initform nil)
(last-score :initform 0)
(last-lives :initform 0)
(ninja :initform nil)))
(defmethod i... | null | https://raw.githubusercontent.com/rpav/ninja-sphere/f6708d9ab209a831c7e7df3f12d32ecc4afe0426/src/ui/map-hud.lisp | lisp | (in-package :ninja-sphere)
(defclass map-hud ()
((text-cmds :initform nil)
(text-style :initform nil)
(text-fg :initform nil)
(text-drop :initform nil)
(score-text :initform nil)
(lives-text :initform nil)
(last-score :initform 0)
(last-lives :initform 0)
(ninja :initform nil)))
(defmethod i... | |
1f8e1ecdc40cb2d90ae09a49665362aba7e3898f446944725960ed07b398dc72 | facundoolano/restpect | core.clj | (ns restpect.core
"Assertion functions for HTTP responses."
(:require [clojure.test :refer [do-report]]
[clojure.string :as str]))
(defn- pretty-fname [f]
(-> (str f)
(clojure.main/demunge)
(clojure.string/split #"/")
(last)
(clojure.string/split #"@")
(first)))
(defpro... | null | https://raw.githubusercontent.com/facundoolano/restpect/1772f75145611aa08667070b67f915ed0879fab7/src/restpect/core.clj | clojure | (ns restpect.core
"Assertion functions for HTTP responses."
(:require [clojure.test :refer [do-report]]
[clojure.string :as str]))
(defn- pretty-fname [f]
(-> (str f)
(clojure.main/demunge)
(clojure.string/split #"/")
(last)
(clojure.string/split #"@")
(first)))
(defpro... | |
9276b44121c8e07d6905bdb7758730cb2b79e4708cceff3fd373e12c616402e7 | open-telemetry/opentelemetry-erlang | otel_configuration_SUITE.erl | -module(otel_configuration_SUITE).
-compile(export_all).
-include_lib("stdlib/include/assert.hrl").
-include_lib("common_test/include/ct.hrl").
-include("otel_span.hrl").
-define(assertIsSubset(X, Y),
lists:foreach(fun({K, V}) ->
V1 = proplists:get_value(K, Y, undefined),
... | null | https://raw.githubusercontent.com/open-telemetry/opentelemetry-erlang/58cfd2225c0c3c45407d791c10d25aa129166e52/apps/opentelemetry/test/otel_configuration_SUITE.erl | erlang | include the key in the assert so it is there
in the error message if it fails
nonexisting_atom in the OTEL_DENY_LIST os var is dropped bc it isn't an existing atom
verifies the defaults because the base record has the defaults set as well
| -module(otel_configuration_SUITE).
-compile(export_all).
-include_lib("stdlib/include/assert.hrl").
-include_lib("common_test/include/ct.hrl").
-include("otel_span.hrl").
-define(assertIsSubset(X, Y),
lists:foreach(fun({K, V}) ->
V1 = proplists:get_value(K, Y, undefined),
... |
74ee670b10c9e730215da5823079cfabdb531583ea4ab3078871d49d30b0cb52 | erlang/corba | oe_CosEventComm_CAdmin_impl.erl | %%--------------------------------------------------------------------
%%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2001 - 2016 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain ... | null | https://raw.githubusercontent.com/erlang/corba/396df81473a386d0315bbba830db6f9d4b12a04f/lib/cosEvent/src/oe_CosEventComm_CAdmin_impl.erl | erlang | --------------------------------------------------------------------
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY... | Copyright Ericsson AB 2001 - 2016 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(oe_CosEventComm_CAdmin_impl).
-include_lib("orber/include/corba.hrl").
-include("cosEventApp.hrl").
-export... |
da24532eb1b479a199718fae6ccf7d1aae8a50c11a40ba20393d55b650ef3c79 | Quid2/zm | Base.hs | module ZM.Pretty.Base
( prettyWords
, hex
) where
import Data.Word
import Prelude
import Text.PrettyPrint.HughesPJClass
import qualified Text.PrettyPrint.HughesPJClass as P
import Text.Printf
import ZM.Types
instance Pretty t => Pretty (ZMError t) where
pPrint... | null | https://raw.githubusercontent.com/Quid2/zm/02c0514777a75ac054bfd6251edd884372faddea/src/ZM/Pretty/Base.hs | haskell | |Display a list of Words in hexadecimal format
|Display a Word in hexadecimal format | module ZM.Pretty.Base
( prettyWords
, hex
) where
import Data.Word
import Prelude
import Text.PrettyPrint.HughesPJClass
import qualified Text.PrettyPrint.HughesPJClass as P
import Text.Printf
import ZM.Types
instance Pretty t => Pretty (ZMError t) where
pPrint... |
161bf82c0e3420d83b9fca742bb32f5dfe30b535351c5b447fa406221123ffd0 | gregtatcam/imaplet-lwt | imaplet_configure.ml |
* Copyright ( c ) 2013 - 2014 < >
*
* 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... | null | https://raw.githubusercontent.com/gregtatcam/imaplet-lwt/d7b51253e79cffa97e98ab899ed833cd7cb44bb6/servers/imaplet_configure.ml | ocaml |
* Copyright ( c ) 2013 - 2014 < >
*
* 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... | |
7194b5d30d6f2ce2e7c326a359ac7959eab14757caa4dd72e499b89f55d4421a | static-analysis-engineering/codehawk | jCHInstructionInfo.mli | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Java Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Copy... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/98ced4d5e6d7989575092df232759afc2cb851f6/CodeHawk/CHJ/jchpre/jCHInstructionInfo.mli | ocaml | jchlib
jchpre | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Java Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Copy... |
eb72d246cfdf6d9bdbc05f823de88f2bbced796d1961075b16bb1c25ca6847db | keera-studios/keera-hails | Window.hs | -- |
--
Copyright : ( C ) Keera Studios Ltd , 2013
-- License : BSD3
Maintainer :
module Graphics.UI.Gtk.Reactive.Window where
import Control.Monad (void, when)
import Control.Monad.IO.Class (liftIO)
import Data.ReactiveValue
import Graphics.UI.Gtk
windowCloseReactive :: WindowClass self => self -> Reac... | null | https://raw.githubusercontent.com/keera-studios/keera-hails/bf069e5aafc85a1f55fa119ae45a025a2bd4a3d0/keera-hails-reactive-gtk/src/Graphics/UI/Gtk/Reactive/Window.hs | haskell | |
License : BSD3 | Copyright : ( C ) Keera Studios Ltd , 2013
Maintainer :
module Graphics.UI.Gtk.Reactive.Window where
import Control.Monad (void, when)
import Control.Monad.IO.Class (liftIO)
import Data.ReactiveValue
import Graphics.UI.Gtk
windowCloseReactive :: WindowClass self => self -> ReactiveFieldRead IO ()
windowClos... |
d5aa1a982d5a1fc52f315ad3f30623ae09ffbd18bd8fd3d0956da437fd0b8f32 | 3b/3bil | misc.lisp | (in-package #:avm2-compiler)
;; various not-quite-cl parts
(let ((*symbol-table* *cl-symbol-table*))
(c3* :%%misc2
(defmacro time (&body body)
(let ((now (gensym)))
`(let ((,now (%new- flash:date)))
,@body
(ftrace
(s+ "[" ":" (/ (- (%new- flash:date) ,now) 1000... | null | https://raw.githubusercontent.com/3b/3bil/c852181848bedf476373e901869ca29471f926ee/lib/misc.lisp | lisp | various not-quite-cl parts
fixme: use new compiler (see :constructor option to defclass-swf)
fixme: use eval-when instead of doing things at macroexpansion
(format nil "~a::~a" spec-type name)
fixme: parse declarations/docstring stuff properly
(format nil "~a::~a" spec-type name)
fixme: parse declarations/docstrin... | (in-package #:avm2-compiler)
(let ((*symbol-table* *cl-symbol-table*))
(c3* :%%misc2
(defmacro time (&body body)
(let ((now (gensym)))
`(let ((,now (%new- flash:date)))
,@body
(ftrace
(s+ "[" ":" (/ (- (%new- flash:date) ,now) 1000.0) "sec]")))))
#+nil
... |
af93436c81643413db763ab2281613f73ddc3baa8cf01e93d8def41e760098f2 | openmusic-project/openmusic | constants.lisp | -*- Mode : Lisp ; rcs - header : " $ Header : /hope / lwhope1 - cam / hope.0 / compound/61 / LISPopengl / RCS / constants.lisp , v 1.6.1.1 2014/05/27 20:56:56 davef Exp $ " -*-
Copyright ( c ) 1987 - -2015 LispWorks Ltd. All rights reserved .
(in-package "OPENGL")
AccumOp
(defconstant *GL-ACCUM* ... | null | https://raw.githubusercontent.com/openmusic-project/openmusic/9560c064512a1598cd57bcc9f0151c0815178e6f/OPENMUSIC/code/api/externals/OpenGL/opengl-lw/constants.lisp | lisp | rcs - header : " $ Header : /hope / lwhope1 - cam / hope.0 / compound/61 / LISPopengl / RCS / constants.lisp , v 1.6.1.1 2014/05/27 20:56:56 davef Exp $ " -*-
AlphaFunction
BlendEquationMode
GL-LOGIC-OP
GL-CONSTANT-ALPHA
BlendingFactorSrc
GL-DST-ALPHA
GL-CONSTANT-ALPHA
ClearBufferMas... |
Copyright ( c ) 1987 - -2015 LispWorks Ltd. All rights reserved .
(in-package "OPENGL")
AccumOp
(defconstant *GL-ACCUM* #x0100)
(defconstant *GL-LOAD* #x0101)
(defconstant *GL-RETURN* #x0102)
(defconstant *GL-MULT* ... |
531d12968b9d7cc143e74ffb939b99c8225c5ae71bf68bbbfad52cc836af3bab | quchen/stgi | TwoSpaceCopying.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
-- | Two space stop-and-copy garbage collector.
--
-- * Compacting: memory is moved to a new location
-- * Tr... | null | https://raw.githubusercontent.com/quchen/stgi/dacd45cb0247f73889713dc92a911aaa835afd19/src/Stg/Machine/GarbageCollection/TwoSpaceCopying.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| Two space stop-and-copy garbage collector.
* Compacting: memory is moved to a new location
* Tracing
| Move all used addresses by moving them to a safe location, and delete the
leftovers.
^ Heap of closures known to be alive.
^ Fo... | # LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
module Stg.Machine.GarbageCollection.TwoSpaceCopying (
twoSpaceCopying,
) where
import Control.Monad.Trans.Class
import Control.Monad.Trans.Reader
import Contro... |
473da26f6751cb706d1df18bc9fe77c159711d60f906b9ea733c572fbcfc2d69 | chumsley/jwacs | loop-transformation.lisp | ;;;; loop-transformation.lisp
;;;
;;
;; LOOP-CANONICALIZE: turn loops into a form more easily EXPLICITIZE'd and CPS'ed
;;
;; Basically we remove the test into an if statement in the loop, remove any variable declarations inside the loop
;; and annotate at the correct places with "break" and "continue"
;;
;;
We 'll... | null | https://raw.githubusercontent.com/chumsley/jwacs/c25adb3bb31fc2dc6e8c8a58346949ee400633d7/loop-transformation.lisp | lisp | loop-transformation.lisp
LOOP-CANONICALIZE: turn loops into a form more easily EXPLICITIZE'd and CPS'ed
Basically we remove the test into an if statement in the loop, remove any variable declarations inside the loop
and annotate at the correct places with "break" and "continue"
See LICENSE for full licens... | We 'll also turn everything into a while loop , so we only have one loop type to deal with later on .
Copyright ( c ) 2005 and
(in-package :jwacs)
(defmethod transform ((xform (eql 'loop-canonicalize)) (elm while))
(let ((new-decls (mapcar (lambda (decl)
(make-var-decl :na... |
1ab7541e9ec46170a4540a29947f1f5b8450b09246f4a01ab998a22edae4d125 | typelead/eta | arr015.hs | -- !!! Array test
This one fails in Hugs ( Feb 2001 )
module Main where
import Data.Array
-- All in main is only to show the strange behaviour.
--
arrS is the array that foo ( NB ( 1.0,1 ) ) shows in Hugs .
-- But (foo (NB (1.0,1)))==arrS is False.
If I write ( f , p ) - > hCMt [ ( p , listArray ( ( 1,1),(1,... | null | https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/tests/suite/array/run/arr015.hs | haskell | !!! Array test
All in main is only to show the strange behaviour.
But (foo (NB (1.0,1)))==arrS is False.
(map (\(po,ar) -> ((1,po),M ar)) po_arL)
All these should return True
h0CMt :: Array (Int, Int) (CM Double) | This one fails in Hugs ( Feb 2001 )
module Main where
import Data.Array
arrS is the array that foo ( NB ( 1.0,1 ) ) shows in Hugs .
If I write ( f , p ) - > hCMt [ ( p , listArray ( ( 1,1),(1,1 ) ) [ f ] ) ] instead of line 16
the bug disappears . That is also the reason why I have to keep the data declara... |
762369b6e5e039d85cf3310e2c8706042d5517267067a7a8059aefd1a5328749 | LeventErkok/sbv | UISatEx.hs | -----------------------------------------------------------------------------
-- |
-- Module : TestSuite.Queries.UISatEx
Copyright : ( c )
-- License : BSD3
-- Maintainer:
-- Stability : experimental
--
-- Testing uninterpreted function extraction
--------------------------------------------------------------... | null | https://raw.githubusercontent.com/LeventErkok/sbv/cfaa40b8c8ff8e1b7ff9ab71304654f6f531ba72/SBVTestSuite/TestSuite/Queries/UISatEx.hs | haskell | ---------------------------------------------------------------------------
|
Module : TestSuite.Queries.UISatEx
License : BSD3
Maintainer:
Stability : experimental
Testing uninterpreted function extraction
---------------------------------------------------------------------------
# LANGUAGE OverloadedStr... | Copyright : ( c )
# LANGUAGE OverloadedLists #
module TestSuite.Queries.UISatEx where
import Data.SBV.Control
import Utils.SBVTestFramework
tests :: TestTree
tests =
testGroup "Queries.UISatEx"
[ goldenCapturedIO "query_uisatex1" testQuery1
, goldenCapturedIO "query_uisatex2" testQuery2
]
te... |
38ffb79a6a6e2916f9f3483abed012344459a7197c750deabd0e5e9e4e249235 | monadbobo/ocaml-core | ref.mli | type 'a t = 'a ref = { mutable contents : 'a }
include Binable.S1 with type 'a t := 'a t
include Sexpable.S1 with type 'a t := 'a t
include Container.S1 with type 'a t := 'a t
val create : 'a -> 'a t
val (!) : 'a t -> 'a
val (:=) : 'a t -> 'a -> unit
(** [swap t1 t2] swaps the values in [t1] and [t2]. *)
val s... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/lib/ref.mli | ocaml | * [swap t1 t2] swaps the values in [t1] and [t2].
* [replace t f] is [t := f !t] | type 'a t = 'a ref = { mutable contents : 'a }
include Binable.S1 with type 'a t := 'a t
include Sexpable.S1 with type 'a t := 'a t
include Container.S1 with type 'a t := 'a t
val create : 'a -> 'a t
val (!) : 'a t -> 'a
val (:=) : 'a t -> 'a -> unit
val swap : 'a t -> 'a t -> unit
val replace : 'a t -> ('a -... |
738fa8e694b220a2aded9062a20b2a3caf1ed4724493c673bb045acc79993b27 | cse-bristol/110-thermos-ui | view.cljc | This file is part of THERMOS , copyright © Centre for Sustainable Energy , 2017 - 2021
Licensed under the Reciprocal Public License v1.5 . See LICENSE for licensing details .
(ns thermos-test.specs.view
(:require [thermos-specs.view :as view]
[thermos-specs.candidate :as can]
[clojure.spe... | null | https://raw.githubusercontent.com/cse-bristol/110-thermos-ui/e13b96329f3c95e5a10bae431e8ae9bccdb475f4/test/thermos_ui/test/specs/view.cljc | clojure | This file is part of THERMOS , copyright © Centre for Sustainable Energy , 2017 - 2021
Licensed under the Reciprocal Public License v1.5 . See LICENSE for licensing details .
(ns thermos-test.specs.view
(:require [thermos-specs.view :as view]
[thermos-specs.candidate :as can]
[clojure.spe... | |
5429dadafc8b1744334d673790442e55c00687a9a18a1a3bfe72c2b18727bfd3 | lispgames/perfectstorm | cairo.lisp | (in-package :storm)
(defparameter *relative-line-width* 0.05)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defun numbers-to-doubles (tree)
;traverses a nested list,
;coercing all numbers into
... | null | https://raw.githubusercontent.com/lispgames/perfectstorm/a21e0420deb3ec83e9d776241ab37e78c5f29b94/perfectstorm/cairo.lisp | lisp | traverses a nested list,
coercing all numbers into
double-floats. useful for
font building
set
create new opengl texture "name" (i.e. get an unused texture id)
helper functions and macros
(declare (optimize
(debug 0) (space 0)))
create new opengl texture "name" (i.e. get an unused texture id)
(make-mipmaps w... | (in-package :storm)
(defparameter *relative-line-width* 0.05)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defun numbers-to-doubles (tree)
the stupid cairo bindings
(loop for element in tree
collecting
(cond
((listp element) (numbers-to-doubles element))
((number... |
bfec39a490de36f4b1b233ffbe42b3d16c481c0bc631fe92d1bbddd08fb0ca76 | Bogdanp/marionette | element.rkt | #lang racket/base
(require marionette
net/url
rackunit
"common.rkt")
(provide
element-tests)
(define element-tests
(test-suite
"element"
(test-suite
"element-click!"
(test-case "can click on an element"
(call-with-browser!
(lambda (b)
(call-with-p... | null | https://raw.githubusercontent.com/Bogdanp/marionette/9adbfecce47be06e25ced811af5dee36e5fda96e/marionette-test/tests/marionette/integration/element.rkt | racket | #lang racket/base
(require marionette
net/url
rackunit
"common.rkt")
(provide
element-tests)
(define element-tests
(test-suite
"element"
(test-suite
"element-click!"
(test-case "can click on an element"
(call-with-browser!
(lambda (b)
(call-with-p... | |
6e9f4065b8a0697baaaa4ffca347c4acbbbab9ed36dae03d27370725726fe3a4 | expipiplus1/vulkan | VK_NVX_binary_import.hs | {-# language CPP #-}
-- | = Name
--
-- VK_NVX_binary_import - device extension
--
= = VK_NVX_binary_import
--
-- [__Name String__]
-- @VK_NVX_binary_import@
--
-- [__Extension Type__]
-- Device extension
--
-- [__Registered Extension Number__]
30
--
-- [__Revision__]
1
--
-- [__Extension and Versi... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/ebc0dde0bcd9cf251f18538de6524eb4f2ab3e9d/src/Vulkan/Extensions/VK_NVX_binary_import.hs | haskell | # language CPP #
| = Name
VK_NVX_binary_import - device extension
[__Name String__]
@VK_NVX_binary_import@
[__Extension Type__]
Device extension
[__Registered Extension Number__]
[__Revision__]
[__Extension and Version Dependencies__]
[__Contact__]
== Other Extension Metadata
[__Last Mo... | = = VK_NVX_binary_import
30
1
- Requires support for Vulkan 1.0
-
< -Docs/issues/new?body=[VK_NVX_binary_import ] @ewerness - nv%0A*Here describe the issue or question you have about the VK_NVX_binary_import extension * >
-
< -Docs/issues/new?body=[VK_NVX... |
f3aade0186d66e383a007d594ace2fd0e80db5556c3f5c633beadf553c1baa22 | anmonteiro/lumo | util.clj | (ns lumo.util)
(defmacro measure
"Like cljs.core/time but toggleable and takes a message string."
{:added "1.0"}
([msg expr] `(measure true ~msg ~expr))
([enable msg expr]
`(if ~enable
(let [start# (cljs.core/system-time)
ret# ~expr]
(debug-prn (str ~msg ", elapsed time:")
... | null | https://raw.githubusercontent.com/anmonteiro/lumo/6709c9f1b7b342c8108e6ed6e034e19dc786f00b/src/cljs/bundled/lumo/util.clj | clojure | (ns lumo.util)
(defmacro measure
"Like cljs.core/time but toggleable and takes a message string."
{:added "1.0"}
([msg expr] `(measure true ~msg ~expr))
([enable msg expr]
`(if ~enable
(let [start# (cljs.core/system-time)
ret# ~expr]
(debug-prn (str ~msg ", elapsed time:")
... | |
3302276ff5e80657cc1cdefe1ce976854130997d60bc6a2941955215aa1dee1c | nuvla/api-server | nuvlabox_status_1_test.cljc | (ns sixsq.nuvla.server.resources.spec.nuvlabox-status-1-test
(:require
[clojure.test :refer [deftest]]
[sixsq.nuvla.server.resources.nuvlabox-status :as nbs]
[sixsq.nuvla.server.resources.spec.nuvlabox-status-1 :as nb-status-1]
[sixsq.nuvla.server.resources.spec.spec-test-utils :as stu]))
(def valid... | null | https://raw.githubusercontent.com/nuvla/api-server/a64a61b227733f1a0a945003edf5abaf5150a15c/code/test/sixsq/nuvla/server/resources/spec/nuvlabox_status_1_test.cljc | clojure | required
optional | (ns sixsq.nuvla.server.resources.spec.nuvlabox-status-1-test
(:require
[clojure.test :refer [deftest]]
[sixsq.nuvla.server.resources.nuvlabox-status :as nbs]
[sixsq.nuvla.server.resources.spec.nuvlabox-status-1 :as nb-status-1]
[sixsq.nuvla.server.resources.spec.spec-test-utils :as stu]))
(def valid... |
6a8b0529db515b239aceed515098cdf812dce044b25795bc6e41f8d9d229d95d | satos---jp/mincaml_self_hosting | ftoi_itof.ml | print_int (int_of_float (31.4 +. 15.9 /. (float_of_int 26)));
print_int (int_of_float (15.5 *. 3.2));
print_char 10
| null | https://raw.githubusercontent.com/satos---jp/mincaml_self_hosting/5fdf8b5083437d7607a924142eea52d9b1de0439/test/ftoi_itof.ml | ocaml | print_int (int_of_float (31.4 +. 15.9 /. (float_of_int 26)));
print_int (int_of_float (15.5 *. 3.2));
print_char 10
| |
c1144f3336c2d8a244c005834424e3147c9e68f1c3550588dcb6897402dd58f8 | shirok/Gauche | test-trie.scm | ;; trie
(test-section "data.trie")
(use data.trie)
(test-module 'data.trie)
(use gauche.uvector)
(use gauche.sequence)
(use scheme.list)
(use srfi.13)
(let* ((strs '("kana" "kanaono" "kanawai" "kanawai koa"
"kanawai mele" "kane" "Kane" "kane make" "kane makua"
"ku" "kua" "kua`aina" "kua`a... | null | https://raw.githubusercontent.com/shirok/Gauche/e97efb5e54f9ab97746369b8ac748f338224c746/ext/data/test-trie.scm | scheme | trie
string trie tests
trie and trie-with-keys
heterogeneous tries
customizing tables
collection api | (test-section "data.trie")
(use data.trie)
(test-module 'data.trie)
(use gauche.uvector)
(use gauche.sequence)
(use scheme.list)
(use srfi.13)
(let* ((strs '("kana" "kanaono" "kanawai" "kanawai koa"
"kanawai mele" "kane" "Kane" "kane make" "kane makua"
"ku" "kua" "kua`aina" "kua`ana"
... |
c01aa0dafd54968a81ba3e18771db8ff0f635a967d7aa5d920abd80a5c8c1507 | OCamlPro/ocp-build | buildOCP2Parse.ml | (**************************************************************************)
(* *)
(* Typerex Tools *)
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/OCamlPro/ocp-build/56aff560bb438c12b2929feaf8379bc6f31b9840/tools/ocp-build/lang-ocp2/buildOCP2Parse.ml | ocaml | ************************************************************************
Typerex Tools
... | Copyright 2011 - 2017 OCamlPro SAS
the GNU General Public License version 3 described in the file
open BuildOCP2Lexer
open BuildOCP2Parser
let getenv_flag s =
try
ignore (Sys.getenv s); true
with Not_found -> false
let flag_print_tokens = getenv_flag "OCPBU... |
c5f17f3cbee99e5963969fd5b6485767b1f6816fb5388b508e280731a41476ea | NetComposer/nklib | nklib_log_gelf.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2019 . All Rights Reserved .
%%
This file is provided to you 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... | null | https://raw.githubusercontent.com/NetComposer/nklib/1f29f8f566586618651e4680dcc488f2dc11ff5c/src/nklib_log_gelf.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2019 . All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
@doc GELF backend for nkli... |
9d3bf2eabbf2a80d7fbf78a9264ff2327dd0844573fb56ff47f0990fa836eb03 | hongseok-yang/probprog19 | project.clj | (defproject anglican-user "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[nstools "0.2.4"]
[clojure-csv/clojure-csv "2.0.1"]
[a... | null | https://raw.githubusercontent.com/hongseok-yang/probprog19/2d0e209b2d69be0d9fd57c7ec1ae13384935a0ca/Lectures/Lecture4/project.clj | clojure | (defproject anglican-user "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[nstools "0.2.4"]
[clojure-csv/clojure-csv "2.0.1"]
[a... | |
1d0215144e584f9f7bb6a0c9094ea2ab6cabc2f3c6cf0dd188926bf877c5cbaa | aigarashi/copl-tools | pp.ml | open Format
open Core
let g = "EvalRefMLiv"
let pr = fprintf
let is_negative i = (i < 0)
(* generic functions to generate parens depending on precedence *)
let with_paren lt ppf_e e_up ppf e =
let (<) = lt in
if e < e_up then pr ppf "(%a)" ppf_e e else pr ppf "%a" ppf_e e
(* precedence for expressions *)
let r... | null | https://raw.githubusercontent.com/aigarashi/copl-tools/3c4da117083a0870334c8eef270206b11060514e/checker/EvalRefML4/pp.ml | ocaml | generic functions to generate parens depending on precedence
precedence for expressions
if e is the left operand of e_up, do you need parentheses for e?
mult associates stronger than plus or minus
if e is the right operand of e_up, do you need parentheses for e?
mult associates stronger than plus or minus,
... | open Format
open Core
let g = "EvalRefMLiv"
let pr = fprintf
let is_negative i = (i < 0)
let with_paren lt ppf_e e_up ppf e =
let (<) = lt in
if e < e_up then pr ppf "(%a)" ppf_e e else pr ppf "%a" ppf_e e
let rec is_last_longexp = function
BinOp(_,_,e) | Cons(_,e) -> is_last_longexp e
| If(_,_,_) | Let(... |
c7b22be8d6e2a84c91b45f2aa985673809ea90e6a6cba3af18c5cdef79fea821 | bos/rwh | B.hs | import System.Environment
import Text.Printf
main = do
[d] <- map read `fmap` getArgs
printf "%f\n" (mean [1..d])
{-- snippet fold --}
mean :: [Double] -> Double
mean xs = s / fromIntegral n
where
(n, s) = foldl k (0, 0) xs
k (n, s) x = (n+1, s+x)
{-- /snippet fold --}
| null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch26/B.hs | haskell | - snippet fold -
- /snippet fold - | import System.Environment
import Text.Printf
main = do
[d] <- map read `fmap` getArgs
printf "%f\n" (mean [1..d])
mean :: [Double] -> Double
mean xs = s / fromIntegral n
where
(n, s) = foldl k (0, 0) xs
k (n, s) x = (n+1, s+x)
|
7e611085ce183cc08f9b213e695f205f0dca91e08f808aebc7bbabc5a62418f8 | con-kitty/categorifier | Makers.hs | # LANGUAGE CPP #
# LANGUAGE RecordWildCards #
{-# LANGUAGE StrictData #-}
# LANGUAGE TupleSections #
# LANGUAGE ViewPatterns #
-- | The plumbing for converting the category-agnostic representation to some specific type class
-- hierarchy.
module Categorifier.Core.Makers
( Makers (..),
haskMakers,
extract2T... | null | https://raw.githubusercontent.com/con-kitty/categorifier/8b33d0bdcab8172a0b53cb202a6449ad1b4a6992/plugin/Categorifier/Core/Makers.hs | haskell | # LANGUAGE StrictData #
| The plumbing for converting the category-agnostic representation to some specific type class
hierarchy.
Attempts to apply the provided `Plugins.CoreExpr` to as many type class instances as are
required.
Find the wanted type class instance in the environment, apply `e` to it,
and contin... | # LANGUAGE CPP #
# LANGUAGE RecordWildCards #
# LANGUAGE TupleSections #
# LANGUAGE ViewPatterns #
module Categorifier.Core.Makers
( Makers (..),
haskMakers,
extract2TypeArgs,
getMorphismType,
isFreeIn,
isCalledIn,
)
where
import Categorifier.Core.BuildDictionary (buildDictionary)
import Categ... |
ea77d165f26a7c4ef7778238609e9d6d7af240510e8b0a526dd067905ac0a4b2 | zachjs/sv2v | Parser.hs | # LANGUAGE TupleSections #
sv2v
- Author : < >
- Author: Zachary Snow <>
-}
module Language.SystemVerilog.Parser
( initialEnv
, parseFiles
, Config(..)
) where
import Control.Monad.Except
import Data.List (elemIndex)
import qualified Data.Map.Strict as Map
import Language.SystemVerilog.AS... | null | https://raw.githubusercontent.com/zachjs/sv2v/306d71334b264f53f80b274be82c165ab436ee5f/src/Language/SystemVerilog/Parser.hs | haskell | parse CLI macro definitions into the internal macro environment format
split a raw CLI macro definition at the '=', if present
parse a list of files according to the given configuration
parse an individual file, potentially updating the configuration
preprocess an individual file, potentially updating the configur... | # LANGUAGE TupleSections #
sv2v
- Author : < >
- Author: Zachary Snow <>
-}
module Language.SystemVerilog.Parser
( initialEnv
, parseFiles
, Config(..)
) where
import Control.Monad.Except
import Data.List (elemIndex)
import qualified Data.Map.Strict as Map
import Language.SystemVerilog.AS... |
32efae974e68ea02f63e95ca3714d1224f2f2e80b52d099449c8b769aefdebf9 | deadpendency/deadpendency | TranslateCatchC.hs | module Common.Effect.TranslateError.Carrier.TranslateCatchC (TranslateCatchC (..)) where
import Common.Model.Error.FromAppError
import Control.Algebra
import Control.Effect.Catch
newtype TranslateCatchC (e :: Type) (s :: Type) m a = TranslateCatchC {runTranslateCatchC :: m a}
deriving newtype (Functor, Applicative,... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/common/src/Common/Effect/TranslateError/Carrier/TranslateCatchC.hs | haskell | module Common.Effect.TranslateError.Carrier.TranslateCatchC (TranslateCatchC (..)) where
import Common.Model.Error.FromAppError
import Control.Algebra
import Control.Effect.Catch
newtype TranslateCatchC (e :: Type) (s :: Type) m a = TranslateCatchC {runTranslateCatchC :: m a}
deriving newtype (Functor, Applicative,... | |
cd3a6756a5cab5c1988814e02ef77bb61a99e2ea410cb5441b4b704cf434bd36 | forsyde/forsyde-shallow | Gaussian.hs | -----------------------------------------------------------------------------
-- |
-- Module : ForSyDe.Shallow.Utility.Gaussian
Copyright : ( c ) ForSyDe Group , KTH 2007 - 2008
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer :
-- Stability : experimental
-- Portability : portable
-... | null | https://raw.githubusercontent.com/forsyde/forsyde-shallow/a0ffc85270fb0cf5f169d031a381b414c677ddae/src/ForSyDe/Shallow/Utility/Gaussian.hs | haskell | ---------------------------------------------------------------------------
|
Module : ForSyDe.Shallow.Utility.Gaussian
License : BSD-style (see the file LICENSE)
Maintainer :
Stability : experimental
Portability : portable
We follow the Box-Muller method to generate white gaussian noise,
desc... | Copyright : ( c ) ForSyDe Group , KTH 2007 - 2008
module ForSyDe.Shallow.Utility.Gaussian (
pGaussianNoise
)
where
import ForSyDe.Shallow.MoC.Untimed
import ForSyDe.Shallow.Core.Signal
import qualified System.Random
|To generate an infinite Signal of Gaussian values
Mean value of the Gaussian no... |
44d0bd4e6f043de11de3050f9ac945d55e24f01e836fd24840340eebf5d6430a | cac-t-u-s/om-sharp | bpf-editor.lisp | ;============================================================================
; om#: visual programming language for computer-assisted music composition
;============================================================================
;
; This program is free software. For information on usage
; and redistribution, see... | null | https://raw.githubusercontent.com/cac-t-u-s/om-sharp/80f9537368471d0e6e4accdc9fff01ed277b879e/src/packages/basic/bpf-bpc/bpf-editor.lisp | lisp | ============================================================================
om#: visual programming language for computer-assisted music composition
============================================================================
This program is free software. For information on usage
and redistribution, see the "... | File author :
(in-package :om)
(defvar *add-point-distance-treshold* 5)
(defclass bpf-editor (multi-display-editor-mixin OMEditor play-editor-mixin undoable-editor-mixin)
((edit-mode :accessor edit-mode :initform :mouse)
(decimals :accessor decimals :initform 0 :initarg :decimals)
(x-axis-key :accessor x... |
af05008e3ade821c5557a2c630b2c2e67664e973d60786570c8e9e0ff4a0a4bf | hellonico/origami-dnn | onecat.clj | (ns origami-dnn.demo.ssdnet.onecat
(:require
[opencv4.core :refer [imread imwrite]]
[origami-dnn.draw :as d]
[origami-dnn.net.mobilenet :as mobilenet]
[opencv4.dnn.core :as origami-dnn]))
(defn -main [& args]
(let [
input (or (first args) "resources/catwalk.jpg")
output (or (second args) "mob... | null | https://raw.githubusercontent.com/hellonico/origami-dnn/f55a32d0d3d528fcf57aaac10cfb20c7998b380c/src/origami_dnn/demo/ssdnet/onecat.clj | clojure | (-main) | (ns origami-dnn.demo.ssdnet.onecat
(:require
[opencv4.core :refer [imread imwrite]]
[origami-dnn.draw :as d]
[origami-dnn.net.mobilenet :as mobilenet]
[opencv4.dnn.core :as origami-dnn]))
(defn -main [& args]
(let [
input (or (first args) "resources/catwalk.jpg")
output (or (second args) "mob... |
0fe57e14e378c1c53e1f29b5861f8cdab894eebb818c2ff0cd0ec6826983795d | onyx-platform/onyx | coordinator.clj | (ns onyx.peer.coordinator
(:require [com.stuartsierra.component :as component]
[onyx.schema :as os]
[clojure.core.async :refer [>!! <!! poll! promise-chan sliding-buffer chan close! thread]]
[onyx.static.planning :as planning]
[taoensso.timbre :refer [debug info error w... | null | https://raw.githubusercontent.com/onyx-platform/onyx/74f9ae58cdbcfcb1163464595f1e6ae6444c9782/src/onyx/peer/coordinator.clj | clojure | park and retry
currently both reduce and output tasks
will emit a checkpoint under the :output type,
even with a null plugin.
No op because hasn't finished emitting last barrier, back-off
initialize the watermark without setting the coordinate.
this allows the garbage collector to find uncommitted checkpoints.
... | (ns onyx.peer.coordinator
(:require [com.stuartsierra.component :as component]
[onyx.schema :as os]
[clojure.core.async :refer [>!! <!! poll! promise-chan sliding-buffer chan close! thread]]
[onyx.static.planning :as planning]
[taoensso.timbre :refer [debug info error w... |
2003ad4e05113bd380528f92200bb5be36a1e8b80481e0b276a8d978ce6b2263 | tsloughter/kuberl | kuberl_v1_network_policy_egress_rule.erl | -module(kuberl_v1_network_policy_egress_rule).
-export([encode/1]).
-export_type([kuberl_v1_network_policy_egress_rule/0]).
-type kuberl_v1_network_policy_egress_rule() ::
#{ 'ports' => list(),
'to' => list()
}.
encode(#{ 'ports' := Ports,
'to' := To
}) ->
#{ 'ports' => Ports,
... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1_network_policy_egress_rule.erl | erlang | -module(kuberl_v1_network_policy_egress_rule).
-export([encode/1]).
-export_type([kuberl_v1_network_policy_egress_rule/0]).
-type kuberl_v1_network_policy_egress_rule() ::
#{ 'ports' => list(),
'to' => list()
}.
encode(#{ 'ports' := Ports,
'to' := To
}) ->
#{ 'ports' => Ports,
... | |
933a132a7cd6f1bb0b3b537a91c3f4f6b217a0398fec6a63587108d5ed952816 | argp/bap | dominator.ml | * Dominator module for use with the ocamlgraph library .
All of the functions in this module assume that the graph is not modified
between calling one of these functions and using the returned functions .
Such mutation results in undefined behavior .
@author
All of the functions in thi... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/ocaml/dominator.ml | ocaml | * function from [n] to [n]'s immediate dominator
* [idoms x y] is true when [x] is [y]'s immediate dominator
* function from [x] to a list of nodes immediately dominated by [x]
* function from node to a list of nodes that dominate it. the
list is sorted by depth in the dominator tree.
* function from [x] to ... | * Dominator module for use with the ocamlgraph library .
All of the functions in this module assume that the graph is not modified
between calling one of these functions and using the returned functions .
Such mutation results in undefined behavior .
@author
All of the functions in thi... |
ec96c2ff643122c07547228811f6b385f8822a97f7fc444f18bf211030ede2ca | rd--/hsc3 | rand.help.hs | -- rand
let f = randId 'α' 200 1200
l = randId 'β' (-1) 1
e = line kr 0.2 0 0.1 RemoveSynth
o = fSinOsc ar f 0
in pan2 (o * e) l 1
-- rand
sinOsc ar (lfNoise1Id 'α' kr (6 + mce2 (randId 'β' (-4) 4) (randId 'γ' (-4) 4)) * 100 + 200) 0 * 0.1
| null | https://raw.githubusercontent.com/rd--/hsc3/60cb422f0e2049f00b7e15076b2667b85ad8f638/Help/Ugen/rand.help.hs | haskell | rand
rand | let f = randId 'α' 200 1200
l = randId 'β' (-1) 1
e = line kr 0.2 0 0.1 RemoveSynth
o = fSinOsc ar f 0
in pan2 (o * e) l 1
sinOsc ar (lfNoise1Id 'α' kr (6 + mce2 (randId 'β' (-4) 4) (randId 'γ' (-4) 4)) * 100 + 200) 0 * 0.1
|
d0d25ba3d0e4d804e54fdcc40ce241f3301f787b2f5738ce2e8315ae9f383795 | issuu/ppx_mysql | hello_world_with_identity.ml | (* This example assumes that a Mysql database 'test' exists for user 'root'.
* Moreover, a table 'users' defined as follows is also present in the DB:
*
* CREATE TABLE users
* (
* id INT NOT NULL,
* name TEXT NOT NULL,
* phone TEXT NULL,
* PRIMARY KEY (id)
* );
*)
open Mysql_with_... | null | https://raw.githubusercontent.com/issuu/ppx_mysql/bb9cc084c9b9422591fefefd7589255ae7d3b504/examples/hello_world_with_identity/hello_world_with_identity.ml | ocaml | This example assumes that a Mysql database 'test' exists for user 'root'.
* Moreover, a table 'users' defined as follows is also present in the DB:
*
* CREATE TABLE users
* (
* id INT NOT NULL,
* name TEXT NOT NULL,
* phone TEXT NULL,
* PRIMARY KEY (id)
* );
* Module implementing... |
open Mysql_with_identity
module Phone : Ppx_mysql_runtime.SERIALIZABLE with type t = string = struct
type t = string
let of_mysql str = if String.length str <= 9 then Ok str else Error "string too long"
let to_mysql str = str
end
type user = {
id : int32;
name : string;
phone : Phone.t option
}
let ... |
661cb1b46e67946fd0ad4ef174d3f31f7c749c1a170349155773dcaea82b07bb | UU-ComputerScience/uhc | NewtypeVoid1.hs | {- ----------------------------------------------------------------------------------------
what : Infinite _|_ (bottom) type via newtype
expected: ok
---------------------------------------------------------------------------------------- -}
module NewtypeVoid1 where
newtype Void = Void Void deriving Show
... | null | https://raw.githubusercontent.com/UU-ComputerScience/uhc/f2b94a90d26e2093d84044b3832a9a3e3c36b129/EHC/test/regress/99/NewtypeVoid1.hs | haskell | ----------------------------------------------------------------------------------------
what : Infinite _|_ (bottom) type via newtype
expected: ok
---------------------------------------------------------------------------------------- |
module NewtypeVoid1 where
newtype Void = Void Void deriving Show
v1 = Void undefined
v2 = undefined :: Void
f (Void v) = 1::Int
v3 = f v1
v4 = f v2
main :: IO ()
= do putStrLn (take 100 $ show v1)
putStrLn (take 100 $ show v2)
putStrLn (show v3)
putStrLn (show v4)
|
807afd5ccf0d2fecdccd7d77d9b3f6a20423aba6591dd785ee5a570563834660 | thephoeron/black-stone | circ-lifting.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : BLACK - STONE ; Base : 10 -*-
;;;; file: qclambda/circ-lifting.lisp
Copyright ( c ) 2013 - -2015 , " the Phoeron " < //thephoeron.com >
;;;; See LICENSE for additional information.
(in-package :black-stone)
EOF
| null | https://raw.githubusercontent.com/thephoeron/black-stone/c8f1d76d81de3c9862520c8ddac62e73e831ea55/qclambda/circ-lifting.lisp | lisp | Syntax : COMMON - LISP ; Package : BLACK - STONE ; Base : 10 -*-
file: qclambda/circ-lifting.lisp
See LICENSE for additional information. |
Copyright ( c ) 2013 - -2015 , " the Phoeron " < //thephoeron.com >
(in-package :black-stone)
EOF
|
c263c784a8ba77e64d743905343210e3be1e240a1170846c0c82aba1afba9b0d | 3b/3bgl-misc | state.lisp | (in-package #:scenegraph)
;;; cache of implementation limits and other runtime defined values
;; should be bound to a hash table while running state functions
(defvar *runtime-values-cache*)
;; map of 'canonicalized' list describing state -> state object
;; 'canonical' form is plist of non-default state values (inclu... | null | https://raw.githubusercontent.com/3b/3bgl-misc/e3bf2781d603feb6b44e5c4ec20f06225648ffd9/scenegraph/state.lisp | lisp | cache of implementation limits and other runtime defined values
should be bound to a hash table while running state functions
map of 'canonicalized' list describing state -> state object
'canonical' form is plist of non-default state values (including
:vertex-attrib-bindings and :fbo-bindings), sorted by key
sho... | (in-package #:scenegraph)
(defvar *runtime-values-cache*)
(defvar *known-states*)
(defun get-cached (key)
(assert (boundp '*runtime-values-cache*))
(or (gethash key *runtime-values-cache*)
(setf (gethash key *runtime-values-cache*)
(gl:get* key))))
(defparameter *enables*
'(:color-logic-op
... |
fcbcdfae534a8052ed6aa830ad889c9f63b99c60e8cebecfebab2a27f5cb82a5 | osa1/sc-plugin | Deeds.hs | module Supercompile.Evaluator.Deeds where
import Supercompile.StaticFlags
import Supercompile.Utilities
import Data.Monoid (Monoid(mappend, mempty))
| Number of unclaimed deeds . Invariant : always greater than or equal to 0
type Unclaimed = Int
-- | A deed supply shared amongst all expressions
data Deeds = Deed... | null | https://raw.githubusercontent.com/osa1/sc-plugin/1969ad81f16ca8ed8110ca8dadfccf6f3d463635/src/Supercompile/Evaluator/Deeds.hs | haskell | | A deed supply shared amongst all expressions
# UNPACK #
# UNPACK #
Try to avoid overflow :-)
that just causes some deeds to be released | module Supercompile.Evaluator.Deeds where
import Supercompile.StaticFlags
import Supercompile.Utilities
import Data.Monoid (Monoid(mappend, mempty))
| Number of unclaimed deeds . Invariant : always greater than or equal to 0
type Unclaimed = Int
data Deeds = Deeds {
} deriving (Eq)
instance Outputable Deeds w... |
6a44db6b0a782796bedbd629e1c93457953847ce2d344fa9f48cd05d3f9b9e19 | nuscr/nuscr | goenvs.mli | open! Base
open Names
open! Gonames
open Ltype
* Environment which keeps track of the package imports which which need to
be generated . Importing new packages multiple times does n't change the
environment , and importing two packages with the same name will result in
different package aliases being... | null | https://raw.githubusercontent.com/nuscr/nuscr/afef8aa7b0452e51b48cd101278512dcd7869b3b/lib/codegen/go/goenvs.mli | ocaml | * Import package 'messages/<protocol>'
* Import package 'channels/<protocol>'
* Import package 'results/<protocol>'
* Import package 'invitations'
* Import package 'callbacks'
* Import package 'roles'
* Import package 'sync'
* Generate all the Go import statements from the given environment
* Create a new empty enviro... | open! Base
open Names
open! Gonames
open Ltype
* Environment which keeps track of the package imports which which need to
be generated . Importing new packages multiple times does n't change the
environment , and importing two packages with the same name will result in
different package aliases being... |
88c422367974e653823bb329c7adf552b8e2b4dfb6fc4d5859b1cfe85b47fa15 | rmloveland/scheme48-0.53 | generate-c-header.scm | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
[ This is a kludge . is loathe to include it in the
; distribution. But now the system itself uses it, so we're stuck.]
; Reads arch.scm and data.scm and writes out a C .h file with constants
and macros for dealing with Scheme 48 data structures .
... | null | https://raw.githubusercontent.com/rmloveland/scheme48-0.53/1ae4531fac7150bd2af42d124da9b50dd1b89ec1/scheme/link/generate-c-header.scm | scheme | distribution. But now the system itself uses it, so we're stuck.]
Reads arch.scm and data.scm and writes out a C .h file with constants
Needs Big Scheme.
(make-c-header-file "scheme48.h" "scheme48.h.in"
"vm/arch.scm" "vm/data.scm" "rts/record.scm")
- becomes _ > becomes TO_ (so -> turns into ... | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
[ This is a kludge . is loathe to include it in the
and macros for dealing with Scheme 48 data structures .
(define (make-c-header-file c-file c-in-file arch-file data-file record-file)
(receive (stob-list stob-data exception-list channel-statu... |
4525ac0430245be02770f63ce2c1630060bef4fbe886c5803166115ce5b1ab18 | danabr/visualize.erl | process_analyser.erl | -module(process_analyser).
% External API
-export([start/0, stop/0, analyse/0, flow/0]).
% Analysis API
-export([spawn/1, spawn_link/1, send/2, register/2]).
-compile({no_auto_import,[spawn/1, spawn_link/1, register/2]}).
%%% External API
start() ->
Fun = fun() ->
erlang:register(process_analyser, self(... | null | https://raw.githubusercontent.com/danabr/visualize.erl/abf1d35a2dcbb274792e517c0e670c40688c162a/src/process_analyser/process_analyser.erl | erlang | External API
Analysis API
External API
Analysis API | -module(process_analyser).
-export([start/0, stop/0, analyse/0, flow/0]).
-export([spawn/1, spawn_link/1, send/2, register/2]).
-compile({no_auto_import,[spawn/1, spawn_link/1, register/2]}).
start() ->
Fun = fun() ->
erlang:register(process_analyser, self()),
loop(ets:new(process_analyser, [bag... |
1b71d60b5ee90d356967e4dfde59423329b0c7f8c1696484d88cc6bfedd3ac3c | tarides/current-albatross-deployer | stager.mli | (* Required to be able to stage a Current.t *)
module type S = sig
type t
val digest : t -> string
val marshal : t -> string
val unmarshal : string -> t
val pp : t Fmt.t
end
type 'a staged = {
live : 'a;
(* value kept alive by the stager *)
current : 'a; (* current value like if the stager didn't exis... | null | https://raw.githubusercontent.com/tarides/current-albatross-deployer/f4e7b88edf2c2d71a571178466d34048dad57bf7/example/stager.mli | ocaml | Required to be able to stage a Current.t
value kept alive by the stager
current value like if the stager didn't exist
promote the stages when the current has a value | module type S = sig
type t
val digest : t -> string
val marshal : t -> string
val unmarshal : string -> t
val pp : t Fmt.t
end
type 'a staged = {
live : 'a;
}
type activation
val activate : id:string -> unit Current.t -> activation Current.t
val stage_auto :
id:string ->
(module S with type t = 'a)... |
e9acbd6d63622d739167dbed1bbe82f8c777b8ffe7a929ab946c4fc5d3f4515c | tokiwoousaka/CatCat | TypeParser.hs | # LANGUAGE DeriveFunctor #
module Language.CatCat.Parser.TypeParser where
import Language.CatCat.Parser.Common
import Control.Applicative
import Data.Monoid
import Text.Trifecta
-------------------
-- Syntax tree
newtype TypeVarName = TypeVarName { getTypeVarName :: String }
deriving (Show, Read, Eq)
data TypeExpr ... | null | https://raw.githubusercontent.com/tokiwoousaka/CatCat/3ecc40781f70e48bbb9b4bede01afc8f1e1e2304/src/Language/CatCat/Parser/TypeParser.hs | haskell | -----------------
Syntax tree
-----------------
[test case]
parseTest (typeExpr <* eof) "^a, b . Forall c . a -> b -> c"
parseTest (typeExpr <* eof) "Forall a, b . a -> (a -> b) -> b"
parseTest (typeExpr <* eof) "^f . Forall a, b . (a -> b) -> f a -> f b"
-----------------
Util | # LANGUAGE DeriveFunctor #
module Language.CatCat.Parser.TypeParser where
import Language.CatCat.Parser.Common
import Control.Applicative
import Data.Monoid
import Text.Trifecta
newtype TypeVarName = TypeVarName { getTypeVarName :: String }
deriving (Show, Read, Eq)
data TypeExpr a
= TypeForall a (TypeExpr a)
... |
33e7f07c0582ff7b9c663ab8c4dabbf74e7fe27d8be3696a9383409922a4ffe5 | gfngfn/otfed | decodeTtf.mli |
open Value
open DecodeBasic
open DecodeOperation.Open
module Maxp : (module type of DecodeTtfMaxp)
val d_loca : num_glyphs:int -> Intermediate.loc_format -> glyph_id -> ((int * int) option) decoder
val loca : ttf_source -> glyph_id -> (Intermediate.Ttf.glyph_location option) ok
val d_glyph : length:int -> Ttf.glyp... | null | https://raw.githubusercontent.com/gfngfn/otfed/3c6d8ea0b05fc18a48cb423451da7858bf73d1d0/src/decodeTtf.mli | ocaml |
open Value
open DecodeBasic
open DecodeOperation.Open
module Maxp : (module type of DecodeTtfMaxp)
val d_loca : num_glyphs:int -> Intermediate.loc_format -> glyph_id -> ((int * int) option) decoder
val loca : ttf_source -> glyph_id -> (Intermediate.Ttf.glyph_location option) ok
val d_glyph : length:int -> Ttf.glyp... | |
fca07c88e065c6504e61373e6d907506f00d0a132e11a25946d99491d5f3f034 | McParen/croatoan | initscr.lisp | (in-package :de.anvi.croatoan)
(defun init-screen ()
"Initializes the curses mode. Returns the main window."
(ncurses:initscr))
(defun end-screen ()
"Clean shutdown of the curses display."
(ncurses:endwin))
(defgeneric closed-p (s)
(:documentation "Check whether the screen has been closed without a subsequ... | null | https://raw.githubusercontent.com/McParen/croatoan/413e8855b78a2e408f90efc38e8485f880691684/src/initscr.lisp | lisp | [ ] are files in lisp in newterm correctly represented by fd-s?
[ ] add type info either to the docs or in asserts.
[ ] document all possible return values and check for them. | (in-package :de.anvi.croatoan)
(defun init-screen ()
"Initializes the curses mode. Returns the main window."
(ncurses:initscr))
(defun end-screen ()
"Clean shutdown of the curses display."
(ncurses:endwin))
(defgeneric closed-p (s)
(:documentation "Check whether the screen has been closed without a subsequ... |
9c983eb86a7af883707ee888f21ab4dc29d0efb4a347547969aa6c1da252dd28 | ocsigen/js_of_ocaml | cSS.mli | Js_of_ocaml library
* /
* Copyright ( C ) 2010 * Laboratoire PPS - CNRS Université Paris Diderot
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking ex... | null | https://raw.githubusercontent.com/ocsigen/js_of_ocaml/58210fabc947c4839b6e71ffbbf353a4ede0dbb7/lib/js_of_ocaml/cSS.mli | ocaml | type the module is focused on
valid js representation of values of type t
conversion
conversion
*All about CSS colors. MDC documentation here:
. Specifications here:
-color/#svg-color .
*The colors by name.
*Gives the string equivalent of the argument.
*A color by name
*RBG channels are specified as a perc... | Js_of_ocaml library
* /
* Copyright ( C ) 2010 * Laboratoire PPS - CNRS Université Paris Diderot
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking ex... |
ae25f8bdfc75dc9df72d6af7f6bc99dc12d018dffcfe6f4c41ea0f4bc22e27b5 | tmcdonell/cuda | Ptr.hs | {-# LANGUAGE BangPatterns #-}
--------------------------------------------------------------------------------
-- |
-- Module : Foreign.CUDA.Ptr
Copyright : [ 2009 .. 2020 ]
-- License : BSD
--
-- Data pointers on the host and device. These can be shared freely between the
-- CUDA runtime and Driver APIs.
--
... | null | https://raw.githubusercontent.com/tmcdonell/cuda/b80e277845b63e85495a641a9af7070ed4c30937/src/Foreign/CUDA/Ptr.hs | haskell | # LANGUAGE BangPatterns #
------------------------------------------------------------------------------
|
Module : Foreign.CUDA.Ptr
License : BSD
Data pointers on the host and device. These can be shared freely between the
CUDA runtime and Driver APIs.
------------------------------------------------------... | Copyright : [ 2009 .. 2020 ]
module Foreign.CUDA.Ptr (
DevicePtr(..),
withDevicePtr,
devPtrToWordPtr,
wordPtrToDevPtr,
nullDevPtr,
castDevPtr,
plusDevPtr,
alignDevPtr,
minusDevPtr,
advanceDevPtr,
HostPtr(..),
withHostPtr,
nullHostPtr,
castHostPtr,
plusHostPtr,
alignHostPtr,
min... |
04476552013cf0a5ba49ea79d6c00d9b736a29496af8b1abed93c3c22c738a7e | fakedata-haskell/fakedata | Departed.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
module Faker.Provider.Departed where
import Config
import Control.Monad.Catch
import Data.Text (Text)
import Data.Vector (Vector)
import Data.Monoid ((<>))
import Data.Yaml
import Faker
import Faker.Internal
import Faker.Provider.TH
import Language.Haske... | null | https://raw.githubusercontent.com/fakedata-haskell/fakedata/7b0875067386e9bb844c8b985c901c91a58842ff/src/Faker/Provider/Departed.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TemplateHaskell #
module Faker.Provider.Departed where
import Config
import Control.Monad.Catch
import Data.Text (Text)
import Data.Vector (Vector)
import Data.Monoid ((<>))
import Data.Yaml
import Faker
import Faker.Internal
import Faker.Provider.TH
import Language.Haskell.TH
parseDeparted :: FromJSON a... |
306e18ed0a90e88484dc79ec8670207d2d76c477cc2cf2e5b0681359ce259056 | stathissideris/dali | project.clj | (defproject dali "1.0.2"
:description "A Clojure library for 2D graphics."
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
;;:pedantic? :abort
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/data.codec "0.1.0"]
[enlive "1.1.6"]
... | null | https://raw.githubusercontent.com/stathissideris/dali/97ebf43527fe76e838d7b6bb98a953db2747824d/project.clj | clojure | :pedantic? :abort | (defproject dali "1.0.2"
:description "A Clojure library for 2D graphics."
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/data.codec "0.1.0"]
[enlive "1.1.6"]
[prismati... |
0df440430103faf96fd0dac64a76dae39bf61a81aad84e8c70602d77af27ba13 | EasyCrypt/easycrypt | ecPhlHiBdHoare.ml | (* -------------------------------------------------------------------- *)
open EcUtils
open EcTypes
open EcFol
open EcEnv
open EcCoreGoal
open EcLowGoal
module TTC = EcProofTyping
(* -------------------------------------------------------------------- *)
let process_bdhoare_split info tc =
let hyps, concl = FApi.... | null | https://raw.githubusercontent.com/EasyCrypt/easycrypt/f87695472e70c313ef2966e20979b1afcc2e543e/src/phl/ecPhlHiBdHoare.ml | ocaml | --------------------------------------------------------------------
-------------------------------------------------------------------- | open EcUtils
open EcTypes
open EcFol
open EcEnv
open EcCoreGoal
open EcLowGoal
module TTC = EcProofTyping
let process_bdhoare_split info tc =
let hyps, concl = FApi.tc1_flat tc in
let (penv, qenv), pr, po =
match concl.f_node with
| FbdHoareS bhs ->
let hyps = LDecl.push_active bhs.bhs_m hyps in... |
707c2107533d159d81d8856a1e25e351c1fb1c7fb7603595482c2016992fd49f | BekaValentine/SimpleFP-v2 | Elaborator.hs | {-# OPTIONS -Wall #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
-- This module defines the core types of a monadic elaborator.
module Record.Unification.Elaborator where
import Utils.Env
import Utils.Unifier
import Utils.Vars
import Record.Core.ConSig
import Record.Core.Term
import qualified Cont... | null | https://raw.githubusercontent.com/BekaValentine/SimpleFP-v2/ae00ec809caefcd13664395b0ae2fc66145f6a74/src/Record/Unification/Elaborator.hs | haskell | # OPTIONS -Wall #
This module defines the core types of a monadic elaborator.
| A signature is a collection of constructors together with their
constructor signatures. This is used during type checking and elaboration
to define the underlying type theory.
| A definition consists of a declared name together with it... | # LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
module Record.Unification.Elaborator where
import Utils.Env
import Utils.Unifier
import Utils.Vars
import Record.Core.ConSig
import Record.Core.Term
import qualified Control.Lens as L
import Control.Monad.State
type Signature = [((String,String),C... |
f9b2022a52525c427f167e164b92befc3a98335c323492e89e740f2365ff6a5e | tonymorris/fp-course | Move.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
module TicTacToe.Move(
Move1
, AsMove1(_Move1)
, start
, Move2
, AsMove2(_Move2)
, move2
, Move3
, AsMove3(_Move3)
, move3
, Move4
, AsMove4(_Move4)
, move4
, Move5
, ... | null | https://raw.githubusercontent.com/tonymorris/fp-course/73a64c3d4d0df58654a1a9a0ee9d9b11c3818911/projects/TicTacToe/haskell/src/TicTacToe/Move.hs | haskell | # LANGUAGE GADTs # | # LANGUAGE NoImplicitPrelude #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
module TicTacToe.Move(
Move1
, AsMove1(_Move1)
, start
, Move2
, AsMove2(_Move2)
, move2
, Move3
, AsMove3(_Move3)
, move3
, Move4
, AsMove4(_Move4)
, move4
, Move5
, AsMove5(_Move5)
, Win5
... |
4d36233cc39a204a94e49f22cfd3dd8e4c3e7f0dbe6c59abadba2a8c226d6b30 | clojure-dus/chess | remote.cljs | (ns chess.client.remote
(:require [goog.net.XhrIo]))
see
(defn map->js [m]
(let [out (js-obj)]
(doseq [[k v] m]
(aset out (name k) v))
out))
(defn clj->js
"Recursively transforms ClojureScript maps into Javascript objects,
other ClojureScript colls into JavaScript arrays, and ClojureScript
... | null | https://raw.githubusercontent.com/clojure-dus/chess/7eb0e5bf15290f520f31e7eb3f2b7742c7f27729/src-cljs/chess/client/remote.cljs | clojure | (ns chess.client.remote
(:require [goog.net.XhrIo]))
see
(defn map->js [m]
(let [out (js-obj)]
(doseq [[k v] m]
(aset out (name k) v))
out))
(defn clj->js
"Recursively transforms ClojureScript maps into Javascript objects,
other ClojureScript colls into JavaScript arrays, and ClojureScript
... | |
3718305c4913f948d3cd78bb901b11696c5cfa017c8546f8c495a33a9446e81f | pkhuong/Napa-FFT3 | bblock.lisp | (in-package "NAPA-FFT.GEN")
;;; Basic block compiler.
(defstruct (vval
(:constructor %make-vval))
Var name
type ;; type
spills ;; available spill slots
dests ;; mandatory (write-once) destination slots
status ;; "current" locations
reads ;; sorted list of locations of ops that read this var
... | null | https://raw.githubusercontent.com/pkhuong/Napa-FFT3/f2d9614c7167da327c9ceebefb04ff6eae2d2236/bblock.lisp | lisp | Basic block compiler.
type
available spill slots
mandatory (write-once) destination slots
"current" locations
sorted list of locations of ops that read this var | (in-package "NAPA-FFT.GEN")
(defstruct (vval
(:constructor %make-vval))
Var name
)
(defun vval (type &key (stem "VAR"))
(%make-vval :name (gensym (coerce stem 'string))
:type type
:spills '()
:dests '()
:status '()
:reads '()))
... |
9f5cbdb787d65c9488d890eadc811c5b83dfbb05a90bc00f95604566d3d7916c | manuel-serrano/hop | make_lib.scm | ;*=====================================================================*/
* serrano / prgm / project / hop/2.5.x / hopscheme / make_lib.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation : ... | null | https://raw.githubusercontent.com/manuel-serrano/hop/481cb10478286796addd2ec9ee29c95db27aa390/hopscheme/make_lib.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* Last change : */
* ------------------------------------------------------------- */
* THe module used to buil... | * serrano / prgm / project / hop/2.5.x / hopscheme / make_lib.scm * /
* Author : * /
* Creation : Fri Aug 9 14:00:32 2013 * /
* Copyright : 2013 * /
(module __hopscheme_make... |
072b50465e59533e8cfa7dad8aa1d153b59a31794f0b4609aca486bfe6fe73a4 | S8A/htdp-exercises | ex276.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-reader.ss" "lang")((modname ex276) (read-case-sensitive #t) (teachpacks ((lib "batch-io.rkt" "teachpack" "2htdp") (lib "itune... | null | https://raw.githubusercontent.com/S8A/htdp-exercises/578e49834a9513f29ef81b7589b28081c5e0b69f/ex276.rkt | racket | about the language level of this file in a form that our tools can easily process.
Data examples :.
Functions :.
[List-of Track] -> Number
produces the total amount of play time for the given list of tracks
[List-of Track] -> [List-of String]
produces the list of all album titles from the given list of tracks
[... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-reader.ss" "lang")((modname ex276) (read-case-sensitive #t) (teachpacks ((lib "batch-io.rkt" "teachpack" "2htdp") (lib "itunes.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t ... |
fed6651145ca9fae781c531597da83774fa27650095199fe020b03492741829c | sneeuwballen/zipperposition | qle.mli |
This file is free software , part of Zipperposition . See file " license " for more details .
* { 1 Quasipure Literal Elimination }
open Logtk
open Libzipperposition
module type S = sig
module Env : Env.S
val setup : unit -> unit
end
module Make(E : Env.S) : S with module Env = E
val extension : Extensions.t... | null | https://raw.githubusercontent.com/sneeuwballen/zipperposition/333c4a5b0f8a726f414db901a77ca30921178da5/src/prover_calculi/qle.mli | ocaml |
This file is free software , part of Zipperposition . See file " license " for more details .
* { 1 Quasipure Literal Elimination }
open Logtk
open Libzipperposition
module type S = sig
module Env : Env.S
val setup : unit -> unit
end
module Make(E : Env.S) : S with module Env = E
val extension : Extensions.t... | |
4486975453b16ef536470af2336b61ea9992d5fcc3a2d1c083455f7b76baa9cb | macourtney/Dark-Exchange | has_panel.clj | (ns darkexchange.view.offer.has-panel
(:require [darkexchange.model.terms :as terms]
[darkexchange.view.offer.widgets :as offer-widgets]
[seesaw.core :as seesaw-core]))
(defn create []
(seesaw-core/horizontal-panel :id :has-panel :items
[(terms/i-have) [:fill-h 3] (offer-widgets/create-... | null | https://raw.githubusercontent.com/macourtney/Dark-Exchange/1654d05cda0c81585da7b8e64f9ea3e2944b27f1/src/darkexchange/view/offer/has_panel.clj | clojure | (ns darkexchange.view.offer.has-panel
(:require [darkexchange.model.terms :as terms]
[darkexchange.view.offer.widgets :as offer-widgets]
[seesaw.core :as seesaw-core]))
(defn create []
(seesaw-core/horizontal-panel :id :has-panel :items
[(terms/i-have) [:fill-h 3] (offer-widgets/create-... | |
3fc55e9d2b40e7200054f23ef56b86b439ad38819c0c092f1f2bb0e4d801dfdf | janestreet/bonsai | main.ml | open! Core
open! Bonsai_web
open Vdom
let brightness_suffix : Tailwind_colors.Brightness.t -> string = function
| `_50 -> "50"
| `_100 -> "100"
| `_200 -> "200"
| `_300 -> "300"
| `_400 -> "400"
| `_500 -> "500"
| `_600 -> "600"
| `_700 -> "700"
| `_800 -> "800"
| `_900 -> "900"
;;
let abs_positio... | null | https://raw.githubusercontent.com/janestreet/bonsai/782fecd000a1f97b143a3f24b76efec96e36a398/examples/tailwind_colors/main.ml | ocaml | open! Core
open! Bonsai_web
open Vdom
let brightness_suffix : Tailwind_colors.Brightness.t -> string = function
| `_50 -> "50"
| `_100 -> "100"
| `_200 -> "200"
| `_300 -> "300"
| `_400 -> "400"
| `_500 -> "500"
| `_600 -> "600"
| `_700 -> "700"
| `_800 -> "800"
| `_900 -> "900"
;;
let abs_positio... | |
30e00e3fbdc37e063ece1a09607163f5a227f7210d70a1283890c93d8a90db95 | haskell/hsc2hs | ATTParser.hs | -- A rather crude asm parser.
--
--
we only handle a subset of AT&T assembly
-- right now. This is what gcc and clang can
emit . For clang using might be
-- even better. For gcc gimple if that can
-- be consumed reliably somehow.
--
For now we 'll rely on the at&t assembly
-- to be sufficient for constants... | null | https://raw.githubusercontent.com/haskell/hsc2hs/59c5e82440633ff802b4888cfe91db6c038a17e9/src/ATTParser.hs | haskell | A rather crude asm parser.
right now. This is what gcc and clang can
even better. For gcc gimple if that can
be consumed reliably somehow.
to be sufficient for constants.
| turn @x@ and @(x)@ into @Ref x@.
| generalized @words@.
| process the assembly instructions, filtering out
identifiers and constant ... | we only handle a subset of AT&T assembly
emit . For clang using might be
For now we 'll rely on the at&t assembly
module ATTParser where
import Control.Applicative ((<|>))
import Data.Word (Word32, Word64)
import Data.Int (Int64)
import Data.Char (isDigit, isSpace)
import Data.Bits (shiftL, shiftR, (.|.))... |
05a1333f49c7cdf0589547627c36d2eb3421dbc8031802cb906c587f25791492 | ageneau/blossom | test_networkx.cljc | (ns blossom.test-networkx
(:require [blossom.max-weight-matching :as mwm]
[blossom.networkx :as networkx]
[blossom.primal-dual :as pdual]
[blossom.test-utils :as utils]
[blossom.specs]
[clojure.spec.alpha :as s]
#?(:clj [clojure.test :refer (is d... | null | https://raw.githubusercontent.com/ageneau/blossom/67a6a2bcc30776867fe16b4e79122e7f43e4928a/test/blossom/test_networkx.cljc | clojure | (ns blossom.test-networkx
(:require [blossom.max-weight-matching :as mwm]
[blossom.networkx :as networkx]
[blossom.primal-dual :as pdual]
[blossom.test-utils :as utils]
[blossom.specs]
[clojure.spec.alpha :as s]
#?(:clj [clojure.test :refer (is d... | |
f3665a2c23a466bacaea8fa0e8dd52e6de89d073607fb7059f693ab7225ca1fb | ArulselvanMadhavan/mini_dalle | npz_ex.ml | (* open Base *)
open! Torch
let read_npy dir_path name =
match Npy.read_copy (dir_path ^ "/" ^ name) with
| Npy.P tensor ->
(match Bigarray.Genarray.layout tensor with
| Bigarray.C_layout ->
Filename.remove_extension name, Torch.Tensor.of_bigarray tensor
| Bigarray.Fortran_layout -> failwith "... | null | https://raw.githubusercontent.com/ArulselvanMadhavan/mini_dalle/7bddf9e3a46b6f6e864d5c7f639b4daafc53041b/examples/npz_ex.ml | ocaml | open Base | open! Torch
let read_npy dir_path name =
match Npy.read_copy (dir_path ^ "/" ^ name) with
| Npy.P tensor ->
(match Bigarray.Genarray.layout tensor with
| Bigarray.C_layout ->
Filename.remove_extension name, Torch.Tensor.of_bigarray tensor
| Bigarray.Fortran_layout -> failwith "fortran layout n... |
e7ced73d631870b6fd3b86a9cae45c2418b6c348bc516ff5f231cbeea788986d | ralexstokes/stoken | queue.clj | (ns io.stokes.queue
(:require [clojure.core.async :as async]))
(defn new []
(async/chan))
(def ^:private tag :tag)
(defn dispatch [msg & rest]
(tag msg))
(defn submit [queue work]
(async/go
(async/>! queue work))
nil)
(defn- with-tag
([key] {tag key})
([key msg]
{tag key
key msg}))
(defn ... | null | https://raw.githubusercontent.com/ralexstokes/stoken/b88adb36ffa1e9f3099925634eb1f98beb986442/src/io/stokes/queue.clj | clojure | (ns io.stokes.queue
(:require [clojure.core.async :as async]))
(defn new []
(async/chan))
(def ^:private tag :tag)
(defn dispatch [msg & rest]
(tag msg))
(defn submit [queue work]
(async/go
(async/>! queue work))
nil)
(defn- with-tag
([key] {tag key})
([key msg]
{tag key
key msg}))
(defn ... | |
66ae77ab969d4882b0e9ae3bfcef96ad9dc2a794c067e2c9aa2a5e404499a2f2 | logseq/logseq | drawer.cljs | (ns ^:no-doc frontend.util.drawer
(:require [clojure.string :as string]
[frontend.util :as util]
[logseq.graph-parser.mldoc :as gp-mldoc]
[logseq.graph-parser.property :as gp-property]
[frontend.format.mldoc :as mldoc]))
(defn drawer-start
[typ]
(util/format ":%s:"... | null | https://raw.githubusercontent.com/logseq/logseq/9c7b4ea2016fb28b16ee42a7136c73dd52d8ce4b/src/main/frontend/util/drawer.cljs | clojure | TODO: DRY | (ns ^:no-doc frontend.util.drawer
(:require [clojure.string :as string]
[frontend.util :as util]
[logseq.graph-parser.mldoc :as gp-mldoc]
[logseq.graph-parser.property :as gp-property]
[frontend.format.mldoc :as mldoc]))
(defn drawer-start
[typ]
(util/format ":%s:"... |
6d0dd89cbf5f991f11747236d1180c2ffe38c32780881810b016ca255b928bda | plumatic/grab-bag | publisher.clj | (ns kinesis.publisher
"Namespace for anyc publishing to kinesis."
(:use plumbing.core)
(:require
[plumbing.error :as err]
[plumbing.graph :as graph]
[plumbing.logging :as log]
[plumbing.parallel :as parallel]
[plumbing.resource :as resource]
[plumbing.streaming-map :as streaming-map]
[aws.kin... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/kinesis/src/kinesis/publisher.clj | clojure |
Private helpers
Public | (ns kinesis.publisher
"Namespace for anyc publishing to kinesis."
(:use plumbing.core)
(:require
[plumbing.error :as err]
[plumbing.graph :as graph]
[plumbing.logging :as log]
[plumbing.parallel :as parallel]
[plumbing.resource :as resource]
[plumbing.streaming-map :as streaming-map]
[aws.kin... |
21b502e5fe2e2f526d5f171b5dcb5d523029b045350be33fd37e48216542610b | haroldcarr/learn-haskell-coq-ml-etc | X.hs | module X where
--
import Control.Monad
import Control.Concurrent
import Control.Concurrent.STM
-- this will always print 0 for before and after
because it adds 2 10 times and subtracts 1 20 times
main :: IO ()
main = do
shared <- atomically $ newTVar (0::Int)
showTVarIO shared "Before"
_ <- forkIO $ 10 `re... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/topic/concurrency/src/X.hs | haskell |
this will always print 0 for before and after | module X where
import Control.Monad
import Control.Concurrent
import Control.Concurrent.STM
because it adds 2 10 times and subtracts 1 20 times
main :: IO ()
main = do
shared <- atomically $ newTVar (0::Int)
showTVarIO shared "Before"
_ <- forkIO $ 10 `replicateM_` (appV (2 +) shared >> milliSleep... |
3c4a6c578ea8ebbafc22289ed96c9215c05bb530d1b3cf2a5707b4fc82bda734 | UU-ComputerScience/js-asteroids | KeyEvent.hs | # LANGUAGE StandaloneDeriving , TypeSynonymInstances , FlexibleInstances , MultiParamTypeClasses , DeriveDataTypeable #
module Graphics.UI.WXCore.KeyEvent (
module Graphics.UI.WXCore.KeyEventClass
,keyEvent
) where
import LightOO
import Graphics.UI.WXCore.Types
import Graphics.UI.WXCore.KeyEventClass
import Gra... | null | https://raw.githubusercontent.com/UU-ComputerScience/js-asteroids/b7015d8ad4aa57ff30f2631e0945462f6e1ef47a/wxasteroids/src/Graphics/UI/WXCore/KeyEvent.hs | haskell | # LANGUAGE StandaloneDeriving , TypeSynonymInstances , FlexibleInstances , MultiParamTypeClasses , DeriveDataTypeable #
module Graphics.UI.WXCore.KeyEvent (
module Graphics.UI.WXCore.KeyEventClass
,keyEvent
) where
import LightOO
import Graphics.UI.WXCore.Types
import Graphics.UI.WXCore.KeyEventClass
import Gra... | |
c9c85d1855c1b0b6c5e74fe89d2e37835b73a31f0c27631c7f07be8e521fd30d | justinethier/cyclone | flatten-seq.scm | (import (scheme base) (scheme write) (scheme cyclone util) (scheme cyclone pretty-print))
(define sexp
'(Cyc-seq
(set! b '(#f . #f))
(Cyc-seq
(set-car! a 1)
(Cyc-seq
(set-cdr! a '(2))
((fnc a1 a2 a3))))))
;; Flatten a list containing subcalls of a ... | null | https://raw.githubusercontent.com/justinethier/cyclone/a1c2a8f282f37ce180a5921ae26a5deb04768269/tests/debug/flatten-seq.scm | scheme | Flatten a list containing subcalls of a given symbol.
For example, the expression:
'(Cyc-seq
(set! b '(#f . #f))
(Cyc-seq
(Cyc-seq
((fnc a1 a2 a3)))))
becomes:
'(Cyc-seq
(set! b '(#f . #f))
((fnc a1 a2 a3)))
(pair? sexp) | (import (scheme base) (scheme write) (scheme cyclone util) (scheme cyclone pretty-print))
(define sexp
'(Cyc-seq
(set! b '(#f . #f))
(Cyc-seq
(set-car! a 1)
(Cyc-seq
(set-cdr! a '(2))
((fnc a1 a2 a3))))))
( set - car ! a 1 )
... |
01e2baf4ea84a10cad74ebe6574d904827aa9a571d22238be67b34be2a322f30 | semperos/rankle | core.clj | Distributed under the Eclipse Public License either version 1.0 or ( at your option ) any later version .
;; Copyright -clj
(ns fsm-clj.core
(:require [fsm-clj.parser :as p]
[dorothy.core :as dot]
[dorothy.jvm :as dj]))
(defn- set-state [fsm state]
(if ((->> fsm :transitions keys (into #{... | null | https://raw.githubusercontent.com/semperos/rankle/d898c144e33056d743848620f17564d88d87e874/src/fsm_clj/core.clj | clojure | Copyright -clj | Distributed under the Eclipse Public License either version 1.0 or ( at your option ) any later version .
(ns fsm-clj.core
(:require [fsm-clj.parser :as p]
[dorothy.core :as dot]
[dorothy.jvm :as dj]))
(defn- set-state [fsm state]
(if ((->> fsm :transitions keys (into #{})) state)
(as... |
4f724f3b5c2d12448e1aba777f3d0d8851a93902376bf6c8d1cfda877ea037d3 | charlieg/Sparser | constant1.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
copyright ( c ) 1990 Content Technologies Inc.
copyright ( c ) 1992,1993 -- all rights reserved
;;;
;;; File: "constant"
;;; Module: "objects;words:"
Version : 1.1 February 1992
initiated 12/90
1.1 ( 2/1/92 v2.2 ) completely red... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/objects/chart/words/lookup/constant1.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
File: "constant"
Module: "objects;words:"
the word.
-----------------------------
setting up the unknown word
-----------------------------
---------------------------------------
the routine called from the tokenizer
---------------------------... | copyright ( c ) 1990 Content Technologies Inc.
copyright ( c ) 1992,1993 -- all rights reserved
Version : 1.1 February 1992
initiated 12/90
1.1 ( 2/1/92 v2.2 ) completely redid the technique for doing
(in-package :sparser)
(defparameter *the-unknown-word*
(let* ((w-symbol (intern "UNKNOWN-... |
3dd8cbcff8ef32a1e1a9b1a2a0dab9e9bceafe14f13c3f1be856b8d84d063112 | degree9/enterprise | indexed_db.cljs | (ns degree9.indexed-db
(:require [degree9.browser.indexed-db :as idb]))
(defn get-result [event]
(:result (:target event)))
(defn get-version [event]
[(:oldVersion event) (:newVersion event)])
(defn object-store= [req store key]
(let [idb (j/cell nil)
ostore (j/cell nil)
ostore! (partial rese... | null | https://raw.githubusercontent.com/degree9/enterprise/65737c347e513d0a0bf94f2d4374935c7270185d/src/degree9/indexed_db.cljs | clojure | (ns degree9.indexed-db
(:require [degree9.browser.indexed-db :as idb]))
(defn get-result [event]
(:result (:target event)))
(defn get-version [event]
[(:oldVersion event) (:newVersion event)])
(defn object-store= [req store key]
(let [idb (j/cell nil)
ostore (j/cell nil)
ostore! (partial rese... | |
56a771c718dbe0783e7338143325ad2f6fda846c8ba8efc436d01fea36192348 | racket/web-server | web.rkt | #lang racket/base
(require racket/match
net/url
racket/contract
racket/serialize
web-server/servlet/servlet-structs
web-server/http
web-server/managers/manager
web-server/private/define-closure
web-server/private/servlet
web-server/... | null | https://raw.githubusercontent.com/racket/web-server/f718800b5b3f407f7935adf85dfa663c4bba1651/web-server-lib/web-server/lang/web.rkt | racket | These contracts interfere with the continuation safety marks
(provide/contract
initial-servlet : (request -> response) -> (request -> can-be-response?)
Try to decode a continuation from the request,
or, use the start procedure to initialize a session
send/suspend/hidden: (url input-field -> response) -> request
l... | #lang racket/base
(require racket/match
net/url
racket/contract
racket/serialize
web-server/servlet/servlet-structs
web-server/http
web-server/managers/manager
web-server/private/define-closure
web-server/private/servlet
web-server/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.