Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: Beginners Digest, Vol 89, Issue 38 How to define a
simple function (MJ Williams)
2. Re: Beginners Digest, Vol 89, Issue 38 How to define a
simple function (Gesh)
----------------------------------------------------------------------
Message: 1
Date: Tue, 24 Nov 2015 04:29:16 +0000
From: MJ Williams <[email protected]>
To: Francisco Gutierrez <[email protected]>, The
Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Beginners Digest, Vol 89, Issue 38
How to define a simple function
Message-ID:
<CAAKj9FO+s_x59+f65r6s98u+CFWQ3Sep0Gm6JgzOk=1c7xg...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
In short, your types do not match in your calculation of the half of
the length of the list. According to GHCI
length :: [a] -> Int
(/) :: Fractional a => a -> a -> a
floor :: (Integral b, RealFrac a) => a -> b
Can you see how you might run into problems with this mixed bag of types?
The only instance where you might find type compatibility between
above types would be if you were passing a value of type `Int' to a
function that accepted values of type `Integral'. `Int', if you like,
is a subset of `Integral'
A simple solution would be to replace `/' with `div' (`div :: Integral
a => a -> a -> a'). Thus, your functionwould look something like
halve :: [a] -> [[a], [a]]
halve xs = [take longitud xs, drop longitud xs]
where
longitud = div (length xs) 2
Hope that helps, and don't hesitate to come back with more questions.
Matthew
On 23/11/2015, Francisco Gutierrez <[email protected]> wrote:
> Dear sirs:I am defining a function halve, that breaks a list in two halfs.
> But I always get an error. Below is my code. What am I doing
> wrong?Thanks!halve xs = [take (floor (longitud/2)), drop (floor
> (longitud/2))]? where longitud = length xs
>
>
> From: "[email protected]" <[email protected]>
> To: [email protected]
> Sent: Saturday, November 21, 2015 8:21 PM
> Subject: Beginners Digest, Vol 89, Issue 38
>
> Send Beginners mailing list submissions to
> ??? [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> ??? http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> or, via email, send a message with subject or body 'help' to
> ??? [email protected]
>
> You can reach the person managing the list at
> ??? [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Beginners digest..."
>
>
> Today's Topics:
>
> ? 1. Re:? Warning: Tab Character (Dan Stromberg)
> ? 2. Re:? Warning: Tab Character (Jeon-Young Kang)
> ? 3. Re:? Warning: Tab Character (Thomas Jakway)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 21 Nov 2015 16:44:21 -0800
> From: Dan Stromberg <[email protected]>
> To: The Haskell-Beginners Mailing List - Discussion of primarily
> ??? beginner-level topics related to Haskell <[email protected]>
> Subject: Re: [Haskell-beginners] Warning: Tab Character
> Message-ID:
> ??? <caovkw55oxccehtqppc0bxqzjoeev5vcynbtwhaj9c5vhhm7...@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> I believe the first version of make required tabs, but some subsequent
> versions have relaxed that requirement to make things easier.
>
> Here's an example on a Linux Mint system (the 20's are of course spaces) :
> $ od -cx < Makefile
> cmd output started 2015 Sat Nov 21 04:39:47 PM PST
> 0000000? \n? g? o? :? \n? ? ? ? ? ? ? ? ? .? /? t? \n? \n
> ? ? ? ? ? 670a? ? 3a6f? ? 200a? ? 2020? ? 2e20? ? 742f? ? 0a0a
> 0000016
> above cmd output done? ? 2015 Sat Nov 21 04:39:47 PM PST
> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>
> $ make
> cmd output started 2015 Sat Nov 21 04:39:48 PM PST
> Makefile:3: *** missing separator.? Stop.
> above cmd output done? ? 2015 Sat Nov 21 04:39:48 PM PST
> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>
> $ make --version
> cmd output started 2015 Sat Nov 21 04:39:53 PM PST
> GNU Make 3.81
> Copyright (C) 2006? Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.
> There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
> PARTICULAR PURPOSE.
>
> This program built for i686-pc-linux-gnu
> above cmd output done? ? 2015 Sat Nov 21 04:39:53 PM PST
> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>
>
> I'll add that vim's Makefile syntax highlighting puts the space-indented
> line in red, suggesting an error.? Changing the spaces to a single tab
> makes the red go away.
>
> HTH
>
> On Sat, Nov 21, 2015 at 3:34 PM, Thomas Jakway <[email protected]> wrote:
>
>> Why would make require tabs...?
>> Admittedly it's been a long time since I've written any makefiles by hand
>> but I always use spaces instead of tabs and have never had any problems.
>>
>> On Nov 21, 2015 6:01 PM, David Moberg <[email protected]> wrote:
>> >
>> > Have you found "soft tabs"? That option will make TextMate use spaces
>> instead of tab characters. Read 4.11 "Using Spaces Instead of Tabs" in
>> Dan
>> Strombergs link for instrucitons.
>> >
>> > 2015-11-21 21:36 GMT+01:00 Jeon-Young Kang <[email protected]>:
>> >>
>> >> I've tried to choose "instead of spaces". But there is no option of
>> mine (Textmate 2 beta).
>> >>
>> >> On Sat, Nov 21, 2015 at 3:14 PM, Dan Stromberg <[email protected]>
>> wrote:
>> >>>
>> >>>
>> >>> Perhaps enable soft tabs?
>> >>> https://manual.macromates.com/en/working_with_text
>> >>>
>> >>> This is an issue in Python too (at least from PEP8's perspective) -
>> but note that many "make" programs require tabs instead of spaces.
>> >>>
>> >>> On Sat, Nov 21, 2015 at 11:13 AM, Jeon-Young Kang
>> >>> <[email protected]>
>> wrote:
>> >>>>
>> >>>> Hello everyone.
>> >>>>
>> >>>>
>> >>>> I am a newbie of Haskell, using Textmate on mac.
>> >>>>
>> >>>>
>> >>>> I got the following warning. How can I fix it?
>> >>>>
>> >>>>
>> >>>> Warning:
>> >>>>
>> >>>>? ? Tab character
>> >>>>
>> >>>> Ok, modules loaded: Main.
>> >>>>
>> >>>>
>> >>>>
>> >>>> Sincerely,
>> >>>> Young
>> >>>>
>> >>>> _______________________________________________
>> >>>> Beginners mailing list
>> >>>> [email protected]
>> >>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>> >>>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Dan Stromberg
>> >>>
>> >>> _______________________________________________
>> >>> Beginners mailing list
>> >>> [email protected]
>> >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>> >>>
>> >>
>> >>
>> >>
>> >> --
>> >> Department of Geography
>> >> State University of New York at Buffalo
>> >>
>> >> [email protected]
>> >>
>> >> Jeon-Young Kang
>> >>
>> >> _______________________________________________
>> >> Beginners mailing list
>> >> [email protected]
>> >> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>> >>
>> >
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>
>
>
> --
> Dan Stromberg
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://mail.haskell.org/pipermail/beginners/attachments/20151121/bef7b6d7/attachment-0001.html>
>
> ------------------------------
>
> Message: 2
> Date: Sat, 21 Nov 2015 20:03:08 -0500
> From: Jeon-Young Kang <[email protected]>
> To: The Haskell-Beginners Mailing List - Discussion of primarily
> ??? beginner-level topics related to Haskell <[email protected]>
> Subject: Re: [Haskell-beginners] Warning: Tab Character
> Message-ID:
> ??? <CALWtiK8DqDr292Bb=j7rea8unxbrrtt6++hssm82duzjy6m...@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Thanks! I figured out.
>
> On Sat, Nov 21, 2015 at 7:44 PM, Dan Stromberg <[email protected]> wrote:
>
>>
>> I believe the first version of make required tabs, but some subsequent
>> versions have relaxed that requirement to make things easier.
>>
>> Here's an example on a Linux Mint system (the 20's are of course spaces)
>> :
>> $ od -cx < Makefile
>> cmd output started 2015 Sat Nov 21 04:39:47 PM PST
>> 0000000? \n? g? o? :? \n? ? ? ? ? ? ? ? ? .? /? t? \n? \n
>>? ? ? ? ? ? 670a? ? 3a6f? ? 200a? ? 2020? ? 2e20? ? 742f? ? 0a0a
>> 0000016
>> above cmd output done? ? 2015 Sat Nov 21 04:39:47 PM PST
>> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>>
>> $ make
>> cmd output started 2015 Sat Nov 21 04:39:48 PM PST
>> Makefile:3: *** missing separator.? Stop.
>> above cmd output done? ? 2015 Sat Nov 21 04:39:48 PM PST
>> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>>
>> $ make --version
>> cmd output started 2015 Sat Nov 21 04:39:53 PM PST
>> GNU Make 3.81
>> Copyright (C) 2006? Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.
>> There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
>> PARTICULAR PURPOSE.
>>
>> This program built for i686-pc-linux-gnu
>> above cmd output done? ? 2015 Sat Nov 21 04:39:53 PM PST
>> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>>
>>
>> I'll add that vim's Makefile syntax highlighting puts the space-indented
>> line in red, suggesting an error.? Changing the spaces to a single tab
>> makes the red go away.
>>
>> HTH
>>
>> On Sat, Nov 21, 2015 at 3:34 PM, Thomas Jakway <[email protected]> wrote:
>>
>>> Why would make require tabs...?
>>> Admittedly it's been a long time since I've written any makefiles by
>>> hand
>>> but I always use spaces instead of tabs and have never had any problems.
>>>
>>> On Nov 21, 2015 6:01 PM, David Moberg <[email protected]> wrote:
>>> >
>>> > Have you found "soft tabs"? That option will make TextMate use spaces
>>> instead of tab characters. Read 4.11 "Using Spaces Instead of Tabs" in
>>> Dan
>>> Strombergs link for instrucitons.
>>> >
>>> > 2015-11-21 21:36 GMT+01:00 Jeon-Young Kang <[email protected]>:
>>> >>
>>> >> I've tried to choose "instead of spaces". But there is no option of
>>> mine (Textmate 2 beta).
>>> >>
>>> >> On Sat, Nov 21, 2015 at 3:14 PM, Dan Stromberg <[email protected]>
>>> wrote:
>>> >>>
>>> >>>
>>> >>> Perhaps enable soft tabs?
>>> >>> https://manual.macromates.com/en/working_with_text
>>> >>>
>>> >>> This is an issue in Python too (at least from PEP8's perspective) -
>>> but note that many "make" programs require tabs instead of spaces.
>>> >>>
>>> >>> On Sat, Nov 21, 2015 at 11:13 AM, Jeon-Young Kang
>>> >>> <[email protected]>
>>> wrote:
>>> >>>>
>>> >>>> Hello everyone.
>>> >>>>
>>> >>>>
>>> >>>> I am a newbie of Haskell, using Textmate on mac.
>>> >>>>
>>> >>>>
>>> >>>> I got the following warning. How can I fix it?
>>> >>>>
>>> >>>>
>>> >>>> Warning:
>>> >>>>
>>> >>>>? ? Tab character
>>> >>>>
>>> >>>> Ok, modules loaded: Main.
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>> Sincerely,
>>> >>>> Young
>>> >>>>
>>> >>>> _______________________________________________
>>> >>>> Beginners mailing list
>>> >>>> [email protected]
>>> >>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>> >>>>
>>> >>>
>>> >>>
>>> >>>
>>> >>> --
>>> >>> Dan Stromberg
>>> >>>
>>> >>> _______________________________________________
>>> >>> Beginners mailing list
>>> >>> [email protected]
>>> >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>> >>>
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> Department of Geography
>>> >> State University of New York at Buffalo
>>> >>
>>> >> [email protected]
>>> >>
>>> >> Jeon-Young Kang
>>> >>
>>> >> _______________________________________________
>>> >> Beginners mailing list
>>> >> [email protected]
>>> >> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>> >>
>>> >
>>> _______________________________________________
>>> Beginners mailing list
>>> [email protected]
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>
>>
>>
>>
>> --
>> Dan Stromberg
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>>
>
>
> --
> Department of Geography
> State University of New York at Buffalo
>
> [email protected]
>
> Jeon-Young Kang
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://mail.haskell.org/pipermail/beginners/attachments/20151121/efe59567/attachment-0001.html>
>
> ------------------------------
>
> Message: 3
> Date: Sat, 21 Nov 2015 20:22:04 -0500
> From: Thomas Jakway <[email protected]>
> To: The Haskell-Beginners Mailing List - Discussion of primarily
> ??? beginner-level topics related to Haskell <[email protected]>
> Subject: Re: [Haskell-beginners] Warning: Tab Character
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=utf-8
>
> Huh, cool.? I had no idea.? Thanks!
>
> On Nov 21, 2015 7:44 PM, Dan Stromberg <[email protected]> wrote:
>>
>>
>> I believe the first version of make required tabs, but some subsequent
>> versions have relaxed that requirement to make things easier.
>>
>> Here's an example on a Linux Mint system (the 20's are of course spaces)
>> :
>> $ od -cx < Makefile
>> cmd output started 2015 Sat Nov 21 04:39:47 PM PST
>> 0000000? \n?? g?? o?? :? \n?????????????????? .?? /?? t? \n? \n
>> ?????????? 670a??? 3a6f??? 200a??? 2020??? 2e20??? 742f??? 0a0a
>> 0000016
>> above cmd output done??? 2015 Sat Nov 21 04:39:47 PM PST
>> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>>
>> $ make
>> cmd output started 2015 Sat Nov 21 04:39:48 PM PST
>> Makefile:3: *** missing separator.? Stop.
>> above cmd output done??? 2015 Sat Nov 21 04:39:48 PM PST
>> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>>
>> $ make --version
>> cmd output started 2015 Sat Nov 21 04:39:53 PM PST
>> GNU Make 3.81
>> Copyright (C) 2006? Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.
>> There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
>> PARTICULAR PURPOSE.
>>
>> This program built for i686-pc-linux-gnu
>> above cmd output done??? 2015 Sat Nov 21 04:39:53 PM PST
>> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>>
>>
>> I'll add that vim's Makefile syntax highlighting puts the space-indented
>> line in red, suggesting an error.? Changing the spaces to a single tab
>> makes the red go away.
>>
>> HTH
>>
>> On Sat, Nov 21, 2015 at 3:34 PM, Thomas Jakway <[email protected]> wrote:
>>>
>>> Why would make require tabs...?
>>> Admittedly it's been a long time since I've written any makefiles by hand
>>> but I always use spaces instead of tabs and have never had any problems.
>>>
>>> On Nov 21, 2015 6:01 PM, David Moberg <[email protected]> wrote:
>>> >
>>> > Have you found "soft tabs"? That option will make?TextMate use spaces
>>> > instead of tab characters. Read?4.11 "Using Spaces Instead of Tabs" in
>>> > Dan Strombergs link for instrucitons.
>>> >
>>> > 2015-11-21 21:36 GMT+01:00 Jeon-Young Kang <[email protected]>:
>>> >>
>>> >> I've tried to choose "instead of spaces". But there is no option of
>>> >> mine (Textmate 2 beta).
>>> >>
>>> >> On Sat, Nov 21, 2015 at 3:14 PM, Dan Stromberg <[email protected]>
>>> >> wrote:
>>> >>>
>>> >>>
>>> >>> Perhaps enable soft tabs?
>>> >>> https://manual.macromates.com/en/working_with_text
>>> >>>
>>> >>> This is an issue in Python too (at least from PEP8's perspective) -
>>> >>> but note that many "make" programs require tabs instead of spaces.
>>> >>>
>>> >>> On Sat, Nov 21, 2015 at 11:13 AM, Jeon-Young Kang
>>> >>> <[email protected]> wrote:
>>> >>>>
>>> >>>> Hello everyone.
>>> >>>>
>>> >>>>
>>> >>>> I am a newbie of Haskell, using Textmate on mac.
>>> >>>>
>>> >>>>
>>> >>>> I got the following warning. How can I fix it?
>>> >>>>
>>> >>>>
>>> >>>> Warning:
>>> >>>>
>>> >>>> ? ? Tab character
>>> >>>>
>>> >>>> Ok, modules loaded: Main.
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>> Sincerely,
>>> >>>> Young
>>> >>>>
>>> >>>> _______________________________________________
>>> >>>> Beginners mailing list
>>> >>>> [email protected]
>>> >>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>> >>>>
>>> >>>
>>> >>>
>>> >>>
>>> >>> --
>>> >>> Dan Stromberg
>>> >>>
>>> >>> _______________________________________________
>>> >>> Beginners mailing list
>>> >>> [email protected]
>>> >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>> >>>
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> Department of Geography
>>> >> State University of New York at Buffalo
>>> >>
>>> >> [email protected]
>>> >> ?
>>> >> Jeon-Young Kang
>>> >>
>>> >> _______________________________________________
>>> >> Beginners mailing list
>>> >> [email protected]
>>> >> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>> >>
>>> >
>>> _______________________________________________
>>> Beginners mailing list
>>> [email protected]
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>>
>>
>>
>> --
>> Dan Stromberg
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
> ------------------------------
>
> End of Beginners Digest, Vol 89, Issue 38
> *****************************************
>
>
>
------------------------------
Message: 2
Date: Tue, 24 Nov 2015 10:08:00 +0200
From: Gesh <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Beginners Digest, Vol 89, Issue 38
How to define a simple function
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8
On November 24, 2015 6:29:16 AM GMT+02:00, MJ Williams
<[email protected]> wrote:
>In short, your types do not match in your calculation of the half of
>the length of the list. According to GHCI
>
>length :: [a] -> Int
>(/) :: Fractional a => a -> a -> a
>floor :: (Integral b, RealFrac a) => a -> b
>
>Can you see how you might run into problems with this mixed bag of
>types?
>
>The only instance where you might find type compatibility between
>above types would be if you were passing a value of type `Int' to a
>function that accepted values of type `Integral'. `Int', if you like,
>is a subset of `Integral'
>
>A simple solution would be to replace `/' with `div' (`div :: Integral
>a => a -> a -> a'). Thus, your functionwould look something like
>
>halve :: [a] -> [[a], [a]]
>halve xs = [take longitud xs, drop longitud xs]
> where
> longitud = div (length xs) 2
>
>Hope that helps, and don't hesitate to come back with more questions.
>
>Matthew
>
>
>On 23/11/2015, Francisco Gutierrez <[email protected]> wrote:
>> Dear sirs:I am defining a function halve, that breaks a list in two
>halfs.
>> But I always get an error. Below is my code. What am I doing
>> wrong?Thanks!halve xs = [take (floor (longitud/2)), drop (floor
>> (longitud/2))]? where longitud = length xs
>>
>>
>> From: "[email protected]"
><[email protected]>
>> To: [email protected]
>> Sent: Saturday, November 21, 2015 8:21 PM
>> Subject: Beginners Digest, Vol 89, Issue 38
>>
>> Send Beginners mailing list submissions to
>> ??? [email protected]
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> ??? http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>> or, via email, send a message with subject or body 'help' to
>> ??? [email protected]
>>
>> You can reach the person managing the list at
>> ??? [email protected]
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Beginners digest..."
>>
>>
>> Today's Topics:
>>
>> ? 1. Re:? Warning: Tab Character (Dan Stromberg)
>> ? 2. Re:? Warning: Tab Character (Jeon-Young Kang)
>> ? 3. Re:? Warning: Tab Character (Thomas Jakway)
>>
>>
>>
>----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Sat, 21 Nov 2015 16:44:21 -0800
>> From: Dan Stromberg <[email protected]>
>> To: The Haskell-Beginners Mailing List - Discussion of primarily
>> ??? beginner-level topics related to Haskell <[email protected]>
>> Subject: Re: [Haskell-beginners] Warning: Tab Character
>> Message-ID:
>> ???
><caovkw55oxccehtqppc0bxqzjoeev5vcynbtwhaj9c5vhhm7...@mail.gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>> I believe the first version of make required tabs, but some
>subsequent
>> versions have relaxed that requirement to make things easier.
>>
>> Here's an example on a Linux Mint system (the 20's are of course
>spaces) :
>> $ od -cx < Makefile
>> cmd output started 2015 Sat Nov 21 04:39:47 PM PST
>> 0000000? \n? g? o? :? \n? ? ? ? ? ? ? ? ? .? /? t? \n? \n
>> ? ? ? ? ? 670a? ? 3a6f? ? 200a? ? 2020? ? 2e20? ? 742f? ? 0a0a
>> 0000016
>> above cmd output done? ? 2015 Sat Nov 21 04:39:47 PM PST
>> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>>
>> $ make
>> cmd output started 2015 Sat Nov 21 04:39:48 PM PST
>> Makefile:3: *** missing separator.? Stop.
>> above cmd output done? ? 2015 Sat Nov 21 04:39:48 PM PST
>> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>>
>> $ make --version
>> cmd output started 2015 Sat Nov 21 04:39:53 PM PST
>> GNU Make 3.81
>> Copyright (C) 2006? Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.
>> There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
>> PARTICULAR PURPOSE.
>>
>> This program built for i686-pc-linux-gnu
>> above cmd output done? ? 2015 Sat Nov 21 04:39:53 PM PST
>> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>>
>>
>> I'll add that vim's Makefile syntax highlighting puts the
>space-indented
>> line in red, suggesting an error.? Changing the spaces to a single
>tab
>> makes the red go away.
>>
>> HTH
>>
>> On Sat, Nov 21, 2015 at 3:34 PM, Thomas Jakway <[email protected]>
>wrote:
>>
>>> Why would make require tabs...?
>>> Admittedly it's been a long time since I've written any makefiles by
>hand
>>> but I always use spaces instead of tabs and have never had any
>problems.
>>>
>>> On Nov 21, 2015 6:01 PM, David Moberg <[email protected]> wrote:
>>> >
>>> > Have you found "soft tabs"? That option will make TextMate use
>spaces
>>> instead of tab characters. Read 4.11 "Using Spaces Instead of Tabs"
>in
>>> Dan
>>> Strombergs link for instrucitons.
>>> >
>>> > 2015-11-21 21:36 GMT+01:00 Jeon-Young Kang <[email protected]>:
>>> >>
>>> >> I've tried to choose "instead of spaces". But there is no option
>of
>>> mine (Textmate 2 beta).
>>> >>
>>> >> On Sat, Nov 21, 2015 at 3:14 PM, Dan Stromberg
><[email protected]>
>>> wrote:
>>> >>>
>>> >>>
>>> >>> Perhaps enable soft tabs?
>>> >>> https://manual.macromates.com/en/working_with_text
>>> >>>
>>> >>> This is an issue in Python too (at least from PEP8's
>perspective) -
>>> but note that many "make" programs require tabs instead of spaces.
>>> >>>
>>> >>> On Sat, Nov 21, 2015 at 11:13 AM, Jeon-Young Kang
>>> >>> <[email protected]>
>>> wrote:
>>> >>>>
>>> >>>> Hello everyone.
>>> >>>>
>>> >>>>
>>> >>>> I am a newbie of Haskell, using Textmate on mac.
>>> >>>>
>>> >>>>
>>> >>>> I got the following warning. How can I fix it?
>>> >>>>
>>> >>>>
>>> >>>> Warning:
>>> >>>>
>>> >>>>? ? Tab character
>>> >>>>
>>> >>>> Ok, modules loaded: Main.
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>> Sincerely,
>>> >>>> Young
>>> >>>>
>>> >>>> _______________________________________________
>>> >>>> Beginners mailing list
>>> >>>> [email protected]
>>> >>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>> >>>>
>>> >>>
>>> >>>
>>> >>>
>>> >>> --
>>> >>> Dan Stromberg
>>> >>>
>>> >>> _______________________________________________
>>> >>> Beginners mailing list
>>> >>> [email protected]
>>> >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>> >>>
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> Department of Geography
>>> >> State University of New York at Buffalo
>>> >>
>>> >> [email protected]
>>> >>
>>> >> Jeon-Young Kang
>>> >>
>>> >> _______________________________________________
>>> >> Beginners mailing list
>>> >> [email protected]
>>> >> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>> >>
>>> >
>>> _______________________________________________
>>> Beginners mailing list
>>> [email protected]
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>
>>
>>
>>
>> --
>> Dan Stromberg
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>>
><http://mail.haskell.org/pipermail/beginners/attachments/20151121/bef7b6d7/attachment-0001.html>
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Sat, 21 Nov 2015 20:03:08 -0500
>> From: Jeon-Young Kang <[email protected]>
>> To: The Haskell-Beginners Mailing List - Discussion of primarily
>> ??? beginner-level topics related to Haskell <[email protected]>
>> Subject: Re: [Haskell-beginners] Warning: Tab Character
>> Message-ID:
>> ???
><CALWtiK8DqDr292Bb=j7rea8unxbrrtt6++hssm82duzjy6m...@mail.gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>> Thanks! I figured out.
>>
>> On Sat, Nov 21, 2015 at 7:44 PM, Dan Stromberg <[email protected]>
>wrote:
>>
>>>
>>> I believe the first version of make required tabs, but some
>subsequent
>>> versions have relaxed that requirement to make things easier.
>>>
>>> Here's an example on a Linux Mint system (the 20's are of course
>spaces)
>>> :
>>> $ od -cx < Makefile
>>> cmd output started 2015 Sat Nov 21 04:39:47 PM PST
>>> 0000000? \n? g? o? :? \n? ? ? ? ? ? ? ? ? .? /? t? \n? \n
>>>? ? ? ? ? ? 670a? ? 3a6f? ? 200a? ? 2020? ? 2e20? ? 742f? ? 0a0a
>>> 0000016
>>> above cmd output done? ? 2015 Sat Nov 21 04:39:47 PM PST
>>> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>>>
>>> $ make
>>> cmd output started 2015 Sat Nov 21 04:39:48 PM PST
>>> Makefile:3: *** missing separator.? Stop.
>>> above cmd output done? ? 2015 Sat Nov 21 04:39:48 PM PST
>>> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>>>
>>> $ make --version
>>> cmd output started 2015 Sat Nov 21 04:39:53 PM PST
>>> GNU Make 3.81
>>> Copyright (C) 2006? Free Software Foundation, Inc.
>>> This is free software; see the source for copying conditions.
>>> There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
>>> PARTICULAR PURPOSE.
>>>
>>> This program built for i686-pc-linux-gnu
>>> above cmd output done? ? 2015 Sat Nov 21 04:39:53 PM PST
>>> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>>>
>>>
>>> I'll add that vim's Makefile syntax highlighting puts the
>space-indented
>>> line in red, suggesting an error.? Changing the spaces to a single
>tab
>>> makes the red go away.
>>>
>>> HTH
>>>
>>> On Sat, Nov 21, 2015 at 3:34 PM, Thomas Jakway <[email protected]>
>wrote:
>>>
>>>> Why would make require tabs...?
>>>> Admittedly it's been a long time since I've written any makefiles
>by
>>>> hand
>>>> but I always use spaces instead of tabs and have never had any
>problems.
>>>>
>>>> On Nov 21, 2015 6:01 PM, David Moberg <[email protected]> wrote:
>>>> >
>>>> > Have you found "soft tabs"? That option will make TextMate use
>spaces
>>>> instead of tab characters. Read 4.11 "Using Spaces Instead of Tabs"
>in
>>>> Dan
>>>> Strombergs link for instrucitons.
>>>> >
>>>> > 2015-11-21 21:36 GMT+01:00 Jeon-Young Kang <[email protected]>:
>>>> >>
>>>> >> I've tried to choose "instead of spaces". But there is no option
>of
>>>> mine (Textmate 2 beta).
>>>> >>
>>>> >> On Sat, Nov 21, 2015 at 3:14 PM, Dan Stromberg
><[email protected]>
>>>> wrote:
>>>> >>>
>>>> >>>
>>>> >>> Perhaps enable soft tabs?
>>>> >>> https://manual.macromates.com/en/working_with_text
>>>> >>>
>>>> >>> This is an issue in Python too (at least from PEP8's
>perspective) -
>>>> but note that many "make" programs require tabs instead of spaces.
>>>> >>>
>>>> >>> On Sat, Nov 21, 2015 at 11:13 AM, Jeon-Young Kang
>>>> >>> <[email protected]>
>>>> wrote:
>>>> >>>>
>>>> >>>> Hello everyone.
>>>> >>>>
>>>> >>>>
>>>> >>>> I am a newbie of Haskell, using Textmate on mac.
>>>> >>>>
>>>> >>>>
>>>> >>>> I got the following warning. How can I fix it?
>>>> >>>>
>>>> >>>>
>>>> >>>> Warning:
>>>> >>>>
>>>> >>>>? ? Tab character
>>>> >>>>
>>>> >>>> Ok, modules loaded: Main.
>>>> >>>>
>>>> >>>>
>>>> >>>>
>>>> >>>> Sincerely,
>>>> >>>> Young
>>>> >>>>
>>>> >>>> _______________________________________________
>>>> >>>> Beginners mailing list
>>>> >>>> [email protected]
>>>> >>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>> >>>>
>>>> >>>
>>>> >>>
>>>> >>>
>>>> >>> --
>>>> >>> Dan Stromberg
>>>> >>>
>>>> >>> _______________________________________________
>>>> >>> Beginners mailing list
>>>> >>> [email protected]
>>>> >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>> >>>
>>>> >>
>>>> >>
>>>> >>
>>>> >> --
>>>> >> Department of Geography
>>>> >> State University of New York at Buffalo
>>>> >>
>>>> >> [email protected]
>>>> >>
>>>> >> Jeon-Young Kang
>>>> >>
>>>> >> _______________________________________________
>>>> >> Beginners mailing list
>>>> >> [email protected]
>>>> >> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>> >>
>>>> >
>>>> _______________________________________________
>>>> Beginners mailing list
>>>> [email protected]
>>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>>
>>>
>>>
>>>
>>> --
>>> Dan Stromberg
>>>
>>> _______________________________________________
>>> Beginners mailing list
>>> [email protected]
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>
>>>
>>
>>
>> --
>> Department of Geography
>> State University of New York at Buffalo
>>
>> [email protected]
>>
>> Jeon-Young Kang
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>>
><http://mail.haskell.org/pipermail/beginners/attachments/20151121/efe59567/attachment-0001.html>
>>
>> ------------------------------
>>
>> Message: 3
>> Date: Sat, 21 Nov 2015 20:22:04 -0500
>> From: Thomas Jakway <[email protected]>
>> To: The Haskell-Beginners Mailing List - Discussion of primarily
>> ??? beginner-level topics related to Haskell <[email protected]>
>> Subject: Re: [Haskell-beginners] Warning: Tab Character
>> Message-ID: <[email protected]>
>> Content-Type: text/plain; charset=utf-8
>>
>> Huh, cool.? I had no idea.? Thanks!
>>
>> On Nov 21, 2015 7:44 PM, Dan Stromberg <[email protected]> wrote:
>>>
>>>
>>> I believe the first version of make required tabs, but some
>subsequent
>>> versions have relaxed that requirement to make things easier.
>>>
>>> Here's an example on a Linux Mint system (the 20's are of course
>spaces)
>>> :
>>> $ od -cx < Makefile
>>> cmd output started 2015 Sat Nov 21 04:39:47 PM PST
>>> 0000000? \n?? g?? o?? :? \n?????????????????? .?? /?? t? \n? \n
>>> ?????????? 670a??? 3a6f??? 200a??? 2020??? 2e20??? 742f??? 0a0a
>>> 0000016
>>> above cmd output done??? 2015 Sat Nov 21 04:39:47 PM PST
>>> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>>>
>>> $ make
>>> cmd output started 2015 Sat Nov 21 04:39:48 PM PST
>>> Makefile:3: *** missing separator.? Stop.
>>> above cmd output done??? 2015 Sat Nov 21 04:39:48 PM PST
>>> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>>>
>>> $ make --version
>>> cmd output started 2015 Sat Nov 21 04:39:53 PM PST
>>> GNU Make 3.81
>>> Copyright (C) 2006? Free Software Foundation, Inc.
>>> This is free software; see the source for copying conditions.
>>> There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
>>> PARTICULAR PURPOSE.
>>>
>>> This program built for i686-pc-linux-gnu
>>> above cmd output done??? 2015 Sat Nov 21 04:39:53 PM PST
>>> dstromberg@dell-inspiron:/var/tmp/make-tabs i686-pc-linux-gnu 25234
>>>
>>>
>>> I'll add that vim's Makefile syntax highlighting puts the
>space-indented
>>> line in red, suggesting an error.? Changing the spaces to a single
>tab
>>> makes the red go away.
>>>
>>> HTH
>>>
>>> On Sat, Nov 21, 2015 at 3:34 PM, Thomas Jakway <[email protected]>
>wrote:
>>>>
>>>> Why would make require tabs...?
>>>> Admittedly it's been a long time since I've written any makefiles
>by hand
>>>> but I always use spaces instead of tabs and have never had any
>problems.
>>>>
>>>> On Nov 21, 2015 6:01 PM, David Moberg <[email protected]> wrote:
>>>> >
>>>> > Have you found "soft tabs"? That option will make?TextMate use
>spaces
>>>> > instead of tab characters. Read?4.11 "Using Spaces Instead of
>Tabs" in
>>>> > Dan Strombergs link for instrucitons.
>>>> >
>>>> > 2015-11-21 21:36 GMT+01:00 Jeon-Young Kang <[email protected]>:
>>>> >>
>>>> >> I've tried to choose "instead of spaces". But there is no option
>of
>>>> >> mine (Textmate 2 beta).
>>>> >>
>>>> >> On Sat, Nov 21, 2015 at 3:14 PM, Dan Stromberg
><[email protected]>
>>>> >> wrote:
>>>> >>>
>>>> >>>
>>>> >>> Perhaps enable soft tabs?
>>>> >>> https://manual.macromates.com/en/working_with_text
>>>> >>>
>>>> >>> This is an issue in Python too (at least from PEP8's
>perspective) -
>>>> >>> but note that many "make" programs require tabs instead of
>spaces.
>>>> >>>
>>>> >>> On Sat, Nov 21, 2015 at 11:13 AM, Jeon-Young Kang
>>>> >>> <[email protected]> wrote:
>>>> >>>>
>>>> >>>> Hello everyone.
>>>> >>>>
>>>> >>>>
>>>> >>>> I am a newbie of Haskell, using Textmate on mac.
>>>> >>>>
>>>> >>>>
>>>> >>>> I got the following warning. How can I fix it?
>>>> >>>>
>>>> >>>>
>>>> >>>> Warning:
>>>> >>>>
>>>> >>>> ? ? Tab character
>>>> >>>>
>>>> >>>> Ok, modules loaded: Main.
>>>> >>>>
>>>> >>>>
>>>> >>>>
>>>> >>>> Sincerely,
>>>> >>>> Young
>>>> >>>>
>>>> >>>> _______________________________________________
>>>> >>>> Beginners mailing list
>>>> >>>> [email protected]
>>>> >>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>> >>>>
>>>> >>>
>>>> >>>
>>>> >>>
>>>> >>> --
>>>> >>> Dan Stromberg
>>>> >>>
>>>> >>> _______________________________________________
>>>> >>> Beginners mailing list
>>>> >>> [email protected]
>>>> >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>> >>>
>>>> >>
>>>> >>
>>>> >>
>>>> >> --
>>>> >> Department of Geography
>>>> >> State University of New York at Buffalo
>>>> >>
>>>> >> [email protected]
>>>> >> ?
>>>> >> Jeon-Young Kang
>>>> >>
>>>> >> _______________________________________________
>>>> >> Beginners mailing list
>>>> >> [email protected]
>>>> >> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>> >>
>>>> >
>>>> _______________________________________________
>>>> Beginners mailing list
>>>> [email protected]
>>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>
>>>
>>>
>>>
>>> --
>>> Dan Stromberg
>>
>> ------------------------------
>>
>> Subject: Digest Footer
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>>
>> ------------------------------
>>
>> End of Beginners Digest, Vol 89, Issue 38
>> *****************************************
>>
>>
>>
>_______________________________________________
>Beginners mailing list
>[email protected]
>http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Of course, besides the numerical hierarchy problems,
you also have a type incompatibility because you didn't apply take and drop to
enough arguments.
i.e. take (length xs `div` 2) :: [a] -> [a], whereas you seem to want take
(length xs `div` 2) xs :: [a].
Also, note that you could rewrite your code to make
use of the commonality of your arguments, so it becomes:
> halve xs = map ($xs) . map ($ (length xs `div` 2)) $ [take, drop]
(Untested, but it should work. Only possible problem I can see is that the
(length xs `div` 2) section might be illegal)
Sing map f . map g = map (f.g), we can rewrite this to:
> halve xs = map (\f -> f (length xs `div` 2) xs) [take, drop]
HTH,
Gesh
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 89, Issue 41
*****************************************