Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

F# Write a function: toUpper : string -> string so that toUpper s returns the string s with all characters in upper case: toUpper Hej

F#

Write a function:

toUpper : string -> string so that toUpper s returns the string s with all characters in upper case: toUpper "Hej" = "HEJ" Hint: Use System.Char.ToUpper to convert characters to upper case. You can do it in one line using implode, List.map and explode. Write the same function toUpper1 using forward function composition ((f g) x = g(f x)) . Write the same function toUpper2 using the pipe-forward operator (|>) and backward function composition (). Hint: is defined as (f g) x = (f o g) x = f(g(x)). Hint: |> is defined as x |> f = f x. The two operators are by default supported by F#. You can have F# interactive print the types: > (<<);; val it : ((a -> b) -> (c -> a) -> c -> b) = > (|>);; val it : (a -> (a -> b) -> b) = > (>>);; val it : ((a -> b) -> (b -> c) -> a -> c) =

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

More Books

Students also viewed these Databases questions

Question

Describe the process for developing a budget.

Answered: 1 week ago