haskell - Printing definitions of functions/classes in ghci with lambdabot -


how can view source definitions in ghci (with lambdabot 2.5 ghci on acid) of functions/classes etc defined in project or cabal dependencies? example suppose have :

module main import system.random  gen = (random (mkstdgen 0)) :: (bool,stdgen)  myadd :: int -> int myadd x = 2 * x  main =   print "finished" 

then can information on myadd , random cannot print source. here can in ghci (with lambdabot) :

*main goa> :src foldr  foldr f z []     = z foldr f z (x:xs) = f x (foldr f z xs) *main goa> :i myadd myadd :: int -> int     -- defined @ test.hs:7:1 *main goa> :src myadd  source not found. don't think can friend on facebook anymore. *main goa> :i random class random   ...   random :: randomgen g => g -> (a, g)   ...     -- defined in ‘system.random’ *main goa> :src random  source not found. listen, broccoli brains, don't have time listen trash. 

lambdabot seems able print definitions of foldr not functions defined in project (myadd) or functions in cabal depedencies (random).

is possible me print out definitions of things myadd , random, using feature of lambdabot? know can use hoogle random want know if there way use ghci or lambdabot print out source definitions.

[edit]

since posting discovered emacs/inferior haskell processes , of functionality theirin seems achieve of above.

lambdabot's src can't this. based on short list of function definitions ships lambdabot itself, cf. https://github.com/mokus0/lambdabot/blob/master/lambdabot/state/source. consequently lies, example foldr defined in ghc's libraries as

foldr k z = go               go []     = z         go (y:ys) = y `k` go ys 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -