All Projects → takenobu-hs → Haskell Symbol Search Cheatsheet

takenobu-hs / Haskell Symbol Search Cheatsheet

Haskell/GHC symbol search cheatsheet

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to Haskell Symbol Search Cheatsheet

Phpgrep
Syntax-aware grep for PHP code.
Stars: ✭ 185 (-23.87%)
Mutual labels:  search, syntax
Gogrep
Search for Go code using syntax trees
Stars: ✭ 450 (+85.19%)
Mutual labels:  search, syntax
Haskell Ide Engine
The engine for haskell ide-integration. Not an IDE
Stars: ✭ 2,433 (+901.23%)
Mutual labels:  ghc
Place Search Dialog
A place autocomplete search dialog which uses Google's places API for finding results.
Stars: ✭ 235 (-3.29%)
Mutual labels:  search
Amber
A code search / replace tool
Stars: ✭ 230 (-5.35%)
Mutual labels:  search
Linqit
Extend python lists with .NET's LINQ syntax for clean and fast coding. Also known as PINQ.
Stars: ✭ 222 (-8.64%)
Mutual labels:  syntax
Vim Cpp Modern
Extended Vim syntax highlighting for C and C++ (C++11/14/17/20)
Stars: ✭ 229 (-5.76%)
Mutual labels:  syntax
Angular Instantsearch
⚡️Lightning-fast search for Angular apps, by Algolia
Stars: ✭ 219 (-9.88%)
Mutual labels:  search
Chroma
A general purpose syntax highlighter in pure Go
Stars: ✭ 3,013 (+1139.92%)
Mutual labels:  syntax
Grab
experimental and very fast implementation of a grep
Stars: ✭ 230 (-5.35%)
Mutual labels:  search
Persistent Search View
An Android library designed to simplify the process of implementing search-related functionality.
Stars: ✭ 232 (-4.53%)
Mutual labels:  search
Trinity
Trinity IR Infrastructure
Stars: ✭ 227 (-6.58%)
Mutual labels:  search
Scoper
Fuzzy and semantic search for captioned YouTube videos.
Stars: ✭ 225 (-7.41%)
Mutual labels:  search
Elastix
A simple Elasticsearch REST client written in Elixir.
Stars: ✭ 231 (-4.94%)
Mutual labels:  search
Sitedorks
Search Google/Bing/Ecosia/DuckDuckGo/Yandex/Yahoo for a search term with a default set of websites, bug bounty programs or a custom collection.
Stars: ✭ 221 (-9.05%)
Mutual labels:  search
Jina
Cloud-native neural search framework for 𝙖𝙣𝙮 kind of data
Stars: ✭ 12,618 (+5092.59%)
Mutual labels:  search
Bower Components
[DEPRECATED] Site to discover Bower components
Stars: ✭ 220 (-9.47%)
Mutual labels:  search
Clarifyjs
Create and Execute Chained Javascript Methods In Any Order You want
Stars: ✭ 227 (-6.58%)
Mutual labels:  syntax
Search Omnifocus
Alfred workflow that allows free text searching of OmniFocus tasks
Stars: ✭ 231 (-4.94%)
Mutual labels:  search
Instantsearch.js
⚡️ A JavaScript library for building performant and instant search experiences with Algolia.
Stars: ✭ 2,799 (+1051.85%)
Mutual labels:  search

Haskell/GHC symbol search cheatsheet

Several features of Haskell/GHC have low googleability. Because some of them are composed of symbols :)
This page is a reference collection to support search of them.

If you want to search for function symbols like ., $, >>=, <*>, ..., you can use the following search engines:

Happy Haskelling!


! : "strictness flag"

[ Haskell 2010 Language Report ]

data Vec = Vec !Int

! : "bang pattern"

[ GHC User’s Guide ]

f1 !x = 

# : "MagicHash"

[ GHC User’s Guide ]

data Int = I# Int#

# : "OverloadedLabels"

[ GHC User’s Guide ]

example = #x (Point 1 2)

# : C pre-processor's directive

[ GHC User’s Guide ]

#include "MachDeps.h"

# : hsc2hs command's operator

[ GHC User’s Guide ]

flag = #const VER_MAJORVERSION

$( ) : Template Haskell’s splice syntax

[ GHC User’s Guide ]

two = $(add1 1)

$$( ) : Typed Template Haskell’s splice syntax

[ GHC User’s Guide ]

two = $$(add1 1)

%1 -> : "Linear types"

[ GHC User’s Guide ]

f :: a %1 -> a 

' : an identifier consists of a letter followed by zero or more letters, digits, underscores, and single quotes

[ Haskell 2010 Language Report ]

xs' = f ys

' : promoted constructors are prefixed by a tick '

[ GHC User’s Guide ]

type * = TYPE 'LiftedRep

' '' : Template Haskell’s quotation syntax

[ GHC User’s Guide ]

makeLenses ''FooBar

() : "unit type"

[ Haskell 2010 Language Report ] [ Haskell 2010 Language Report ]

main :: IO ()

() : "unit expression"

[ Haskell 2010 Language Report ] [ Haskell 2010 Language Report ]

return ()

( ) : "section" - a convenient syntax for partial application

[ Haskell 2010 Language Report ]

add1 = (1+)

(,) : the constructor for a tuple

[ Haskell 2010 Language Report ]

f x y = liftM2 (,) x y 

(, xxx) : "TupleSections"

[ GHC User’s Guide ]

f xs = fmap (, True) xs

(# #) : "unboxed tuple"

[ GHC User’s Guide ]

f x y = (# x+1, y-1 #)

(# | | #) : "unboxed sum"

[ GHC User’s Guide ]

f :: (# Int | Bool | Char #) -> Int
f (# x | | #)    = 1
f (# | True | #) = 2
f _              = 3

(..) : export all of its names

[ Haskell 2010 Language Report ]

module GHC.Arr (
        Ix(..),

(..) : import all of its names

[ Haskell 2010 Language Report ]

import GHC.Types (Bool(..))

* : the kind of ordinary types (synonym for Type and TYPE `LiftedRep)

[ Haskell 2010 Language Report ] [ GHC User’s Guide ] [ GHC User’s Guide ]

ghci> :kind Int
Int :: *

-> : case expression

[ Haskell 2010 Language Report ]

f x = case x of
        Nothing -> False
        Just _  -> True

-> : "view pattern"

[ GHC User’s Guide ]

size (view -> Unit)        = 1
size (view -> Arrow t1 t2) = size t1 + size t2

-> : "function type"

[ Haskell 2010 Language Report ]

id :: a -> a

. : module names are a dot-separated sequence

[ Haskell 2010 Language Report ]

import Data.Maybe
import qualified Text.Read.Lex as L

lexP = lift L.lex

. : universal quantification

[ GHC User’s Guide ]

f :: forall a. a -> [a]

: : "list constructor" (cons)

[ Haskell 2010 Language Report ] [ Haskell 2010 Language Report ] [ Haskell 2010 Language Report ]

f x xs = x:xs

: : an operator symbol starting with a colon is a constructor

[ Haskell 2010 Language Report ]

data NonEmpty a = a :| [a]

:: : "type signature"

[ Haskell 2010 Language Report ]

id :: a -> a
id x =  x

:: : "expression type-signature" (type annotation)

[ Haskell 2010 Language Report ]

x = fromIntegral (maxBound::Int)

; : semicolon in layout rule

[ Haskell 2010 Language Report ]

f x = let a = 1; b = 2  
          g y = exp2  
      in exp1 

<- : lambda-bound in do expression

[ Haskell 2010 Language Report ]

f = do
  x <- getLine
  putStrLn x

<- : "pattern guard"

[ Haskell 2010 Language Report ]

f x
  | Just y <- g x = 

=> : context (type class constraint)

[ Haskell 2010 Language Report ]

subtract :: (Num a) => a -> a -> a
subtract x y = y - x

? : "ImplicitParams"

[ GHC User’s Guide ]

sort :: (?cmp :: a -> a -> Bool) => [a] -> [a]
sort = sortBy ?cmp

@ : "as pattern"

[ Haskell 2010 Language Report ]

f [email protected](x:xs) = 

@ : "type application"

[ GHC User’s Guide ]

f = read @Int

[] : "empty list" (nil)

[ Haskell 2010 Language Report ] [ Haskell 2010 Language Report ]

null [] = True
null _  = False

[ .. ] : "arithmetic sequence"

[ Haskell 2010 Language Report ]

xs = [1..10]

[ | <- ] : "list comprehension"

[ Haskell 2010 Language Report ]

xs = [x^2 | x <- [1..10]] 

[| |] : Template Haskell’s quotation syntax

[ GHC User’s Guide ]

add1 x = [| x + 1 |]

[|| ||] : Typed Template Haskell’s quotation syntax

[ GHC User’s Guide ]

add1 x = [|| x + 1 ||]

_ : "wildcard pattern"

[ Haskell 2010 Language Report ]

f Red  =
f Blue =
f _    =

_ : unused identifiers beginning with underscore

[ GHC User’s Guide ] [ Haskell 2010 Language Report ]

_w = True                -- No warning: _w starts with an underscore

_ : "typed hole"

[ GHC User’s Guide ]

sum xs = foldr _ 0 xs

_ : "NumericUnderscores"

[ GHC User’s Guide ]

million = 1_000_000

\ -> : "lambda abstraction"

[ Haskell 2010 Language Report ]

add1 = \x -> x + 1

\case -> : "LambdaCase"

[ GHC User’s Guide ]

f = \case
      Red  -> 2
      Blue -> 1
      _    -> 0

` ` : "infix notation" - an identifier enclosed in grave accents

[ Haskell 2010 Language Report ]

div10 x = x `div` 10

{ } : brace in layout rule

[ Haskell 2010 Language Report ]

f x = case x of {Nothing -> False; Just _ -> True}

{ } : "record syntax" (datatypes with field labels)

[ Haskell 2010 Language Report ]

data MyPoint = Point { x :: Int, y :: Int }

{..} : "record wildcard"

[ GHC User’s Guide ]

f Vec{..} = 

{-# #-} : "compiler pragma"

[ Haskell 2010 Language Report ] [ GHC User’s Guide ] [ GHC User’s Guide ]

{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE GADTs            #-}

{-# INLINE fmap #-}

| : "boolean guard" (guard)

[ Haskell 2010 Language Report ]

clip255 x
  | x > 255   = 255
  | otherwise = x 

| : "MultiWayIf"

[ GHC User’s Guide ]

if | x == ":q" -> quit
   | isError x -> errorExit x
   | otherwise -> execCommand x

| : algebraic datatype declaration

[ Haskell 2010 Language Report ]

data Maybe a = Nothing | Just a

| : "functional dependency"

[ GHC User’s Guide ]

class Foo a b c | a b -> c where 

~ : "irrefutable pattern"

[ Haskell 2010 Language Report ]

f1 ~(as,bs) =

~ : "equality constraint"

[ GHC User’s Guide ]

class (F a ~ b) => C a b where
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].