Re: Displaying a State
- From: Ketil Malde <ketil+news@xxxxxxxxx>
- Date: Thu, 05 Jan 2006 10:36:59 +0100
"Olivier" <olivier.marechal@xxxxxxxxxxx> writes:
> In fact, I want to create a Structure in which the name could be change. I
> want to set and get the state name.
Are you sure that's what you really want? A Structure where the name
is different, is really a different Structure, so why not treat it as
such? It is probably a better design choice to have something like:
changeName :: Structure -> String -> Structure
changeName s n = s {name = n}
(Or however you choose to implement it - if it's this trivial, you
may not want to bother declaring a separate function for it.)
-k
--
If I haven't seen further, it is by standing in the footprints of giants
.
- References:
- Displaying a State
- From: Olivier
- Re: Displaying a State
- From: Olivier
- Re: Displaying a State
- From: Henning Makholm
- Re: Displaying a State
- From: Philippa Cowderoy
- Re: Displaying a State
- From: Olivier
- Displaying a State
- Prev by Date: Re: Displaying a State
- Next by Date: Re: Displaying a State
- Previous by thread: Re: Displaying a State
- Next by thread: Re: Displaying a State
- Index(es):
Relevant Pages
|
Loading