Question

For example say I had 'A' I could call the function like so:

replicate 'A' 5 ~> "AAAAA"
Was it helpful?

Solution

Yes, exact same name but the arguments are switched.

http://hackage.haskell.org/package/base-4.6.0.1/docs/Prelude.html#v:replicate

If you go to hoogle you can search functions by type signature and name.

http://www.haskell.org/hoogle/?hoogle=Char+-%3E+Int+-%3E+String

See that replicate was the 3rd result.

OTHER TIPS

It's replicate in the prelude.

replicate 5 'A'

returns: "AAAAA"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top