_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 |
|---|---|---|---|---|---|---|---|---|
d2b9fdecfc74dfcfb93eeeb492209efa8a7a7b3a6b3f3391af81a8cfea24c34f | bschwb/cis194-solutions | Lecture.hs | # OPTIONS_GHC -Wall #
module Lecture where
import Control.Applicative
type Name = String
data Employee = Employee { name :: Name
, phone :: String }
deriving Show
{-instance Applicative Maybe where-}
{-pure = Just-}
{-Nothing <*> _ = Nothing-}
{-_ <*... | null | https://raw.githubusercontent.com/bschwb/cis194-solutions/e79f96083b6edbfed18a2adbc749c41d196d8ff7/10-applicative-functors-part1/Lecture.hs | haskell | instance Applicative Maybe where
pure = Just
Nothing <*> _ = Nothing
_ <*> Nothing = Nothing
Just f <*> Just x = Just (f x) | # OPTIONS_GHC -Wall #
module Lecture where
import Control.Applicative
type Name = String
data Employee = Employee { name :: Name
, phone :: String }
deriving Show
m_name1, m_name2 :: Maybe Name
m_name1 = Nothing
m_name2 = Just "Brent"
m_phone1, m_phone2 :: Maybe String
m... |
3977eba8a6f9c0229be218abaefb60a58605f6c067881b60c515751ce32a8db3 | zkat/sheeple | reply-dispatch.lisp | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;;
;;;; This file is part of Sheeple
;;;; tests/reply-dispatch.lisp
;;;;
;;;; Unit tests for reply-dispatch and replies
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package :sheeple)
(def-suite reply-comb... | null | https://raw.githubusercontent.com/zkat/sheeple/5393c74737ccf22c3fd5f390076b75c38453cb04/tests/reply-dispatch.lisp | lisp | -*- Mode: lisp; indent-tabs-mode: nil -*-
This file is part of Sheeple
tests/reply-dispatch.lisp
Unit tests for reply-dispatch and replies
other dispatch stuff |
(in-package :sheeple)
(def-suite reply-combination :in messages)
(in-suite reply-combination)
(defmacro with-flag-stack (&body body)
(with-gensyms (stack)
`(let (,stack)
(declare (ignorable ,stack))
(flet ((flag (tag)
(nconcf ,stack (list tag)))
(check (reason &rest ... |
eb6921e1f77fd9c6246127faf2b3c95e811494be9fc0c180d3e2ca90e16f241d | scrintal/heroicons-reagent | inbox_stack.cljs | (ns com.scrintal.heroicons.solid.inbox-stack)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M1.5 9.832v1.793c0 1.036.84 1.875 1.875 1.875h17.25c1.035 0 1.875-.84 1.875-1.... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/solid/inbox_stack.cljs | clojure | (ns com.scrintal.heroicons.solid.inbox-stack)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M1.5 9.832v1.793c0 1.036.84 1.875 1.875 1.875h17.25c1.035 0 1.875-.84 1.875-1.... | |
7b7862d836b32069a92465a204c4ceb9ff158203e2924ee79e47f8f223835a44 | input-output-hk/plutus-apps | Types.hs | {-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DerivingVia #-}
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE LambdaCase #
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE Strict #-}
# LANGUAGE Temp... | null | https://raw.githubusercontent.com/input-output-hk/plutus-apps/b80116b9dd97e83b61f016924f83ad4284212796/plutus-chain-index-core/src/Plutus/ChainIndex/Types.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE DerivingVia #
# LANGUAGE GADTs #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
# LANGUAGE Strict #
| Misc. types used in this package
** Lenses
Since lang is a GADT we have to encode the script in all branches
| List of outputs o... | # LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# OPTIONS_GHC -Wno - orphans #
module Plutus.ChainIndex.Types(
ChainIndexTx(..)
, ChainIndexTxOutputs(..)
, ChainIndexTxOut(..)
, ReferenceScri... |
8f59f2cf228a2b7c3c981aff715571e53765687d476b4d1fc4b9d56f093b8b05 | buildsome/buildsome | SyncMap.hs | # LANGUAGE TupleSections #
module Lib.SyncMap
( SyncMap
, Inserted(..)
, Result
, toMap
, tryInsert
, insert
, new
) where
import Prelude.Compat
import Control.Concurrent.MVar
import qualified Control.Exception as E
import Control.Monad (join)
impo... | null | https://raw.githubusercontent.com/buildsome/buildsome/479b92bb74a474a5f0c3292b79202cc850bd8653/src/Lib/SyncMap.hs | haskell |
If an exception occurred during the synchronous update, it will be returned in the `Result`.
If blocking operations are used in the action, it is the user's
exception as a result!
| # LANGUAGE TupleSections #
module Lib.SyncMap
( SyncMap
, Inserted(..)
, Result
, toMap
, tryInsert
, insert
, new
) where
import Prelude.Compat
import Control.Concurrent.MVar
import qualified Control.Exception as E
import Control.Monad (join)
impo... |
6c2b577ea1277f4398d03a790c4aeba3ebe9404b066a6466fa602250d8545d5d | lfe/lfe | lfe_io_pretty.erl | Copyright ( c ) 2008 - 2021
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
distributed... | null | https://raw.githubusercontent.com/lfe/lfe/c1c0364bbf4f69df56c961561835e08b53439c67/src/lfe_io_pretty.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright ( c ) 2008 - 2021
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
Author :
Purpose : Pretty printer for Lisp Flavoured Erlang .
-module(lfe_io_pretty).
-export([term/1,term/2,term/3,term/4]).
-export(... |
260bd1863921b0858bb3717585cae178cf511f06f7aa55f5232422a235708544 | lispnik/cl-http | pre-cl-http.lisp | -*- Mode : LISP ; Syntax : Ansi - common - lisp ; Package : CL - USER ; Base : 10 -*-
(in-package "CL-USER")
(defparameter *private-patches-directory*
(or #+LispWorks3.2
"~/LispWorks/private-patches/"
#+(and LispWorks4.0 Harlequin-PC-Lisp)
"z:/pcl-release/pcl/local/images/uninstalled-patches/"
... | null | https://raw.githubusercontent.com/lispnik/cl-http/84391892d88c505aed705762a153eb65befb6409/lw/pre-cl-http.lisp | lisp | Syntax : Ansi - common - lisp ; Package : CL - USER ; Base : 10 -*-
last chance guess |
(in-package "CL-USER")
(defparameter *private-patches-directory*
(or #+LispWorks3.2
"~/LispWorks/private-patches/"
#+(and LispWorks4.0 Harlequin-PC-Lisp)
"z:/pcl-release/pcl/local/images/uninstalled-patches/"
))
(pushnew :CLIM-SYS *features*)
MJS 27Oct99 : ca n't push : multi - threaded... |
be1a3a8e1a93ba0339afc2e2c99dab1f0dc0241bb3d7e02326564a859bb839b2 | bcc32/advent-of-code | circle.ml | open! Core
open! Async
open! Import
type 'a t =
{ value : 'a
; mutable prev : 'a t
; mutable next : 'a t
}
let create value =
let rec t = { value; prev = t; next = t } in
t
;;
let insert_after t x =
let node = { value = x; prev = t; next = t.next } in
t.next.prev <- node;
t.next <- node;
node
;;
... | null | https://raw.githubusercontent.com/bcc32/advent-of-code/653c0f130e2fb2f599d4e76804e02af54c9bb19f/2018/09/circle.ml | ocaml | open! Core
open! Async
open! Import
type 'a t =
{ value : 'a
; mutable prev : 'a t
; mutable next : 'a t
}
let create value =
let rec t = { value; prev = t; next = t } in
t
;;
let insert_after t x =
let node = { value = x; prev = t; next = t.next } in
t.next.prev <- node;
t.next <- node;
node
;;
... | |
b01baa4c1388669c90be94d8f8ea0665102b3d4341c2701fb8c62b376ba75af5 | ptal/AbSolute | interval_view_dbm.mli | Copyright 2019
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 ; either
version 3 of the License , or ( at your option ) any later version .
This program is distr... | null | https://raw.githubusercontent.com/ptal/AbSolute/469159d87e3a717499573c1e187e5cfa1b569829/src/domains/octagon/interval_view_dbm.mli | ocaml | Copyright 2019
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 ; either
version 3 of the License , or ( at your option ) any later version .
This program is distr... | |
c56197fcec453ff9350569908ea6e52100f1a68d0317e968f40bd2e3ab13f830 | jarohen/simple-brepl | plugin.clj | (ns simple-brepl.plugin
(:require [clojure.java.io :as io]
[robert.hooke :refer [add-hook]]
[leiningen.core.eval :as eval]))
(defn with-core-dep [project]
(update-in project [:dependencies]
conj
['jarohen/simple-brepl-core (.trim (slurp (io/resource "simple_brepl/V... | null | https://raw.githubusercontent.com/jarohen/simple-brepl/01169c5f650e768f8f65df238d452afa099537f7/simple-brepl/src/simple_brepl/plugin.clj | clojure | (ns simple-brepl.plugin
(:require [clojure.java.io :as io]
[robert.hooke :refer [add-hook]]
[leiningen.core.eval :as eval]))
(defn with-core-dep [project]
(update-in project [:dependencies]
conj
['jarohen/simple-brepl-core (.trim (slurp (io/resource "simple_brepl/V... | |
3ca83a83aed03230333e5ac9625fadbbc548e0a738237e64237ba9f5560b8b9f | clojerl/clojerl | clojerl_String_SUITE.erl | -module(clojerl_String_SUITE).
-include("clojerl.hrl").
-include("clj_test_utils.hrl").
-export([ all/0
, init_per_suite/1
, end_per_suite/1
]).
-export([ append/1
, count/1
, index_of/1
, is_whitespace/1
, last_index_of/1
, join/1
, to_lower/1
... | null | https://raw.githubusercontent.com/clojerl/clojerl/aa35847ca64e1c66224867ca4c31ca6de95bc898/test/clojerl_String_SUITE.erl | erlang | ------------------------------------------------------------------------------
Test Cases
------------------------------------------------------------------------------ | -module(clojerl_String_SUITE).
-include("clojerl.hrl").
-include("clj_test_utils.hrl").
-export([ all/0
, init_per_suite/1
, end_per_suite/1
]).
-export([ append/1
, count/1
, index_of/1
, is_whitespace/1
, last_index_of/1
, join/1
, to_lower/1
... |
dc4e686658b21c0794855ad495b9b78b845669887f100c6a0db9b33f6e194ad5 | hanshuebner/bos | import.lisp | (in-package :bos.m2)
(defclass importer ()
((sponsor :accessor importer-sponsor)
(price :accessor importer-price)
(date :accessor importer-date)
(m2s :accessor importer-m2s)
(area-active-p :accessor importer-area-active-p)
(area-y :accessor importer-area-y)
(area-vertices :accessor importer-area-ve... | null | https://raw.githubusercontent.com/hanshuebner/bos/ab5944cc46f4a5ff5a08fd8aa4d228c0f9cfc771/m2/import.lisp | lisp | (in-package :bos.m2)
(defclass importer ()
((sponsor :accessor importer-sponsor)
(price :accessor importer-price)
(date :accessor importer-date)
(m2s :accessor importer-m2s)
(area-active-p :accessor importer-area-active-p)
(area-y :accessor importer-area-y)
(area-vertices :accessor importer-area-ve... | |
c722c7a54be0ec0711306442e9707c06ab8518df80de966907a6905ed2d70b4b | xapi-project/xen-api | xapi_message.ml |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* 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 ; version 2.1 only . with the special
* exception on linking describe... | null | https://raw.githubusercontent.com/xapi-project/xen-api/48cc1489fff0e344246ecf19fc1ebed6f09c7471/ocaml/xapi/xapi_message.ml | ocaml | * Module that defines API functions for Message objects
* @group XenAPI functions
* Message store
We use a filesystem based 'database':
* Base directory: /var/lib/xcp/blobs/messages
* All messages go in there, filename=timestamp
*
* Symlinks are created to the messages for fast indexing:
* /var/lib/xcp/blo... |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* 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 ; version 2.1 only . with the special
* exception on linking describe... |
dbdf1e9f4c17d6a255a44b81b2eafb61536775808403b70a0afa183f1b955aac | herd/herdtools7 | CParseTest.mli | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/574c59e111deda09afbba1f2bdd94353f437faaf/herd/CParseTest.mli | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2023 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
bcd97b91c7d699da5fb592ec47c9fe5a4b542e1d309e923da2da5688508a701d | bobzhang/fan | fors.ml | for a = 3 to 10 do
let u = 4;
print_int a;
print_int u;
done;
let a = ref 3;
while !a >0 do
let u = 3;
decr a;
print_int u;
print_newline ();
done;
| null | https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/todoml/testr/fors.ml | ocaml | for a = 3 to 10 do
let u = 4;
print_int a;
print_int u;
done;
let a = ref 3;
while !a >0 do
let u = 3;
decr a;
print_int u;
print_newline ();
done;
| |
9782ca7cfe38af500f9657ffb8dfb5ee07af5f32431dbab57321c93f37156404 | elastic/eui-cljs | icon_pause.cljs | (ns eui.icon-pause
(:require ["@elastic/eui/lib/components/icon/assets/pause.js" :as eui]))
(def pause eui/icon)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/icon_pause.cljs | clojure | (ns eui.icon-pause
(:require ["@elastic/eui/lib/components/icon/assets/pause.js" :as eui]))
(def pause eui/icon)
| |
445aab171afdf312e923ca013796ae3a00f0d745b446a69d7288971342a692d1 | zeniuseducation/poly-euler | five.clj | (ns alfa.five
(:require
[clojure.string :as cs]
[alfa.common :refer :all]
[clojure.set :refer [intersection difference]]))
(defn run [f & args]
(dotimes [i 5]
(let [res (time (apply f args))]
(println res))))
(defn ^long p50 [^long lim]
(let [refs (boolean-array lim true)
llim (inc (i... | null | https://raw.githubusercontent.com/zeniuseducation/poly-euler/734fdcf1ddd096a8730600b684bf7398d071d499/Alfa/src/alfa/five.clj | clojure | (ns alfa.five
(:require
[clojure.string :as cs]
[alfa.common :refer :all]
[clojure.set :refer [intersection difference]]))
(defn run [f & args]
(dotimes [i 5]
(let [res (time (apply f args))]
(println res))))
(defn ^long p50 [^long lim]
(let [refs (boolean-array lim true)
llim (inc (i... | |
0781c57ce79526179644a03e54221133384ef0c98594e010f36f0c9458e4ecd3 | yav/hobbit | Ents.hs | module ModSys.Ents
( Entity(..),owns,isCon -- for module system (only need Entity type)
, EntType(..), origName, isType -- for compiler
) where
import AST.Type
import qualified Data.Set as Set
-- interface of the module system to the concrete type of entities
data Entity = Entity
... | null | https://raw.githubusercontent.com/yav/hobbit/31414ba1188f4b39620c2553b45b9e4d4aa40169/src/ModSys/Ents.hs | haskell | for module system (only need Entity type)
for compiler
interface of the module system to the concrete type of entities | module ModSys.Ents
) where
import AST.Type
import qualified Data.Set as Set
data Entity = Entity
{ definedIn :: ModName
, name :: Name
, entType :: EntType } deriving Eq
data EntType = Value | Constr | Type (Set.Set Entity)
owns ... |
57399d1521d1344298ab25e342cefc308cdc06f832f464225c9ef63859e06afb | cac-t-u-s/om-sharp | midi-out.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/deafab18e2f08d39244706dc355bc6e941449a7c/src/packages/midi/tools/midi-out.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)
PITCHBEND & PITCHWHEEL
(defmethod* pitchwheel ((val number) (chans number) &optional port)
:icon :midi-out
:indoc '("pitch wheel value(s)" "MIDI channel(s) (1-16)" "output port number")
:initvals '(8192 1 nil)
:doc "Sends one or more MIDI pitch wheel message(s) of <vals... |
fa71c93495194e2e9450916db2ca3fccc85dffbf0aefbd939ee27d32ef0edd53 | alanz/ghc-exactprint | Dump.hs |
Temporary copy of the GHC.Hs . Dump module , modified to show DeltaPos
hacked into a SrcSpan .
Temporary copy of the GHC.Hs.Dump module, modified to show DeltaPos
hacked into a SrcSpan.
-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
module Language.Haskell.GHC.ExactPrint.Dump (
-- * Du... | null | https://raw.githubusercontent.com/alanz/ghc-exactprint/3b36f5d0a498e31d882fe111304b2cf5ca6cad22/src/Language/Haskell/GHC/ExactPrint/Dump.hs | haskell | # LANGUAGE RankNTypes #
* Dumping ASTs
out, to avoid comparing locations, only structure
Eliminate word-size dependence
-------------------------
------------------------- |
Temporary copy of the GHC.Hs . Dump module , modified to show DeltaPos
hacked into a SrcSpan .
Temporary copy of the GHC.Hs.Dump module, modified to show DeltaPos
hacked into a SrcSpan.
-}
# LANGUAGE ScopedTypeVariables #
module Language.Haskell.GHC.ExactPrint.Dump (
showAstData,
BlankSrcSpan(.... |
cfa03693a892622d6d7db4627c11b3accd10b1fa189ee1a7cfa5b9b81358a400 | libguestfs/virt-v2v | changeuid.ml | virt - v2v
* Copyright ( C ) 2009 - 2020 Red Hat Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later ... | null | https://raw.githubusercontent.com/libguestfs/virt-v2v/8ad152afc4dced17e26b40d3fe8f585da99c8816/output/changeuid.ml | ocaml | Functions for making files and directories as another user.
Child.
Parent. | virt - v2v
* Copyright ( C ) 2009 - 2020 Red Hat Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later ... |
0a1f91b3517e07006ef1ceda6df17d62f4549e5c61ddb42087024c3ce2572894 | yetanalytics/dave | lrs.cljc | (ns com.yetanalytics.dave.workbook.data.lrs
(:require
[clojure.spec.alpha :as s]
[com.yetanalytics.dave.util.spec :as su]
[xapi-schema.spec.resources :as xsr]
[com.yetanalytics.dave.workbook.data.lrs.auth :as auth]))
(s/def ::query
:xapi.statements.GET.request/params)
(s/def ::more
:xapi.statements.... | null | https://raw.githubusercontent.com/yetanalytics/dave/7a71c2017889862b2fb567edc8196b4382d01beb/src/com/yetanalytics/dave/workbook/data/lrs.cljc | clojure | (ns com.yetanalytics.dave.workbook.data.lrs
(:require
[clojure.spec.alpha :as s]
[com.yetanalytics.dave.util.spec :as su]
[xapi-schema.spec.resources :as xsr]
[com.yetanalytics.dave.workbook.data.lrs.auth :as auth]))
(s/def ::query
:xapi.statements.GET.request/params)
(s/def ::more
:xapi.statements.... | |
b440ae783d7d610610b9ae4a4d6ec55227b141bdbab2b1623dab7c5bdefc3521 | cl-rabbit/cl-bunny | channel-id-allocator.lisp | (in-package :cl-bunny)
(defstruct channel-id-allocator
(int-allocator)
(mutex))
(defun new-channel-id-allocator (max-channels)
(make-channel-id-allocator :int-allocator (make-int-allocator :min 1 :max max-channels)
:mutex (bt:make-lock "Channel Id Allocator Lock")))
(defun next-cha... | null | https://raw.githubusercontent.com/cl-rabbit/cl-bunny/6da7fe161efc8d6bb0b8b09ac8efad03553d765c/src/support/channel-id-allocator.lisp | lisp | (in-package :cl-bunny)
(defstruct channel-id-allocator
(int-allocator)
(mutex))
(defun new-channel-id-allocator (max-channels)
(make-channel-id-allocator :int-allocator (make-int-allocator :min 1 :max max-channels)
:mutex (bt:make-lock "Channel Id Allocator Lock")))
(defun next-cha... | |
f63c5680a02448ae94118f4b406dc7bc48ce1a2b8fd42defd5c746cd7ff98964 | ml4tp/tcoq | inductiveops.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/ml4tp/tcoq/7a78c31df480fba721648f277ab0783229c8bece/pretyping/inductiveops.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* Return type as quoted by the user ... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Term
open Dec... |
aaf2a75caae4461cbfc228160fdd37ae9bec3a75f993fe5c0a3082badb0e6bc5 | mlin/ocaml-sqlite3EZ | sqlite3EZ.ml | open List
open Sqlite3
module Rc = Sqlite3.Rc
module Data = Sqlite3.Data
exception Rc of Rc.t
exception Finally of exn*exn
let check_rc = function
| Rc.OK | Rc.DONE -> ()
| rc -> raise (Rc rc)
let bindall stmt a = Array.iteri (fun i x -> check_rc (bind stmt (i+1) x)) a
type statement_instance = {
stmt : stmt;
p... | null | https://raw.githubusercontent.com/mlin/ocaml-sqlite3EZ/7071b0589dc6444cf988240229f03f4e0fb54f70/sqlite3EZ.ml | ocaml | open List
open Sqlite3
module Rc = Sqlite3.Rc
module Data = Sqlite3.Data
exception Rc of Rc.t
exception Finally of exn*exn
let check_rc = function
| Rc.OK | Rc.DONE -> ()
| rc -> raise (Rc rc)
let bindall stmt a = Array.iteri (fun i x -> check_rc (bind stmt (i+1) x)) a
type statement_instance = {
stmt : stmt;
p... | |
ac06a6e99b555a3f852f2bffb744e0b201f5a69099004a480ead4cc1015e0199 | finnishtransportagency/harja | paallystekerros.cljs | (ns harja.views.urakka.pot2.paallystekerros
"POT2-lomakkeen päällystekerros"
(:require
[reagent.core :refer [atom] :as r]
[harja.domain.paallystysilmoitus :as pot]
[harja.domain.pot2 :as pot2-domain]
[harja.domain.tierekisteri :as tr]
[harja.domain.yllapitokohde :as yllapitokohteet-domain]
[... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/93b03a7a977db212913284f1b14ee75aafc4c28d/src/cljs/harja/views/urakka/pot2/paallystekerros.cljs | clojure | (ns harja.views.urakka.pot2.paallystekerros
"POT2-lomakkeen päällystekerros"
(:require
[reagent.core :refer [atom] :as r]
[harja.domain.paallystysilmoitus :as pot]
[harja.domain.pot2 :as pot2-domain]
[harja.domain.tierekisteri :as tr]
[harja.domain.yllapitokohde :as yllapitokohteet-domain]
[... | |
5423358533c158e31d02310b454282e227e845ae37342d4c107954474900b41f | wireapp/wire-server | Activation.hs | -- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License... | null | https://raw.githubusercontent.com/wireapp/wire-server/72a03a776d4a8607b0a9c3e622003467be914894/services/brig/src/Brig/Data/Activation.hs | haskell | This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTI... | Copyright ( C ) 2022 Wire Swiss GmbH < >
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option ) any
You should have received a copy of the GNU Affero General Public License along
module Brig.Data.Activation
( ... |
a5efe2187b8abea238fc00e82613feca52b718af2ae5a8989cb0b8186557bfd9 | froydnj/ironclad | prng.lisp | ;;;; -*- mode: lisp; indent-tabs-mode: nil -*-
;;;; prng.lisp -- common functions for pseudo-random number generators
(in-package :crypto)
(defvar *prng* nil
"Default pseudo-random-number generator for use by all crypto
the user must initialize it , e.g. with ( setf
crypto:*prng* (crypto:make-prng :fortuna)).... | null | https://raw.githubusercontent.com/froydnj/ironclad/fe88483bba68eac4db3b48bb4a5a40035965fc84/src/prng/prng.lisp | lisp | -*- mode: lisp; indent-tabs-mode: nil -*-
prng.lisp -- common functions for pseudo-random number generators
not intended to be instantiated."))
if it is sequence of bytes, use those bytes
if it
if it is NIL then the
FIXME: this is _untested_!
as it sets the proper permissions for reading a seedfile. |
(in-package :crypto)
(defvar *prng* nil
"Default pseudo-random-number generator for use by all crypto
the user must initialize it , e.g. with ( setf
crypto:*prng* (crypto:make-prng :fortuna)).")
(defclass pseudo-random-number-generator ()
()
(:documentation "A pseudo random number generator. Base class ... |
0c44ca082719548ecc514591662909c1291386fb0c1b43cbdfd7698624d741a9 | mzp/coq-ruby | type_errors.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/kernel/type_errors.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
Type errors.
Fixpoints
CoFixpoi... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$ I d : type_errors.ml 10... |
eedc6b186f0c3243eac5e52576f3ed2b7b59a6d07dec12ea4fb25ad641a78c1a | metabase/metabase | image_bundle.clj | (ns metabase.pulse.render.image-bundle
"Logic related to creating image bundles, and some predefined ones. An image bundle contains the data needed to
either encode the image inline in a URL (when `render-type` is `:inline`), or create the hashes/references needed
for an attached image (`render-type` of `:attachm... | null | https://raw.githubusercontent.com/metabase/metabase/7e3048bf73f6cb7527579446166d054292166163/src/metabase/pulse/render/image_bundle.clj | clojure | (ns metabase.pulse.render.image-bundle
"Logic related to creating image bundles, and some predefined ones. An image bundle contains the data needed to
either encode the image inline in a URL (when `render-type` is `:inline`), or create the hashes/references needed
for an attached image (`render-type` of `:attachm... | |
3cab6af1a86549d023eaaefc305e11c24dd1a18aea7b7be8c5414332b50d650e | cmpitg/ulquikit | generate-html.lisp | ;;
This file is part of Ulquikit project .
;;
Copyright ( C ) 2014 - 2017 Ha - Duong Nguyen < cmpitg AT gmailDOTcom >
;;
Ulquikit is free software : you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation , either version 3 of the... | null | https://raw.githubusercontent.com/cmpitg/ulquikit/4bea3ba0321de4e384347f829b68bcfb7c661b70/generated-src/commands/generate-html.lisp | lisp |
any later version.
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
| This file is part of Ulquikit project .
Copyright ( C ) 2014 - 2017 Ha - Duong Nguyen < cmpitg AT gmailDOTcom >
Ulquikit is free software : you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation , either version 3 of the License ... |
0f3a07c0250e28be5198156d71786239764780c0e3d47ab165935d8402d1a1fa | techascent/tvm-clj | project.clj | (defproject tvm-example "0.1.0-SNAPSHOT"
:description "Example project using tvm"
:url "-ascent/tvm-clj"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.0"]
[tvm-clj "5.0"]
[techascent/tech.opencv "4.25"]]
;;Thi... | null | https://raw.githubusercontent.com/techascent/tvm-clj/1088845bd613b4ba14b00381ffe3cdbd3d8b639e/examples/project.clj | clojure | This is useful if you want to see where the loaded tvm library
is coming from. We really recommend that you install a tvm
built specifically for your system into /usr/lib, however, as there
are quite a few options possible for tvm. | (defproject tvm-example "0.1.0-SNAPSHOT"
:description "Example project using tvm"
:url "-ascent/tvm-clj"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.0"]
[tvm-clj "5.0"]
[techascent/tech.opencv "4.25"]]
:jvm-... |
06faa7645b114422baa5be0fcaa819de7dea537dcd0964addf34ba9d8575da23 | dktr0/estuary | Term.hs | {-# LANGUAGE OverloadedStrings #-}
module Estuary.Types.Term where
import Data.Text
import Estuary.Types.Language
data Term =
EstuaryDescription |
Tutorials |
Solo |
Collaborate |
Send |
CreateNewEnsemble |
Language |
Confirm |
Cancel |
CreateNewEnsembleNote |
ModeratorPassword |
CommunityPas... | null | https://raw.githubusercontent.com/dktr0/estuary/d35fdb37bee3a55701131ccdbda3eb5255b86929/client/src/Estuary/Types/Term.hs | haskell | # LANGUAGE OverloadedStrings # | module Estuary.Types.Term where
import Data.Text
import Estuary.Types.Language
data Term =
EstuaryDescription |
Tutorials |
Solo |
Collaborate |
Send |
CreateNewEnsemble |
Language |
Confirm |
Cancel |
CreateNewEnsembleNote |
ModeratorPassword |
CommunityPassword |
HostPassword |
Participa... |
eb7d2e66c8c21674a44e8832d92db9de6c9b2abd2dfbd6dabe8cd8227c73b592 | JHU-PL-Lab/jaylang | test_heavy.ml | open Core
let ctx = Z3.mk_context []
module SuduZ3 = Sudu.Z3_api.Make (struct
let ctx = ctx
end)
module To_test = struct
open
let solver = Z3.Solver.mk_solver SuduZ3.ctx None
let heavy () =
let es =
List.range 0 50000
|> List.map ~f:(fun i ->
SuduZ3.(
eq
... | null | https://raw.githubusercontent.com/JHU-PL-Lab/jaylang/81abf9ff185758a2aaefd90478da4c7bb53f4384/src-test/sudu/test_heavy.ml | ocaml | open Core
let ctx = Z3.mk_context []
module SuduZ3 = Sudu.Z3_api.Make (struct
let ctx = ctx
end)
module To_test = struct
open
let solver = Z3.Solver.mk_solver SuduZ3.ctx None
let heavy () =
let es =
List.range 0 50000
|> List.map ~f:(fun i ->
SuduZ3.(
eq
... | |
99affbd1a205e31c8991b6354bfd82a167ec69db9c29c9b6b0f348837b161a47 | gga/janus | dsl.clj | (ns janus.dsl)
(defmulti should-have (fn [& args] (nth args 0)))
(defmethod should-have :path [& args]
[:clause [:path (nth args 1) (nth args 2) (nth args 3)]])
(defmethod should-have :status [& args]
[:clause [:status (nth args 1)]])
(defmethod should-have :header [& args]
[:clause [:header (nth args 1) (nth ar... | null | https://raw.githubusercontent.com/gga/janus/7141dae59a77e081f549f36f1548fd3efce682e1/src/janus/dsl.clj | clojure | (ns janus.dsl)
(defmulti should-have (fn [& args] (nth args 0)))
(defmethod should-have :path [& args]
[:clause [:path (nth args 1) (nth args 2) (nth args 3)]])
(defmethod should-have :status [& args]
[:clause [:status (nth args 1)]])
(defmethod should-have :header [& args]
[:clause [:header (nth args 1) (nth ar... | |
fd84a98d0dbb295349d3013756f7b96f2594aac342e9a34bc05c105f4b958728 | tweag/inline-js | NodeVersion.hs | # LANGUAGE ViewPatterns #
module Language.JavaScript.Inline.Core.NodeVersion where
import Control.Exception
import Control.Monad
import Data.List
import Data.Version
import Language.JavaScript.Inline.Core.Exception
import Language.JavaScript.Inline.Core.Utils
import System.Process
parseNodeVersion :: String -> Versi... | null | https://raw.githubusercontent.com/tweag/inline-js/ef675745e84d23d51c50660d40acf9e684fbb2d6/inline-js-core/src/Language/JavaScript/Inline/Core/NodeVersion.hs | haskell | # LANGUAGE ViewPatterns #
module Language.JavaScript.Inline.Core.NodeVersion where
import Control.Exception
import Control.Monad
import Data.List
import Data.Version
import Language.JavaScript.Inline.Core.Exception
import Language.JavaScript.Inline.Core.Utils
import System.Process
parseNodeVersion :: String -> Versi... | |
b5a3a3ef66feba3459768c1ffae4340828a74b99d609c972e29e91517d908229 | acl2/acl2 | type-of-value.lisp | C Library
;
Copyright ( C ) 2023 Kestrel Institute ( )
Copyright ( C ) 2023 Kestrel Technology LLC ( )
;
License : A 3 - clause BSD license . See the LICENSE file distributed with ACL2 .
;
Author : ( )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package "C")
(i... | null | https://raw.githubusercontent.com/acl2/acl2/44f76f208004466a9e6cdf3a07dac98b3799817d/books/kestrel/c/atc/symbolic-execution-rules/type-of-value.lisp | lisp | C Library
Copyright ( C ) 2023 Kestrel Institute ( )
Copyright ( C ) 2023 Kestrel Technology LLC ( )
License : A 3 - clause BSD license . See the LICENSE file distributed with ACL2 .
Author : ( )
(in-package "C")
(include-book "integers")
(include-book "arrays")
(local (xdoc::set-default-parents atc-... | |
9558ecee74adb560d3d3c01600d97b66bce2bdbfa0ddf822426c58482187ed7e | anoma/juvix | Trace.hs | module Juvix.Prelude.Trace
( module Juvix.Prelude.Trace,
module Debug.Trace,
)
where
import Data.Text qualified as Text
import Debug.Trace hiding (trace, traceM, traceShow)
import Debug.Trace qualified as T
import GHC.IO (unsafePerformIO)
import Juvix.Prelude.Base
setDebugMsg :: Text -> Text
setDebugMsg msg =... | null | https://raw.githubusercontent.com/anoma/juvix/807b3b1770289b8921304e92e7305c55c2e11f8f/src/Juvix/Prelude/Trace.hs | haskell | # WARNING traceLabel "Using traceLabel" #
# WARNING trace "Using trace" #
# WARNING traceM "Using traceM" #
# WARNING traceShow "Using traceShow" #
# WARNING traceToFile "Using traceToFile" #
# WARNING traceToFile' "Using traceToFile'" #
# WARNING traceToFileM "Using traceFileM" # | module Juvix.Prelude.Trace
( module Juvix.Prelude.Trace,
module Debug.Trace,
)
where
import Data.Text qualified as Text
import Debug.Trace hiding (trace, traceM, traceShow)
import Debug.Trace qualified as T
import GHC.IO (unsafePerformIO)
import Juvix.Prelude.Base
setDebugMsg :: Text -> Text
setDebugMsg msg =... |
26a22863c2865c2387a4fc9b66f16353ddc69e2416012bb4553a8df235948495 | sseefried/open-epidemic-game | FontTest.hs | module FontTest where
import Foreign.Marshal.Alloc (allocaBytes)
import Graphics.Rendering.Cairo
import Text.Printf
-- friends
import FreeType
----------------------------------------------------------------------------------------------------
test :: String -> IO ()
test s = ... | null | https://raw.githubusercontent.com/sseefried/open-epidemic-game/ed623269022edc056dab3fd6d424295c984febec/extra-src/font-test/FontTest.hs | haskell | friends
--------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------- | module FontTest where
import Foreign.Marshal.Alloc (allocaBytes)
import Graphics.Rendering.Cairo
import Text.Printf
import FreeType
test :: String -> IO ()
test s = do
ff <- loadFontFace
pp <- runWithoutRender $ do
setFontSize 1000
setFontFace ff
(TextExtents b... |
30068dc7997acb15d11fb3edcb46348004a7498027586350d431952d636784ff | input-output-hk/plutus | Usages.hs | -- editorconfig-checker-disable-file
# LANGUAGE FlexibleContexts #
-- | Functions for computing variable usage inside terms.
module UntypedPlutusCore.Analysis.Usages (termUsages, Usages, getUsageCount, allUsed) where
import UntypedPlutusCore.Core.Type
import UntypedPlutusCore.Subst
import PlutusCore qualified as PLC
... | null | https://raw.githubusercontent.com/input-output-hk/plutus/cbd5f37288eb06738be28fc49af6a6b612e6c5fc/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Analysis/Usages.hs | haskell | editorconfig-checker-disable-file
| Functions for computing variable usage inside terms.
| Get the usage count of @n@. | # LANGUAGE FlexibleContexts #
module UntypedPlutusCore.Analysis.Usages (termUsages, Usages, getUsageCount, allUsed) where
import UntypedPlutusCore.Core.Type
import UntypedPlutusCore.Subst
import PlutusCore qualified as PLC
import PlutusCore.Name qualified as PLC
import Control.Lens
import Data.MultiSet qualified as... |
ed16c104baf0fda2fb6a72cb9b288ca66216240cf8e72fc75fa37f4b9fcaadc8 | uxbox/uxbox-old | material_design_navigation.cljs | (ns uxbox.ui.icon-sets.material-design-navigation
(:require [uxbox.ui.tools :as t]))
(def material-design-navigation (sorted-map
:apps {
:name "Apps"
:svg [:path
{:style {:stroke nil}
:d
"M8 16h8V8H8v8zm12 24h8v-8h-8v8zM8 40h8v-8H8v8zm0-12h8v-8H8v8zm12 0h8v-8h-8v8zM32 8v8h8V8h-8zm-12 8h8V... | null | https://raw.githubusercontent.com/uxbox/uxbox-old/9c3c3c406a6c629717cfc40e3da2f96df3bdebf7/src/frontend/uxbox/ui/icon_sets/material_design_navigation.cljs | clojure | (ns uxbox.ui.icon-sets.material-design-navigation
(:require [uxbox.ui.tools :as t]))
(def material-design-navigation (sorted-map
:apps {
:name "Apps"
:svg [:path
{:style {:stroke nil}
:d
"M8 16h8V8H8v8zm12 24h8v-8h-8v8zM8 40h8v-8H8v8zm0-12h8v-8H8v8zm12 0h8v-8h-8v8zM32 8v8h8V8h-8zm-12 8h8V... | |
0fffcf5298f93383169bcadca201e4041367fb07aaa702112f0082c212729fb2 | meiersi/blaze-builder | Utf8.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
Module : Blaze . ByteString . Builder . Html . Utf8
Copyright : ( c ) 2010
-- License : BSD3-style (see LICENSE)
--
Maintainer : < >
-- Stability : experimental
Portability : tested on GHC only
--
' Write 's and ' Builder 's for serializing HT... | null | https://raw.githubusercontent.com/meiersi/blaze-builder/2d8ce308951656ebf0318097989dc1c017dcff83/Blaze/ByteString/Builder/Html/Utf8.hs | haskell | # LANGUAGE OverloadedStrings #
|
License : BSD3-style (see LICENSE)
Stability : experimental
characters.
This module is used by both the 'blaze-html' and the \'hamlet\' HTML
templating libraries. If the 'Builder' from 'blaze-builder' replaces the
'Data.Binary.Builder' implementation, this module will mo... | Module : Blaze . ByteString . Builder . Html . Utf8
Copyright : ( c ) 2010
Maintainer : < >
Portability : tested on GHC only
' Write 's and ' Builder 's for serializing HTML escaped and UTF-8 encoded
module Blaze.ByteString.Builder.Html.Utf8
(
module Blaze.ByteString.Builder.Cha... |
245a8ade238c2590bd7f2749e16fb92ae5db9ee72292ef51d19467cd7abb7d74 | janestreet/core | pid.mli | (** Process ID. *)
open! Import
type t [@@deriving bin_io, hash, sexp, quickcheck]
include Identifiable.S with type t := t
val of_int : int -> t
val to_int : t -> int
* The pid of the " init " process , which is [ 1 ] by convention .
val init : t
module Stable : sig
module V1 :
Stable_comparable.With_stable... | null | https://raw.githubusercontent.com/janestreet/core/e362df38c28fed401e7bcbad09db3fb283281010/core/src/pid.mli | ocaml | * Process ID. |
open! Import
type t [@@deriving bin_io, hash, sexp, quickcheck]
include Identifiable.S with type t := t
val of_int : int -> t
val to_int : t -> int
* The pid of the " init " process , which is [ 1 ] by convention .
val init : t
module Stable : sig
module V1 :
Stable_comparable.With_stable_witness.V1
wit... |
b79fe6efa0a24264e22d1aaad0e9b0e1131bad2bb8ad7225308017d240004d25 | ChildsplayOSU/bogl | Monad.hs | # LANGUAGE DeriveGeneric #
|
Module : Typechecker . Monad
Description : Typechecker monad
Copyright : ( c )
License : BSD-3
Module : Typechecker.Monad
Description : Typechecker monad
Copyright : (c)
License : BSD-3
-}
module Typechecker.Monad where
import Control.Monad.State
import... | null | https://raw.githubusercontent.com/ChildsplayOSU/bogl/8c649689bf26543be1a7ec72787b9c013ecb754f/src/Typechecker/Monad.hs | haskell | | Types in the environment
| Initial empty environment
| An example environment for interal use (e.g. testing, ghci)
| Typechecking monad
| Run a computation inside of the typechecking monad
| Add some types to the environment
| Get the type environment
| Get the type definitions
| Get the input type
| Get th... | # LANGUAGE DeriveGeneric #
|
Module : Typechecker . Monad
Description : Typechecker monad
Copyright : ( c )
License : BSD-3
Module : Typechecker.Monad
Description : Typechecker monad
Copyright : (c)
License : BSD-3
-}
module Typechecker.Monad where
import Control.Monad.State
import... |
cd74e75859a08483bcc75bca6241f9cb7194789a7b8ad98c765e630925ef36a3 | 2600hz/community-scripts | string_with_invalid_newline.erl | {error,{66,"lexical error: invalid character inside string.\n"}}.
| null | https://raw.githubusercontent.com/2600hz/community-scripts/b0b81342bf02300fcdbda99e4cecc1ee93823c70/CloneTools/lib/ejson-0.1.0/t/cases/string_with_invalid_newline.erl | erlang | {error,{66,"lexical error: invalid character inside string.\n"}}.
| |
6969581a334061fd15471dbadd35288d057099b20d31337e6d4d86fc9e31de63 | zellige/zellige | Geometry.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeOperators #-}
# OPTIONS_GHC -fno - warn - orphans #
module Data.Geometry.VectorTile.Geometry where
import ... | null | https://raw.githubusercontent.com/zellige/zellige/87e6dab11ac4c1843009043580f14422a1d83ebf/src/Data/Geometry/VectorTile/Geometry.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE TypeOperators #
considered an Interior Ring.
| # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -fno - warn - orphans #
module Data.Geometry.VectorTile.Geometry where
import Data.Foldable (foldl')
import qualified Data.Foldable as Foldable
import qualified Data.Sequence as S
import ... |
bbbddf7b761d398869dadf02ee9c31c3916b08818892c6cc1d39aebacf44e623 | Lambda-X/cljs-repl-web | io.cljs | (ns cljs-repl-web.io
(:require [cljs.js :as cljs]
[clojure.string :as string]
[cognitect.transit :as transit]
[replumb.repl :as replumb-repl]
[adzerk.cljs-console :as log :include-macros true])
(:import [goog.events EventType]
[goog.net XhrIo]))
(defn fetc... | null | https://raw.githubusercontent.com/Lambda-X/cljs-repl-web/0dabe8ff18d8c0f4ae6c9f052dc23eb1f5ad262c/src/cljs/cljs_repl_web/io.cljs | clojure | (ns cljs-repl-web.io
(:require [cljs.js :as cljs]
[clojure.string :as string]
[cognitect.transit :as transit]
[replumb.repl :as replumb-repl]
[adzerk.cljs-console :as log :include-macros true])
(:import [goog.events EventType]
[goog.net XhrIo]))
(defn fetc... | |
cc11eacf39785f3de04d92a9e5f0a886c51da667af5e03d76271236c5ba24f4a | typelead/etlas | Eta.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE NamedFieldPuns #
module Distribution.Simple.Eta (
configure, getInstalledPackages, getPackageDBContents,
buildLib, buildExe,
replLib, replExe,
startInterpreter,
installLib, installExe,
libAbiHash,
... | null | https://raw.githubusercontent.com/typelead/etlas/bbd7c558169e1fda086e759e1a6f8c8ca2807583/etlas-cabal/Distribution/Simple/Eta.hs | haskell | # LANGUAGE RankNTypes #
Internal.targetPlatform ghcInfo
| Given a package DB stack, return all installed packages.
getLibDir' :: Verbosity -> ConfiguredProgram -> IO FilePath
getLibDir' verbosity etaProg =
getProgramOutput verbosity etaProg ["--print-libdir"]
TODO: do we need to put hs-boot files into place ... | # LANGUAGE FlexibleContexts #
# LANGUAGE NamedFieldPuns #
module Distribution.Simple.Eta (
configure, getInstalledPackages, getPackageDBContents,
buildLib, buildExe,
replLib, replExe,
startInterpreter,
installLib, installExe,
libAbiHash,
hcPkgInfo,
regist... |
5b425787d0eb1d0cfaf4b7b1bdd9023505da06692bc2867ef29b9625bcc02eae | bytekid/mkbtt | isFlat.ml | Copyright 2008 , Christian Sternagel ,
* GNU Lesser General Public License
*
* This file is part of TTT2 .
*
* TTT2 is free software : you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation , either ve... | null | https://raw.githubusercontent.com/bytekid/mkbtt/c2f8e0615389b52eabd12655fe48237aa0fe83fd/src/processors/src/predicate/isFlat.ml | ocaml | ** OPENS *******************************************************************
** MODULES *****************************************************************
** TYPES *******************************************************************
** GLOBALS *****************************************************************
** FUNCTIONS... | Copyright 2008 , Christian Sternagel ,
* GNU Lesser General Public License
*
* This file is part of TTT2 .
*
* TTT2 is free software : you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation , either ve... |
7d3c96b3b18b4b09c7eb816d58c753ebc867a78d1e99bc6ebe6276846904f009 | 3b/3b-glim | state.lisp | (in-package #:3b-glim)
(defconstant +position+ 0)
only supporting 1 textures for now
(defconstant +tangent-width+ 2)
(defconstant +normal+ 3)
(defconstant +color+ 4)
(defconstant +flags+ 5)
(defconstant +secondary-color+ 6)
(defvar *format*
(3b-glim/s:compile-vertex-format
`(1
(,+position+ :vec4)
(... | null | https://raw.githubusercontent.com/3b/3b-glim/6299ddaf88bea180646a231fe9030e39bb499851/im/state.lisp | lisp | stores extra data for generating line vertices
0 = primitive type: see +trangle-flag+ etc above
color
indices into prim-flags[]
values for flags[+prim-mode-flag+]
values for tex-mode* uniforms
indices for draw-flags uniform
values for +draw-flag-mode+
tris/quads only
tris/quads only
lighting stuff
parameter... | (in-package #:3b-glim)
(defconstant +position+ 0)
only supporting 1 textures for now
(defconstant +tangent-width+ 2)
(defconstant +normal+ 3)
(defconstant +color+ 4)
(defconstant +flags+ 5)
(defconstant +secondary-color+ 6)
(defvar *format*
(3b-glim/s:compile-vertex-format
`(1
(,+position+ :vec4)
(... |
c1a0794a9033ff11387f5780628edd5cb41d574433c58e68887c0ee55462fcd4 | obsidiansystems/aeson-gadt-th | TH.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE CPP #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PatternGuards #
# LANGUAGE PatternSynonyms #
# LANGUAGE QuasiQuotes #
{-# LAN... | null | https://raw.githubusercontent.com/obsidiansystems/aeson-gadt-th/7d2cdd0c666dc0e4feddbfcc5bd2425c4af33f3e/src/Data/Aeson/GADT/TH.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE GADTs #
# LANGUAGE RankNTypes #
| Determine the type variables which occur freely in a type.
This 'head' is safe because 'group' returns a list of non-empty lists
This 'head' is safe because 'group' returns a list of non-empty lists
The singleton is special-cased because of
... | # LANGUAGE CPP #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PatternGuards #
# LANGUAGE PatternSynonyms #
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving ... |
e517014327c431c54347129c84a66a84b9a0d2500335db00a1fd578aa4f3620a | ivan-m/graphviz | X11.hs | {-# LANGUAGE OverloadedStrings #-}
|
Module : Data . GraphViz . Attributes . Colors . X11
Description : Specification of X11 colors .
Copyright : ( c )
License : 3 - Clause BSD - style
Maintainer :
Graphviz 's definition of X11 colors differs from the \"normal\ "
... | null | https://raw.githubusercontent.com/ivan-m/graphviz/42dbb6312d7edf789d7055079de7b4fa099a4acc/Data/GraphViz/Attributes/Colors/X11.hs | haskell | # LANGUAGE OverloadedStrings #
-----------------------------------------------------------------------------
different from the \"normal\" X11 colors used (e.g. the inclusion
| Convert an 'X11Color' to its equivalent 'Colour' value. Note
that it uses 'AlphaColour' because of 'Transparent'; all other
'X11Col... |
|
Module : Data . GraphViz . Attributes . Colors . X11
Description : Specification of X11 colors .
Copyright : ( c )
License : 3 - Clause BSD - style
Maintainer :
Graphviz 's definition of X11 colors differs from the \"normal\ "
list installed on many systems a... |
aaba2f31162c6912e1014a37e8eabc1242050e514cd23b4e0d3fd97eb4f999b7 | bootstrapworld/curr | DrivingGame.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-beginner-reader.ss" "lang")((modname DrivingGame) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decim... | null | https://raw.githubusercontent.com/bootstrapworld/curr/443015255eacc1c902a29978df0e3e8e8f3b9430/courses/reactive/resources/source-files/DrivingGame.rkt | racket | about the language level of this file in a form that our tools can easily process.
GRAPHICS
DATA:
An object is a: number image number number number number number
STARTING WORLD
GRAPHICS FUNCTIONS:
draw-world: world -> Image... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname DrivingGame) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ())))
(require "Teachpacks/bootstrap-teachpack.rkt")
(define ROAD (... |
7cd8a91bbfffd96b2d4c670c528eb47e1e494da3fa6b6bee6d3278163fd0c68a | haskell/stm | Issue17.hs | # LANGUAGE CPP #
see
--
Test - case contributed by < >
--
This bug is observable in all versions with TBQueue from ` stm-2.4 ` to
` stm-2.4.5.1 ` inclusive .
module Issue17 (main) where
import Control.Concurrent.STM
import Test.HUnit.Base (assertBool, assertEqual)
main :: IO (... | null | https://raw.githubusercontent.com/haskell/stm/319e380ab2ddfb99ab499b6783e22f2b4faaee38/testsuite/src/Issue17.hs | haskell |
New queue capacity is set to a negative numer
Attempt to write into the queue.
Make sure that attempt to write didn't affect the queue | # LANGUAGE CPP #
see
Test - case contributed by < >
This bug is observable in all versions with TBQueue from ` stm-2.4 ` to
` stm-2.4.5.1 ` inclusive .
module Issue17 (main) where
import Control.Concurrent.STM
import Test.HUnit.Base (assertBool, assertEqual)
main :: IO ()
main... |
8386a936778e58a99964eac7d98741111fe6e58d8b69470ed17d554029572878 | Bwooce/open-cgf | open-cgf_state.erl | %%%-------------------------------------------------------------------
%%% File : open-cgf_state.erl
Author : < >
%%% Description :
%%%
Copyright 2008
%%%
%%% This file is part of open-cgf.
%%%
%%% open-cgf is free software: you can redistribute it and/or modify
it under the terms of the GNU General Pub... | null | https://raw.githubusercontent.com/Bwooce/open-cgf/929f7e280493ca4bc47be05bb931044ee1321594/src/open-cgf_state.erl | erlang | -------------------------------------------------------------------
File : open-cgf_state.erl
Description :
This file is part of open-cgf.
open-cgf is free software: you can redistribute it and/or modify
open-cgf is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the ... | Author : < >
Copyright 2008
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation .
You should have received a copy of the GNU General Public License
-module('open-cgf_state').
-behaviour(gen_server).
-define(SERVER, ?MODULE).
-include("open-cgf.h... |
aee5c95cb6951fd8ee6bb9b0f901a4596903b81343b0c1fcd608937ef7d0206f | kendroe/CoqRewriter | inner.ml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* REWRITELIB
*
* inner.ml
*
* This file contains the code for the inner rewrite routines .
*
... | null | https://raw.githubusercontent.com/kendroe/CoqRewriter/ddf5dc2ea51105d5a2dc87c99f0d364cf2b8ebf5/plugin/src/inner.ml | ocaml | require "list.sml" ;
require "exp.sml" ;
require "env.sml" ;
require "expint.sml" ;
require "kbrewrit.sml" ;
require "context.sml" ;
require "derive.sml" ;
require "builtin.sml" ;
require "match.sml" ;
require "cache.sml" ;
require "crewrite.sml" ;
require "rule_app.sml" ;
require "... | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* REWRITELIB
*
* inner.ml
*
* This file contains the code for the inner rewrite routines .
*
... |
56746a47db3eb018c9960136a4c3da8dfe89a84e433a1e2d95ae1dd6326a675e | ninenines/gun | delayed_hello_h.erl | %% Feel free to use, reuse and abuse the code in this file.
-module(delayed_hello_h).
-export([init/2]).
init(Req, Timeout) ->
timer:sleep(Timeout),
{ok, cowboy_req:reply(200, #{
<<"content-type">> => <<"text/plain">>
}, <<"Hello world!">>, Req), Timeout}.
| null | https://raw.githubusercontent.com/ninenines/gun/fe25965f3a2f1347529fec8c7afa981313378e31/test/handlers/delayed_hello_h.erl | erlang | Feel free to use, reuse and abuse the code in this file. |
-module(delayed_hello_h).
-export([init/2]).
init(Req, Timeout) ->
timer:sleep(Timeout),
{ok, cowboy_req:reply(200, #{
<<"content-type">> => <<"text/plain">>
}, <<"Hello world!">>, Req), Timeout}.
|
255e91c1e4a9a5084327ee834a2182c640468f0675ccbf7764b2ab7f81590099 | takikawa/racket-ppa | schedule.rkt | #lang racket/base
(require "config.rkt"
"place-local.rkt"
"place-object.rkt"
"atomic.rkt"
"host.rkt"
"internal-error.rkt"
"sandman.rkt"
"parameter.rkt"
"thread-group.rkt"
"schedule-info.rkt"
(submod "thread.rkt" scheduling)
... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/26d6ae74a1b19258c9789b7c14c074d867a4b56b/src/thread/schedule.rkt | racket | Many scheduler details are implemented in "thread.rkt", but this
module handles the thread selection, thread swapping, and
process sleeping.
Initializes the thread system:
Initializes the thread system in a new place:
Finish initializing the thread system within a place:
----------------------------------------
... | #lang racket/base
(require "config.rkt"
"place-local.rkt"
"place-object.rkt"
"atomic.rkt"
"host.rkt"
"internal-error.rkt"
"sandman.rkt"
"parameter.rkt"
"thread-group.rkt"
"schedule-info.rkt"
(submod "thread.rkt" scheduling)
... |
722f71ece11ee42fa07f669f77ac0c2cd028eafc77be3cb490f2c42e4d1675a4 | knupfer/type-of-html | Aria.hs | # OPTIONS_GHC -fno - warn - unticked - promoted - constructors #
# LANGUAGE TypeFamilies #
{-# LANGUAGE DataKinds #-}
module Html.Aria
( module Html.Aria
, module Html.Type
) where
import Html.Type
[ 2020 - 11 - 03 ] ARIA /#states_and_properties
newtype instance Attribute "role" Tr... | null | https://raw.githubusercontent.com/knupfer/type-of-html/981e2c2c4f90e57a55e00e18db6f6c0623292851/src/Html/Aria.hs | haskell | # LANGUAGE DataKinds # | # OPTIONS_GHC -fno - warn - unticked - promoted - constructors #
# LANGUAGE TypeFamilies #
module Html.Aria
( module Html.Aria
, module Html.Type
) where
import Html.Type
[ 2020 - 11 - 03 ] ARIA /#states_and_properties
newtype instance Attribute "role" True v = RoleA v
6.7 Definiti... |
7df3d99e47b56efef06f1f251e75dae56d5dac1cdae825e6e995b9322c4efdb8 | GlideAngle/flare-timing | Sample.hs | module Flight.Zone.Cylinder.Sample
( TrueCourse(..)
, Samples(..)
, Tolerance(..)
, ZonePoint(..)
, SampleParams(..)
, fromRationalZonePoint
) where
import Data.UnitsOfMeasure (u, fromRational', toRational')
import Data.UnitsOfMeasure.Internal (Quantity(..))
import Flight.LatLng (LatLng(..... | null | https://raw.githubusercontent.com/GlideAngle/flare-timing/27bd34c1943496987382091441a1c2516c169263/lang-haskell/zone/library/Flight/Zone/Cylinder/Sample.hs | haskell | ^ The zone for which the point is on the edge.
^ A point on the edge of this zone.
^ The point's bearing from the origin.
^ The point's distance from the origin.
^ How many samples at each iteration?
^ What is the acceptable tolerance? | module Flight.Zone.Cylinder.Sample
( TrueCourse(..)
, Samples(..)
, Tolerance(..)
, ZonePoint(..)
, SampleParams(..)
, fromRationalZonePoint
) where
import Data.UnitsOfMeasure (u, fromRational', toRational')
import Data.UnitsOfMeasure.Internal (Quantity(..))
import Flight.LatLng (LatLng(..... |
fc9b393823b0162d71acb3bb80cbad2c1949977919f6bbaef95c2974652e7e23 | aartaka/nyxt-config | ace.lisp | (in-package #:nyxt-user)
This is a configuration for the Ace editor Nyxt integration
( -engineer/nx-ace ) .
(define-configuration nx-ace:ace-mode
((nx-ace:extensions
(mapcar
(lambda (name)
(quri:merge-uris (quri:uri name)
(quri:uri "/")))
'("keybinding-emacs.min.js"
... | null | https://raw.githubusercontent.com/aartaka/nyxt-config/3c94673a0ca3ccb449879c5a2a9814d81ed55f0c/ace.lisp | lisp | Themes
Language modes
Snippets
Extensions | (in-package #:nyxt-user)
This is a configuration for the Ace editor Nyxt integration
( -engineer/nx-ace ) .
(define-configuration nx-ace:ace-mode
((nx-ace:extensions
(mapcar
(lambda (name)
(quri:merge-uris (quri:uri name)
(quri:uri "/")))
'("keybinding-emacs.min.js"
... |
4bf62cdcbd4189e90a0f2bcabb430868dc4fc26fc90cdbe83bb47a704f1e7046 | cyverse-archive/DiscoveryEnvironmentBackend | query.clj | (ns notification-agent.query
(:use [notification-agent.common]
[notification-agent.messages :only [reformat-message]]
[clojure.string :only [blank? lower-case upper-case]]
[slingshot.slingshot :only [throw+]])
(:require [cheshire.core :as cheshire]
[clojure.string :as string]
... | null | https://raw.githubusercontent.com/cyverse-archive/DiscoveryEnvironmentBackend/7f6177078c1a1cb6d11e62f12cfe2e22d669635b/services/NotificationAgent/src/notification_agent/query.clj | clojure | (ns notification-agent.query
(:use [notification-agent.common]
[notification-agent.messages :only [reformat-message]]
[clojure.string :only [blank? lower-case upper-case]]
[slingshot.slingshot :only [throw+]])
(:require [cheshire.core :as cheshire]
[clojure.string :as string]
... | |
144f1217ec95956a5930cc1598df319c8f90adb2139578405529a673b68ebf77 | ivanjovanovic/sicp | e-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.)
; ------------------------------------------------------------
First to analyze a bit the solution in 3.18 .
; We are storing every visited node in the history object. Therefo... | null | https://raw.githubusercontent.com/ivanjovanovic/sicp/a3bfbae0a0bda414b042e16bbb39bf39cd3c38f8/3.3/e-3.19.scm | scheme |
constant amount of space. (This requires a very clever idea.)
------------------------------------------------------------
We are storing every visited node in the history object. Therefore,
dependent on the length of the list this will grow over time.
Its space growth is characterized by O(n) asymptotic approxi... | Exercise 3.19 .
Redo exercise 3.18 using an algorithm that takes only a
First to analyze a bit the solution in 3.18 .
( ) has found in
the late 1960s a very clever way to find the cycle in any part of the list .
We just have to make two pointers on the top of the list and then go
through the list in ... |
65c6845091d596017e85a69882686a0e413644ab3baa15b10b2ce517a44a5b98 | heyoka/faxe | graph_node_registry.erl | %%%-------------------------------------------------------------------
@author
( C ) 2021 , < COMPANY >
%%% @doc
%%% @end
%%%-------------------------------------------------------------------
-module(graph_node_registry).
-behaviour(gen_server).
-export([start_link/0, register_graph_nodes/2, get_graph/1, get_g... | null | https://raw.githubusercontent.com/heyoka/faxe/93098305f064e0e0c2f1ec7995b4c3854ceb1ac5/apps/faxe/src/lib/graph_node_registry.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
===================================================================
Spawning and gen_server implementation
================================================================... | @author
( C ) 2021 , < COMPANY >
-module(graph_node_registry).
-behaviour(gen_server).
-export([start_link/0, register_graph_nodes/2, get_graph/1, get_graph_table/0, unregister_graph_nodes/2]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2,
code_change/3]).
-define(SERVER, ?MODULE... |
b07bb595a54bb78110b77e55ea318d57809a05b245cfadd916d8ebe00bd515d1 | dnadales/sandbox | Lib.hs | # LANGUAGE NamedFieldPuns #
module Lib where
import Control.Monad
import Control.Exception.Base
import Control.Exception
import Control.Concurrent
import Network.TextViaSockets
readThreeTimes :: IO ()
readThreeTimes = readLines `catch` handler
where readLines = do
conn <- connectTo "localhost" "909... | null | https://raw.githubusercontent.com/dnadales/sandbox/401c4f0fac5f8044fb6e2e443bacddce6f135b4b/receiving-strings-via-sockets/src/Lib.hs | haskell | # LANGUAGE NamedFieldPuns #
module Lib where
import Control.Monad
import Control.Exception.Base
import Control.Exception
import Control.Concurrent
import Network.TextViaSockets
readThreeTimes :: IO ()
readThreeTimes = readLines `catch` handler
where readLines = do
conn <- connectTo "localhost" "909... | |
c741c98097dcb5db4663e0652c51ebcb945ca44081ddcff29fbf5864a3431983 | AndrasKovacs/ELTE-func-lang | Ora4_Pre.hs | Ha ez valakinek
{-# LANGUAGE DeriveFunctor, InstanceSigs #-}
module Ora4 where
import Control.Monad
import Prelude hiding (Maybe(..), Either(..))
-- pl Maybe
-- Nothing a hiba eset
data Maybe a = Just a | Nothing deriving Functor
-- pl Either
-- Left a hibaüzenetek esete
data Either a b = Left a | Right b d... | null | https://raw.githubusercontent.com/AndrasKovacs/ELTE-func-lang/b43200a54ec54a2103f49440479e406e02d490db/2022-23-1/gyak2/Ora4_Pre.hs | haskell | # LANGUAGE DeriveFunctor, InstanceSigs #
pl Maybe
Nothing a hiba eset
pl Either
Left a hibaüzenetek esete
e a hibaüzenet komponens
class Functor f => Applicative f where
Pl konstans bind
a >> b = a >>= \_ -> b
írjunk még monád fv-eket
replicate :: Int -> a -> [a]
I/O haskellben: IO monád
g... | Ha ez valakinek
module Ora4 where
import Control.Monad
import Prelude hiding (Maybe(..), Either(..))
data Maybe a = Just a | Nothing deriving Functor
data Either a b = Left a | Right b deriving Functor
Ha egy hiba is van ,
case - of is nagyon hasznos ennél
mapMaybe :: (a -> Maybe b) -> [a] -> May... |
d1816b6c97100646be68e33fd9d748e6964f82ff1ec30d09b7589841910a853b | wh5a/thih | FacAndFibWithGuards.hs | -- FacAndfibWithGuards.hs
Output : 123
-- fac :: Int -> Int
fac n
| n == 0 = 1
| n == 1 = 1
| otherwise = n * fac (n - 1)
-- fib :: Int -> Int
fib n
| n == 0 = 1
| n == 1 = 1
| otherwise = (fib (n - 1)) + (fib (n - 2))
-- main :: Int
main = fac 5 + fib 3
| null | https://raw.githubusercontent.com/wh5a/thih/dc5cb16ba4e998097135beb0c7b0b416cac7bfae/hatchet/examples/FacAndFibWithGuards.hs | haskell | FacAndfibWithGuards.hs
fac :: Int -> Int
fib :: Int -> Int
main :: Int | Output : 123
fac n
| n == 0 = 1
| n == 1 = 1
| otherwise = n * fac (n - 1)
fib n
| n == 0 = 1
| n == 1 = 1
| otherwise = (fib (n - 1)) + (fib (n - 2))
main = fac 5 + fib 3
|
88cdcbcbab483b9220c5b067976541917af926e3b369ceafdd4ab4f88ac43041 | open-company/open-company-web | dashboard_layout.cljs | (ns oc.web.components.dashboard-layout
(:require [rum.core :as rum]
[org.martinklepsch.derivatives :as drv]
[oc.web.dispatcher :as dis]
[oc.web.lib.utils :as utils]
[oc.lib.cljs.useragent :as ua]
[oc.web.mixins.ui :as ui-mixins]
[oc.web.actions.u... | null | https://raw.githubusercontent.com/open-company/open-company-web/246cccb2818cc3bb9f05adeea4364ffa7171a586/src/main/oc/web/components/dashboard_layout.cljs | clojure | Derivative
Reopen cmail if it was open
Board data used as fallback until the board is completely loaded
Show the board always on desktop except when there is an expanded post and
on mobile only when the navigation menu is not visible
Board name row: board name, settings button and say something button
Board name... | (ns oc.web.components.dashboard-layout
(:require [rum.core :as rum]
[org.martinklepsch.derivatives :as drv]
[oc.web.dispatcher :as dis]
[oc.web.lib.utils :as utils]
[oc.lib.cljs.useragent :as ua]
[oc.web.mixins.ui :as ui-mixins]
[oc.web.actions.u... |
3199e122b8186aea62145376b60d6442b88894bcac3233fbe683c2bb4168fd14 | archimag/rulisp | planet-feeds.lisp | (feed "-univ-etc.blogspot.com/feeds/posts/default/-/lisp/ru")
(feed "/")
(feed "-ru.blogspot.com/feeds/posts/default/-/lisp")
(feed "")
(feed "-vk.livejournal.com/data/rss"
:category "lisp")
(feed ""
:category "lisp")
(feed ""
:category "lisp")
(feed "/-/lisp-ru")
(feed "/-/lisp")
(feed "-49-... | null | https://raw.githubusercontent.com/archimag/rulisp/2af0d92066572c4665d14dc3ee001c0c5ff84e84/planet-feeds.lisp | lisp | (feed "-univ-etc.blogspot.com/feeds/posts/default/-/lisp/ru")
(feed "/")
(feed "-ru.blogspot.com/feeds/posts/default/-/lisp")
(feed "")
(feed "-vk.livejournal.com/data/rss"
:category "lisp")
(feed ""
:category "lisp")
(feed ""
:category "lisp")
(feed "/-/lisp-ru")
(feed "/-/lisp")
(feed "-49-... | |
7f77a8dba9d61121500ea13e77b630764158d8780c658a0760cbe44131e3d635 | bcc32/advent-of-code | b.ml | open! Core
open! Async
open! Import
let main () =
let%bind events =
Reader.with_file "input" ~f:(fun r -> r |> Reader.lines |> Pipe.to_list)
(* times can be compared lexicographically *)
>>| List.sort ~compare:String.compare
>>| List.map ~f:Event.of_string
in
let guard_minute_count = Hashtbl.crea... | null | https://raw.githubusercontent.com/bcc32/advent-of-code/86a9387c3d6be2afe07d2657a0607749217b1b77/2018/04/b.ml | ocaml | times can be compared lexicographically | open! Core
open! Async
open! Import
let main () =
let%bind events =
Reader.with_file "input" ~f:(fun r -> r |> Reader.lines |> Pipe.to_list)
>>| List.sort ~compare:String.compare
>>| List.map ~f:Event.of_string
in
let guard_minute_count = Hashtbl.create (module Tuple.Hashable_t (Int) (Int)) in
even... |
4dcb56081a5a74d6a794c4988209ef4b0be120c8f660524fb3bd54ea0728b036 | sjl/flax | letters.lisp | (in-package :flax.drawing)
(defgeneric letter-paths (character))
(defmethod letter-paths ((character (eql #\Space)))
(list))
(defmethod letter-paths ((character (eql #\+)))
;; p₁
;; |
;; |
;; p₃ ----+---- p₄
;; |
;; |
;; p₂
(let ((p1 (v... | null | https://raw.githubusercontent.com/sjl/flax/0dc4e7c0d096cd01a1009c8fbd0d96174ed48090/src/drawing/letters.lisp | lisp | p₁
|
|
p₃ ----+---- p₄
|
|
p₂
p₁
|
|
|
|
p₂|______ p₃
p₁___ p₃
| \
p₆|___/ p₄
| \
| \
p₂| \ p₅ | (in-package :flax.drawing)
(defgeneric letter-paths (character))
(defmethod letter-paths ((character (eql #\Space)))
(list))
(defmethod letter-paths ((character (eql #\+)))
(let ((p1 (vec 0.25 0.35))
(p2 (vec 0.25 0.75))
(p3 (vec 0.05 0.55))
(p4 (vec 0.45 0.55)))
(list (path (list p1 ... |
1038d517cd9d43af78f86224d77d1f4f66fc46d4ee8335c85ff1d579e997a370 | tonyg/kali-scheme | check.scm | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING .
; The barest skeleton of a test suite.
; Mostly it makes sure that many of the external packages load without
; error.
; ,exec ,load debug/check.scm
; (done)
(load-package 'testing)
(config '(r... | null | https://raw.githubusercontent.com/tonyg/kali-scheme/79bf76b4964729b63fce99c4d2149b32cb067ac0/scheme/debug/check.scm | scheme | The barest skeleton of a test suite.
Mostly it makes sure that many of the external packages load without
error.
,exec ,load debug/check.scm
(done)
(in 'bar '(bench off))
(in 'bar '(run (test "non-bench" equal? '((a b)) (foo))))
(in 'bar '(bench on))
(in 'bar '(run (define (foo) (car '(a b)))))
(in 'bar '(run (de... | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING .
(load-package 'testing)
(config '(run
(define-structure bar (export)
(open scheme testing))))
These do n't work in , which lacks shadowing
( in ' bar ' ( run ( define ( foo ) ( cad... |
2cb0d19b749da14a116a117b651fe5851b4ea96ac3318b7e92fca51fc1620420 | privet-kitty/cl-competitive | quicksort.lisp | (defpackage :cp/test/quicksort
(:use :cl :fiveam :cp/quicksort :cp/displace)
(:import-from :cp/test/base #:base-suite))
(in-package :cp/test/quicksort)
(in-suite base-suite)
;; FIXME: Resorting to displacement to sort subsequence may be non-standard,
though it is no problem on SBCL .
(defun sort* (vector order s... | null | https://raw.githubusercontent.com/privet-kitty/cl-competitive/4d1c601ff42b10773a5d0c5989b1234da5bb98b6/module/test/quicksort.lisp | lisp | FIXME: Resorting to displacement to sort subsequence may be non-standard, | (defpackage :cp/test/quicksort
(:use :cl :fiveam :cp/quicksort :cp/displace)
(:import-from :cp/test/base #:base-suite))
(in-package :cp/test/quicksort)
(in-suite base-suite)
though it is no problem on SBCL .
(defun sort* (vector order start end)
(sort (displace vector start end) order)
vector)
(defun sort-b... |
6a66f66cdc34494979fb38dc99ea6a00ca51adfb74bf9e4dcc3a6dc1b8b9a9ca | webyrd/n-grams-for-synthesis | srfi-14-s48-module.scm | SRFI-14 interface for Scheme48 -*- Scheme -*-
;;;
Complete interface spec for the SRFI-14 char - set - lib library in the
;;; Scheme48 interface and module language. The interface is fully typed, in
;;; the Scheme48 type notation. The structure definitions also provide a
;;; formal description of the external... | null | https://raw.githubusercontent.com/webyrd/n-grams-for-synthesis/b53b071e53445337d3fe20db0249363aeb9f3e51/datasets/srfi/srfi-14/srfi-14-s48-module.scm | scheme |
Scheme48 interface and module language. The interface is fully typed, in
the Scheme48 type notation. The structure definitions also provide a
formal description of the external dependencies of the source code.
Cursors are exact integers in the reference implementation.
These typings would be different with a dif... | SRFI-14 interface for Scheme48 -*- Scheme -*-
Complete interface spec for the SRFI-14 char - set - lib library in the
(define-interface char-set-interface
(export (char-set? (proc (:value) :boolean))
((char-set= char-set<=) (proc (&rest :value) :boolean))
(char-set-hash (proc (:value &opt :exact-inte... |
1ebd6dde383abf7ecbc8d3da442f333ea7895953d75930d9c82e8c71181cb21e | haskell/HTTP | Browser.hs | # LANGUAGE MultiParamTypeClasses , GeneralizedNewtypeDeriving , CPP , FlexibleContexts #
|
Module : Network . Browser
Copyright : See LICENSE file
License : BSD
Maintainer : Ganesh Sittampalam < >
Stability : experimental
Portability : non - portable ( not tested )
Ses... | null | https://raw.githubusercontent.com/haskell/HTTP/0de8def1146967efbbc0bdb4ea8853c6534f6120/Network/Browser.hs | haskell | handle HTTP redirects
handle HTTP redirects
browser monad, effectively a state monad.
:: Request -> BrowserAction Response
:: BrowserState t -> BrowserAction t a -> BrowserAction t a
:: Int -> BrowserAction t ()
:: BrowserAction t (Maybe Int)
:: Maybe Int -> BrowserAction t ()
:: BrowserAction t (Maybe Int)
... | # LANGUAGE MultiParamTypeClasses , GeneralizedNewtypeDeriving , CPP , FlexibleContexts #
|
Module : Network . Browser
Copyright : See LICENSE file
License : BSD
Maintainer : Ganesh Sittampalam < >
Stability : experimental
Portability : non - portable ( not tested )
Ses... |
647b1914e72c19defe9fa6db8dcd7a7b67fe6d2a8ba517d3258f13b726cb3c0e | burkaydurdu/muggle | events.cljs | (ns muggle.houses.events
(:require
[re-frame.core :refer [reg-event-db]]))
(reg-event-db
:houses-list-change
(fn [db [_ new-list-value]]
(assoc db :houses-list new-list-value)))
| null | https://raw.githubusercontent.com/burkaydurdu/muggle/8c457397305be6ea2848a2537669a700d0147997/src/muggle/houses/events.cljs | clojure | (ns muggle.houses.events
(:require
[re-frame.core :refer [reg-event-db]]))
(reg-event-db
:houses-list-change
(fn [db [_ new-list-value]]
(assoc db :houses-list new-list-value)))
| |
edcafc94b418f9be1f66da6d91a33f49a8fb40b9c407ba2056dab10d600d41bd | Clozure/ccl-tests | ignore-errors.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sun Mar 2 20:38:25 2003
Contains : Tests of IGNORE - ERRORS
(in-package :cl-test)
(deftest ignore-errors.1
(ignore-errors)
nil)
(deftest ignore-errors.2
(ignore-errors 'a)
a)
(deftest ignore-errors.3
(ignore-errors (values 1 2 3 4 5 6 7 8))
1 2 3... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/ignore-errors.lsp | lisp | -*- Mode: Lisp -*- | Author :
Created : Sun Mar 2 20:38:25 2003
Contains : Tests of IGNORE - ERRORS
(in-package :cl-test)
(deftest ignore-errors.1
(ignore-errors)
nil)
(deftest ignore-errors.2
(ignore-errors 'a)
a)
(deftest ignore-errors.3
(ignore-errors (values 1 2 3 4 5 6 7 8))
1 2 3 4 5 6 7 8)
(deftest ig... |
a89d8ca8234a8264ddd46e011ddf7eed0e789a12e66ac2a198c5df360d655ba9 | babashka/pod-registry | datalevin.clj | #!/usr/bin/env bb
(require '[babashka.pods :as pods])
(pods/load-pod 'huahaiy/datalevin "0.8.4")
(require '[pod.huahaiy.datalevin :as d])
(def conn (d/get-conn "/tmp/mydb"))
(d/transact! conn [{:greeting "Hello world!"}])
(println (d/q '[:find ?g :where [_ :greeting ?g]] (d/db conn)))
(d/close conn)
| null | https://raw.githubusercontent.com/babashka/pod-registry/90647da5ddc482c138a0a7f6083079fc3dcbf9fa/examples/datalevin.clj | clojure | #!/usr/bin/env bb
(require '[babashka.pods :as pods])
(pods/load-pod 'huahaiy/datalevin "0.8.4")
(require '[pod.huahaiy.datalevin :as d])
(def conn (d/get-conn "/tmp/mydb"))
(d/transact! conn [{:greeting "Hello world!"}])
(println (d/q '[:find ?g :where [_ :greeting ?g]] (d/db conn)))
(d/close conn)
| |
8708f49a61dbb95523c154782167776cc7fc77f6360b47039bae9134f3e32126 | 8c6794b6/guile-tjit | iconv.scm | ;;; Encoding and decoding byte representations of strings
Copyright ( C ) 2013 Free Software Foundation , Inc.
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation ; either
version ... | null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/module/ice-9/iconv.scm | scheme | Encoding and decoding byte representations of strings
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
ME... |
Copyright ( C ) 2013 Free Software Foundation , Inc.
version 3 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , Fifth Floor , Boston , USA
(define-module (ice-9 iconv)
#:use-module (rnrs... |
450f8c266a9592145138f6b2997e14b75f794cacd7634c23015a27df5489d1ee | manuel-serrano/bigloo | make_lib.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / examples / Lib / make_lib.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/examples/Lib/make_lib.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* The file to make the point heap. */
*===========================... | * serrano / prgm / project / bigloo / examples / Lib / make_lib.scm * /
* Author : * /
* Creation : Sat Dec 19 13:01:37 1998 * /
* Last change : Thu Nov 22 17:21:55 2012 ( serrano ) * /
(module _... |
956334a1fcfd7cd592fb5860af060ea9bb5129a0f173718357f5246165626574 | bluegraybox/examples | fizzbuzz_2.erl | #!/usr/local/bin/escript
-mode(compile).
main([]) ->
fizzbuzz(100, 1);
main([MaxStr]) ->
{Max, _} = string:to_integer(MaxStr),
fizzbuzz(Max, 1).
fizzbuzz(Max, X) when X > Max ->
ok;
fizzbuzz(Max, X) when ((X rem 5) == 0) and ((X rem 3) == 0) ->
io:format("fizzbuzz~n"),
fizzbuzz(Max, X + 1);
f... | null | https://raw.githubusercontent.com/bluegraybox/examples/20f238be10e2e987687d7289b2f4897cc7d95abd/fizzbuzz/fizzbuzz_2.erl | erlang | #!/usr/local/bin/escript
-mode(compile).
main([]) ->
fizzbuzz(100, 1);
main([MaxStr]) ->
{Max, _} = string:to_integer(MaxStr),
fizzbuzz(Max, 1).
fizzbuzz(Max, X) when X > Max ->
ok;
fizzbuzz(Max, X) when ((X rem 5) == 0) and ((X rem 3) == 0) ->
io:format("fizzbuzz~n"),
fizzbuzz(Max, X + 1);
f... | |
4e9d0d8f085a75c4983f08f38c7de797c2e195bdb411577bbea93764d176d48a | prg-titech/Kani-CUDA | diffusion2d-h.rkt | #lang rosette
(provide (all-defined-out))
(define M-PI 8)
(define Lx (* 2 M-PI))
(define Ly (* 2 M-PI))
(define Nx 16)
(define Ny 16)
(define dx (exact->inexact (/ Lx (- Nx 1))))
(define dy (exact->inexact (/ Ly (- Ny 1))))
(define dt 0.0001)
(define endT 1.0)
(define Nt (/ endT dt))
(define DIFF 1.0)
(define dxdx (*... | null | https://raw.githubusercontent.com/prg-titech/Kani-CUDA/e97c4bede43a5fc4031a7d2cfc32d71b01ac26c4/Emulator/Examples/Diffusion2d/diffusion2d-h.rkt | racket | #lang rosette
(provide (all-defined-out))
(define M-PI 8)
(define Lx (* 2 M-PI))
(define Ly (* 2 M-PI))
(define Nx 16)
(define Ny 16)
(define dx (exact->inexact (/ Lx (- Nx 1))))
(define dy (exact->inexact (/ Ly (- Ny 1))))
(define dt 0.0001)
(define endT 1.0)
(define Nt (/ endT dt))
(define DIFF 1.0)
(define dxdx (*... | |
49a73f05626d9fc0de84be67184808a5afb19140942fbb7021b7f438683a2162 | cedlemo/OCaml-GI-ctypes-bindings-generator | Ptr_array.ml | open Ctypes
open Foreign
type t
let t_typ : t structure typ = structure "Ptr_array"
let f_pdata = field t_typ "pdata" (ptr void)
let f_len = field t_typ "len" (uint32_t)
let _ = seal t_typ
| null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/GLib/Ptr_array.ml | ocaml | open Ctypes
open Foreign
type t
let t_typ : t structure typ = structure "Ptr_array"
let f_pdata = field t_typ "pdata" (ptr void)
let f_len = field t_typ "len" (uint32_t)
let _ = seal t_typ
| |
8cff2ccaad30749fcfa7f0efb4ca2d44dc8b326bce25e95dc5b2d34735288aef | reanimate/reanimate | doc_oScaleIn.hs | #!/usr/bin/env stack
-- stack runghc --package reanimate
{-# LANGUAGE OverloadedStrings #-}
module Main(main) where
import Reanimate
import Reanimate.Scene
import Reanimate.Builtin.Documentation
main :: IO ()
main = reanimate $ docEnv $ scene $ do
txt <- oNew $ withStrokeWidth 0 $ withFillOpacity 1 $
center $ s... | null | https://raw.githubusercontent.com/reanimate/reanimate/5ea023980ff7f488934d40593cc5069f5fd038b0/examples/doc_oScaleIn.hs | haskell | stack runghc --package reanimate
# LANGUAGE OverloadedStrings # | #!/usr/bin/env stack
module Main(main) where
import Reanimate
import Reanimate.Scene
import Reanimate.Builtin.Documentation
main :: IO ()
main = reanimate $ docEnv $ scene $ do
txt <- oNew $ withStrokeWidth 0 $ withFillOpacity 1 $
center $ scale 3 $ latex "oScaleIn"
oShowWith txt $ adjustDuration (*2) . oScal... |
1f0d1972ca748d267a218e93a55809fe185c5071b27751f246add090028bedb1 | jwiegley/notes | Fib.hs | module Main where
import Control.Monad
import Data.Time.Clock
foldl :: Monad m => (a -> Maybe ()) -> (b -> a -> b) -> b -> [a] -> m (Maybe b)
foldl _ _ z [] = return (Just z)
foldl b f z (x:xs) =
fmap join $ forM (b x) $ \() ->
Main.foldl b f (f z x) xs
foldl2 :: Monad m => (a -> Maybe ()) -> (b -> a... | null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/haskell/Fib.hs | haskell | module Main where
import Control.Monad
import Data.Time.Clock
foldl :: Monad m => (a -> Maybe ()) -> (b -> a -> b) -> b -> [a] -> m (Maybe b)
foldl _ _ z [] = return (Just z)
foldl b f z (x:xs) =
fmap join $ forM (b x) $ \() ->
Main.foldl b f (f z x) xs
foldl2 :: Monad m => (a -> Maybe ()) -> (b -> a... | |
386ae5c16395a337deff5d9e79fbddcc732a8aa7779e1c64f5f24a2e2e09b379 | disconcision/fructure | navigate.rkt | #lang racket
(require "../../shared/containment-patterns/containment-patterns/main.rkt"
"../../shared/slash-patterns/slash-patterns.rkt"
"../common.rkt"
"legacy.rkt"
"transform.rkt") ; for insert-menu; refactor todo
(provide mode:navigate
mode:navigate-ctrl
mode:n... | null | https://raw.githubusercontent.com/disconcision/fructure/d434086052eab3c450f631b7b14dcbf9358f45b7/src/mode/navigate.rkt | racket | for insert-menu; refactor todo
navigation major mode
moves the cursor up to the nearest containing handle
bug? ▹ isn't bound if no pair attributes?
moves the cursor to the closet handle beneath it
moves the cursor right in a preorder traversal
as well as the current selection, and therein advance the cursor
... | #lang racket
(require "../../shared/containment-patterns/containment-patterns/main.rkt"
"../../shared/slash-patterns/slash-patterns.rkt"
"../common.rkt"
"legacy.rkt"
(provide mode:navigate
mode:navigate-ctrl
mode:navigate-shift
capture-at-cursor)
(define (mode:na... |
bf496aa78f410130eb0143f8a12c4511b05e8a55c8c498949ba352435579158e | yrashk/erlang | snmpa_local_db.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2009 . 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 Pub... | null | https://raw.githubusercontent.com/yrashk/erlang/e1282325ed75e52a98d58f5bd9fb0fa27896173f/lib/snmp/src/agent/snmpa_local_db.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 limita... | Copyright Ericsson AB 1996 - 2009 . 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 "
-module(snmpa_local_db).
-include_lib("ker... |
bd0a5183b7d8fc0de42bb08cdaf81be1271b1c3e26742d07ed56ebb9c9827d33 | reach-sh/reach-lang | ALGO_SourceMap.hs | # OPTIONS_GHC -Wno - missing - export - lists #
module Reach.Connector.ALGO_SourceMap where
import Control.Monad.Extra
import Data.Aeson ((.:))
import qualified Data.Aeson as AS
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Internal as BI
import qu... | null | https://raw.githubusercontent.com/reach-sh/reach-lang/f79282c49705c66fc10489045d502d17621d60c5/hs/src/Reach/Connector/ALGO_SourceMap.hs | haskell | # OPTIONS_GHC -Wno - missing - export - lists #
module Reach.Connector.ALGO_SourceMap where
import Control.Monad.Extra
import Data.Aeson ((.:))
import qualified Data.Aeson as AS
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Internal as BI
import qu... | |
3020f5807670bf1a6d3187db656ceb9385493b80e2b239437feb58631ac9bdca | zen-lang/zen | schema_test.clj | (ns zen.schema-test
(:require [zen.schema :as sut]
[matcho.core :as matcho]
[clojure.test :as t]
[clojure.string :as str]
[zen.core]))
(sut/register-compile-key-interpreter!
[:keys ::ts]
(fn [_ ztx ks]
(fn [vtx data opts]
(if-let [s (or (when-let [nm (:z... | null | https://raw.githubusercontent.com/zen-lang/zen/dcc55ee80aad6d1689d2d30d638e4ba56542d645/test/zen/schema_test.clj | clojure | (ns zen.schema-test
(:require [zen.schema :as sut]
[matcho.core :as matcho]
[clojure.test :as t]
[clojure.string :as str]
[zen.core]))
(sut/register-compile-key-interpreter!
[:keys ::ts]
(fn [_ ztx ks]
(fn [vtx data opts]
(if-let [s (or (when-let [nm (:z... | |
765c251d45c7b16c7e3facede52d042a1041bea1fe06f508b26ca249961c3989 | kudu-dynamics/blaze | General.hs | module Blaze.Cfg.Solver.General where
import Blaze.Prelude hiding (Type, sym, bitSize, Constraint)
import qualified Blaze.Types.Pil as Pil
import qualified Data.HashSet as HSet
import Blaze.Types.Pil.Checker (DeepSymType, SymTypedStmt)
import Blaze.Types.Cfg (Cfg, CfNode, BranchType(TrueBranch, FalseBranch), CfEdge (... | null | https://raw.githubusercontent.com/kudu-dynamics/blaze/f08a5d6dd76420828afc056010bf14a262955ba4/src/Blaze/Cfg/Solver/General.hs | haskell | | Accumulation of branch conditions that should be rechecked during
the next iteration ('condsToRecheck') and the edges which were found to be
unsat and should be removed ('edgesToRemove').
has been removed, this returns information about which conditional edge remains
and the branching condition.
this is handled... | module Blaze.Cfg.Solver.General where
import Blaze.Prelude hiding (Type, sym, bitSize, Constraint)
import qualified Blaze.Types.Pil as Pil
import qualified Data.HashSet as HSet
import Blaze.Types.Pil.Checker (DeepSymType, SymTypedStmt)
import Blaze.Types.Cfg (Cfg, CfNode, BranchType(TrueBranch, FalseBranch), CfEdge (... |
40a3b99935cc27388993a2a403dba7a86e7a95529c99279028b211b511fa5ab9 | skynet-gh/skylobby | host_battle.clj | (ns skylobby.fx.host-battle
(:require
[cljfx.api :as fx]
clojure.set
skylobby.fx
[skylobby.fx.engines :refer [engines-view]]
[skylobby.fx.maps :refer [maps-view]]
[skylobby.fx.mods :refer [mods-view]]
[skylobby.fx.sub :as sub]
[skylobby.util :as u]
[taoensso.tufte :as tufte]))
(s... | null | https://raw.githubusercontent.com/skynet-gh/skylobby/e25c88d149c298326ec8a32306a86485c2324fd8/src/clj/skylobby/fx/host_battle.clj | clojure | (ns skylobby.fx.host-battle
(:require
[cljfx.api :as fx]
clojure.set
skylobby.fx
[skylobby.fx.engines :refer [engines-view]]
[skylobby.fx.maps :refer [maps-view]]
[skylobby.fx.mods :refer [mods-view]]
[skylobby.fx.sub :as sub]
[skylobby.util :as u]
[taoensso.tufte :as tufte]))
(s... | |
394d7a28af4551bd5d21dbe2115200a3fc17e540f2bdaf1d483e9b7195b682ee | crategus/cl-cffi-gtk | rtest-gtk-action.lisp | (def-suite gtk-action :in gtk-suite)
(in-suite gtk-action)
(defvar *verbose-gtk-action* nil)
;;; GtkAction
(test gtk-action-class
;; Type check
(is (g-type-is-object "GtkAction"))
;; Check the registered name
(is (eq 'gtk-action
(registered-object-type-by-name "GtkAction")))
;; Check the parent... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/74a78a6912a96f982644f3ee5ab7b8396cc2235f/test/rtest-gtk-action.lisp | lisp | GtkAction
Type check
Check the registered name
Check the parent
Check the children
Check the interfaces
Check the class properties
Check the class definition
gtk-action-name
gtk-action-is-sensitive
gtk-action-sensitive
gtk-action-is-visible
gtk-action-visible
gtk-action-activate
gtk-actio... | (def-suite gtk-action :in gtk-suite)
(in-suite gtk-action)
(defvar *verbose-gtk-action* nil)
(test gtk-action-class
(is (g-type-is-object "GtkAction"))
(is (eq 'gtk-action
(registered-object-type-by-name "GtkAction")))
(is (eq (gtype "GObject") (g-type-parent "GtkAction")))
(is (equal '("GtkToggleA... |
571464084da0d92d73f8f48ee6d984d3ca4db936b6b91e59e41c589cedd6a30e | NetComposer/nksip | refer_test_client3.erl | %% -------------------------------------------------------------------
%%
%% refer_test: REFER Test
%%
Copyright ( c ) 2013 . 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 . Yo... | null | https://raw.githubusercontent.com/NetComposer/nksip/7fbcc66806635dc8ecc5d11c30322e4d1df36f0a/test/callbacks/refer_test_client3.erl | erlang | -------------------------------------------------------------------
refer_test: REFER Test
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 lan... | Copyright ( c ) 2013 . 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
-module(refer_test_client3).... |
a5314351eeadd31f9aa07b13484fe3d273aaf305a8697cb1b0642e16c17f375f | erlyaws/yaws | yaws_jsonrpc.erl | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% WARNING DEPRECATED WARNING DEPRECATED WARNING DEPRECATED WARNING DEPRECATED
%%% WARNING DEPRECATED WARNING DEPRECATED WARNING DEPRECATED WARNING DEPRECATED
... | null | https://raw.githubusercontent.com/erlyaws/yaws/bbd0a2224f03fe60db6c986da4e4b2f0c9227402/src/yaws_jsonrpc.erl | erlang |
WARNING DEPRECATED WARNING DEPRECATED WARNING DEPRECATED WARNING DEPRECATED
WARNING DEPRECATED WARNING DEPRECATED WARNING DEPRECATED WARNING DEPRECATED
This module is deprecated.
Do not report problems with this module, as they will not be fixed. You
should instead convert your code to use the yaws_rpc module... | Use module yaws_rpc.erl instead
Copyright ( C ) 2003 < > .
Copyright ( C ) 2006 < >
< >
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ` ` AS IS '' AND ANY ... |
c227fb7d2615da80617b2deb528649a027027ccf34632d586e87f30a2b7ec7e9 | ar-nelson/schemepunk | function.test.scm | (import (scheme base)
(schemepunk syntax)
(schemepunk function)
(schemepunk test))
(test-group "Function Combinators"
(test-equal 'foo (identity 'foo))
(test-equal 'foo ((const 'foo) 'bar))
(test-equal '(y . x) ((flip cons) 'x 'y))
(test-equal "-2" ((compose number->string - length) '(1... | null | https://raw.githubusercontent.com/ar-nelson/schemepunk/e2840d3c445933528aaf0a36ec72b053ec5016ce/tests/function.test.scm | scheme | (import (scheme base)
(schemepunk syntax)
(schemepunk function)
(schemepunk test))
(test-group "Function Combinators"
(test-equal 'foo (identity 'foo))
(test-equal 'foo ((const 'foo) 'bar))
(test-equal '(y . x) ((flip cons) 'x 'y))
(test-equal "-2" ((compose number->string - length) '(1... | |
88eb7932b54e31f44a4df9cb27739456e99f2be4e3fb52492e75f7cb79e970b7 | idubrov/siperl | sip_uri.erl | %%%----------------------------------------------------------------
@author < >
%%% @doc URI parse utilities
%%%
Implementation of parsing for supported URI schemes ( ` sip ' , ` sips ' , ` tel ' ) .
%%% @end
@reference See < a href=" / html / rfc3261#section-19">RFC 3261</a > for details .
2011 - 2012 ... | null | https://raw.githubusercontent.com/idubrov/siperl/251daf3a0d7c7442f56f42cfd6c92764a4f475a7/apps/sip/src/syntax/sip_uri.erl | erlang | ----------------------------------------------------------------
@doc URI parse utilities
@end
----------------------------------------------------------------
Exports
API
Include files
-----------------------------------------------------------------
API functions
-----------------------------------------------... | @author < >
Implementation of parsing for supported URI schemes ( ` sip ' , ` sips ' , ` tel ' ) .
@reference See < a href=" / html / rfc3261#section-19">RFC 3261</a > for details .
2011 - 2012 . See LICENSE file .
-module(sip_uri).
-export([parse/1, format/1]).
-export([is_loose_router/1, is_strict_r... |
332e1a260496def1e71c2f23324f95d5dc81b65ab5807642cf319e587135b649 | ghcjs/jsaddle-dom | JSDOM.hs | # LANGUAGE CPP , OverloadedStrings , PatternSynonyms #
#ifndef ghcjs_HOST_OS
# LANGUAGE RecursiveDo #
#endif
module JSDOM (
globalThis
, globalThisUnchecked
, currentWindow
, currentWindowUnchecked
, currentDocument
, currentDocumentUnchecked
, syncPoint
, syncAfter
, waitForAnimationFrame
, nextAnimationFrame
, Anim... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/fa40dd223c3128e7f2560e4f49486ca1673b78f6/src/JSDOM.hs | haskell | |
Run the action in an animationframe callback. The action runs in a
synchronous thread, and is passed the high-performance clock time
stamp for that frame.
^ what to do when encountering a blocking call
^ the action to run
Take the list of pending animation fram handlers
Add this handler to the l... | # LANGUAGE CPP , OverloadedStrings , PatternSynonyms #
#ifndef ghcjs_HOST_OS
# LANGUAGE RecursiveDo #
#endif
module JSDOM (
globalThis
, globalThisUnchecked
, currentWindow
, currentWindowUnchecked
, currentDocument
, currentDocumentUnchecked
, syncPoint
, syncAfter
, waitForAnimationFrame
, nextAnimationFrame
, Anim... |
f7fad70ee4b36df8707dee03931b3568c44e332306e00d94cf89d268af272a7d | NorfairKing/smos | ProjectsSpec.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeApplications #
module Smos.Report.ProjectsSpec where
import Data.Tree
import Smos.Data
import Smos.Report.Archive.Gen ()
import Smos.Report.Filter.Gen ()
import Smos.Report.Projects
import Smos.Report.Projects.Gen ()
import Test.Syd
import Test.Syd.Validity
import Tes... | null | https://raw.githubusercontent.com/NorfairKing/smos/3bb953f467d83aacec1ce1dd59b687c87258559e/smos-report-gen/test/Smos/Report/ProjectsSpec.hs | haskell | # LANGUAGE OverloadedStrings #
describe "makeProjectsReport" $
it "produces valid reports for interesting stores" $
forAllValid $
\mFilter ->
shouldBeValid wr | # LANGUAGE TypeApplications #
module Smos.Report.ProjectsSpec where
import Data.Tree
import Smos.Data
import Smos.Report.Archive.Gen ()
import Smos.Report.Filter.Gen ()
import Smos.Report.Projects
import Smos.Report.Projects.Gen ()
import Test.Syd
import Test.Syd.Validity
import Test.Syd.Validity.Aeson
spec :: Spec
... |
c40e1f2dfbee174b656fc2210209bfd93505a6f0e866bfbc3701155b480cbdb9 | acowley/GLUtil | Linear.hs | # LANGUAGE CPP , DefaultSignatures , FlexibleInstances , FlexibleContexts ,
ScopedTypeVariables #
ScopedTypeVariables #-}
|Support for writing " Linear " types to uniform locations in
-- shader programs.
module Graphics.GLUtil.Linear (AsUniform(..)) where
import Foreign.Marshal.Array (with... | null | https://raw.githubusercontent.com/acowley/GLUtil/09faac00072b08c72ab12bcc57d4ab2a02ff1c88/src/Graphics/GLUtil/Linear.hs | haskell | shader programs.
| A type class for things we can write to uniform locations in
shader programs. We can provide instances of this class for types
Support lists of vectors as uniform arrays of vectors. | # LANGUAGE CPP , DefaultSignatures , FlexibleInstances , FlexibleContexts ,
ScopedTypeVariables #
ScopedTypeVariables #-}
|Support for writing " Linear " types to uniform locations in
module Graphics.GLUtil.Linear (AsUniform(..)) where
import Foreign.Marshal.Array (withArray)
import Foreig... |
bbb179b157cefaf3e0f9b47a9ca6b6b2dc38676ef72f25f9e3267a792452d1b8 | heechul/crest-z3 | rmtmps.ml |
*
* Copyright ( c ) 2001 - 2002 ,
* < >
* < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
* ... | null | https://raw.githubusercontent.com/heechul/crest-z3/cfcebadddb5e9d69e9956644fc37b46f6c2a21a0/cil/src/rmtmps.ml | ocaml | rmtmps.ml
implementation for rmtmps.mli
Set on the command-line:
**********************************************************************
*
* Scanning and categorization of pragmas
*
collections of names of things to keep
rapid transfer of control when we find a malformed pragma
Save this length so we do... |
*
* Copyright ( c ) 2001 - 2002 ,
* < >
* < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
* ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.